首页 文章 精选 留言 我的

精选列表

搜索[环境],共10000篇文章
优秀的个人博客,低调大师

操作记录:在ubuntu16.04.1配置fuse开发环境及fuse开发规范测试

1、使用ssh客户端,登陆ubuntu ssh-p2206root@127.0.0.1 2、下载fuse源码,进行编译,安装(当前工作目录为~) wgethttps://github.com/libfuse/libfuse/releases/download/fuse-3.0.0rc3/fuse-3.0.0rc3.tar.gz tarxvffuse-3.0.0rc3.tar.gz cdfuse-3.0.0rc3/ ./configure make-j8 makeinstall depmod modprobefuse 3、测试example\hello_ll是否能正常工作 cdexample/ ./hello_ll--help ./hello_ll/mnt mount cd/mnt ls cathello cd umount/mnt 针对example\hello_ll.c,进行改动测试: 1、在根目录下多创建一个文件出来,节点号定为5,名称为frombyte,内容为文本"http://www.datahf.net" 改动如下: /* FUSE:FilesysteminUserspace Copyright(C)2001-2007MiklosSzeredi<miklos@szeredi.hu> ThisprogramcanbedistributedunderthetermsoftheGNUGPL. SeethefileCOPYING. */ /**@file * *minimalexamplefilesystemusinglow-levelAPI * *Compilewith: * *gcc-Wallhello_ll.c`pkg-configfuse3--cflags--libs`-ohello_ll * *##Sourcecode## *\includehello_ll.c */ #defineFUSE_USE_VERSION30 #include<config.h> #include<fuse_lowlevel.h> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<errno.h> #include<fcntl.h> #include<unistd.h> #include<assert.h> staticconstchar*hello_str="HelloWorld!\n"; staticconstchar*hello_name="hello"; //change1#0 staticconstchar*inode5_str="http://www.datahf.net!\n"; staticconstchar*inode5_name="frombyte"; //changeend staticinthello_stat(fuse_ino_tino,structstat*stbuf) { stbuf->st_ino=ino; switch(ino){ case1: stbuf->st_mode=S_IFDIR|0755; stbuf->st_nlink=2; break; case2: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(hello_str); break; //change1#1 case5: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(inode5_str); break; //change1end default: return-1; } return0; } staticvoidhello_ll_getattr(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { structstatstbuf; (void)fi; memset(&stbuf,0,sizeof(stbuf)); if(hello_stat(ino,&stbuf)==-1) fuse_reply_err(req,ENOENT); else fuse_reply_attr(req,&stbuf,1.0); } staticvoidhello_ll_lookup(fuse_req_treq,fuse_ino_tparent,constchar*name) { structfuse_entry_parame; //change1#2 /* if(parent!=1||strcmp(name,hello_name)!=0) fuse_reply_err(req,ENOENT); else{ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); }*/ if(parent!=1) fuse_reply_err(req,ENOENT); elseif(strcmp(name,hello_name)==0){ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } elseif(strcmp(name,inode5_name)==0){ memset(&e,0,sizeof(e)); e.ino=5; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } else fuse_reply_err(req,ENOENT); //change1end } structdirbuf{ char*p; size_tsize; }; staticvoiddirbuf_add(fuse_req_treq,structdirbuf*b,constchar*name, fuse_ino_tino) { structstatstbuf; size_toldsize=b->size; b->size+=fuse_add_direntry(req,NULL,0,name,NULL,0); b->p=(char*)realloc(b->p,b->size); memset(&stbuf,0,sizeof(stbuf)); stbuf.st_ino=ino; fuse_add_direntry(req,b->p+oldsize,b->size-oldsize,name,&stbuf, b->size); } #definemin(x,y)((x)<(y)?(x):(y)) staticintreply_buf_limited(fuse_req_treq,constchar*buf,size_tbufsize, off_toff,size_tmaxsize) { if(off<bufsize) returnfuse_reply_buf(req,buf+off, min(bufsize-off,maxsize)); else returnfuse_reply_buf(req,NULL,0); } staticvoidhello_ll_readdir(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; if(ino!=1) fuse_reply_err(req,ENOTDIR); else{ structdirbufb; memset(&b,0,sizeof(b)); dirbuf_add(req,&b,".",1); dirbuf_add(req,&b,"..",1); dirbuf_add(req,&b,hello_name,2); //change1 dirbuf_add(req,&b,inode5_name,5); //end reply_buf_limited(req,b.p,b.size,off,size); free(b.p); } } staticvoidhello_ll_open(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { //change1 //if(ino!=2) if((ino!=2)&&(ino!=5)) //end fuse_reply_err(req,EISDIR); elseif((fi->flags&3)!=O_RDONLY) fuse_reply_err(req,EACCES); else fuse_reply_open(req,fi); } staticvoidhello_ll_read(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; //change1 //assert(ino==2); //reply_buf_limited(req,hello_str,strlen(hello_str),off,size); switch(ino){ case2: reply_buf_limited(req,hello_str,strlen(hello_str),off,size); break; case5: reply_buf_limited(req,inode5_str,strlen(inode5_str),off,size); break; default: ; } //end } staticstructfuse_lowlevel_opshello_ll_oper={ .lookup =hello_ll_lookup, .getattr =hello_ll_getattr, .readdir =hello_ll_readdir, .open =hello_ll_open, .read =hello_ll_read, }; intmain(intargc,char*argv[]) { structfuse_argsargs=FUSE_ARGS_INIT(argc,argv); structfuse_session*se; structfuse_cmdline_optsopts; intret=-1; if(fuse_parse_cmdline(&args,&opts)!=0) return1; if(opts.show_help){ printf("usage:%s[options]<mountpoint>\n\n",argv[0]); fuse_cmdline_help(); fuse_lowlevel_help(); ret=0; gotoerr_out1; }elseif(opts.show_version){ printf("FUSElibraryversion%s\n",fuse_pkgversion()); fuse_lowlevel_version(); ret=0; gotoerr_out1; } se=fuse_session_new(&args,&hello_ll_oper, sizeof(hello_ll_oper),NULL); if(se==NULL) gotoerr_out1; if(fuse_set_signal_handlers(se)!=0) gotoerr_out2; if(fuse_session_mount(se,opts.mountpoint)!=0) gotoerr_out3; fuse_daemonize(opts.foreground); /*Blockuntilctrl+corfusermount-u*/ if(opts.singlethread) ret=fuse_session_loop(se); else ret=fuse_session_loop_mt(se,opts.clone_fd); fuse_session_unmount(se); err_out3: fuse_remove_signal_handlers(se); err_out2: fuse_session_destroy(se); err_out1: free(opts.mountpoint); fuse_opt_free_args(&args); returnret?1:0; } 结果测试: cd~/fuse-3.0.0rc3/example/ make ./hello_ll/mnt ll-i/mnt cat/mnt/frombyte umount/mnt 2、增加目录、增加二进制文件测试: /* FUSE:FilesysteminUserspace Copyright(C)2001-2007MiklosSzeredi<miklos@szeredi.hu> ThisprogramcanbedistributedunderthetermsoftheGNUGPL. SeethefileCOPYING. */ /**@file * *minimalexamplefilesystemusinglow-levelAPI * *Compilewith: * *gcc-Wallhello_ll.c`pkg-configfuse3--cflags--libs`-ohello_ll * *##Sourcecode## *\includehello_ll.c */ #defineFUSE_USE_VERSION30 #include<config.h> #include<fuse_lowlevel.h> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<errno.h> #include<fcntl.h> #include<unistd.h> #include<assert.h> staticconstchar*hello_str="HelloWorld!\n"; staticconstchar*hello_name="hello"; //change1#0 staticconstchar*inode5_str="http://www.datahf.net!\n"; staticconstchar*inode5_name="frombyte"; staticconstchar*inode3_name="frombyte.dir"; staticconstchar*inode6_name="inode6.img"; //changeend staticinthello_stat(fuse_ino_tino,structstat*stbuf) { stbuf->st_ino=ino; switch(ino){ case1: stbuf->st_mode=S_IFDIR|0755; stbuf->st_nlink=3; break; case2: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(hello_str); break; //change1#1 case3: stbuf->st_mode=S_IFDIR|0755; stbuf->st_nlink=2; break; case5: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(inode5_str); break; case6: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=1024*1024*1024; break; //change1end default: return-1; } return0; } staticvoidhello_ll_getattr(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { structstatstbuf; (void)fi; memset(&stbuf,0,sizeof(stbuf)); if(hello_stat(ino,&stbuf)==-1) fuse_reply_err(req,ENOENT); else fuse_reply_attr(req,&stbuf,1.0); } staticvoidhello_ll_lookup(fuse_req_treq,fuse_ino_tparent,constchar*name) { structfuse_entry_parame; //change1#2 /* if(parent!=1||strcmp(name,hello_name)!=0) fuse_reply_err(req,ENOENT); else{ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); }*/ switch(parent){ case1: if(strcmp(name,hello_name)==0){ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } elseif(strcmp(name,inode3_name)==0){ memset(&e,0,sizeof(e)); e.ino=3; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } else fuse_reply_err(req,ENOENT); break; case3: if(strcmp(name,inode5_name)==0){ memset(&e,0,sizeof(e)); e.ino=5; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } elseif(strcmp(name,inode6_name)==0){ memset(&e,0,sizeof(e)); e.ino=6; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } else fuse_reply_err(req,ENOENT); break; default: fuse_reply_err(req,ENOENT); break; } //change1end } structdirbuf{ char*p; size_tsize; }; staticvoiddirbuf_add(fuse_req_treq,structdirbuf*b,constchar*name, fuse_ino_tino) { structstatstbuf; size_toldsize=b->size; b->size+=fuse_add_direntry(req,NULL,0,name,NULL,0); b->p=(char*)realloc(b->p,b->size); memset(&stbuf,0,sizeof(stbuf)); stbuf.st_ino=ino; fuse_add_direntry(req,b->p+oldsize,b->size-oldsize,name,&stbuf, b->size); } #definemin(x,y)((x)<(y)?(x):(y)) staticintreply_buf_limited(fuse_req_treq,constchar*buf,size_tbufsize, off_toff,size_tmaxsize) { if(off<bufsize) returnfuse_reply_buf(req,buf+off, min(bufsize-off,maxsize)); else returnfuse_reply_buf(req,NULL,0); } staticvoidhello_ll_readdir(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; /* if(ino!=1) fuse_reply_err(req,ENOTDIR); else{*/ structdirbufb; switch(ino){ case1: memset(&b,0,sizeof(b)); dirbuf_add(req,&b,".",1); dirbuf_add(req,&b,"..",1); dirbuf_add(req,&b,hello_name,2); //change1 dirbuf_add(req,&b,inode3_name,3); //end reply_buf_limited(req,b.p,b.size,off,size); free(b.p); break; case3: memset(&b,0,sizeof(b)); dirbuf_add(req,&b,".",3); dirbuf_add(req,&b,"..",1); dirbuf_add(req,&b,inode5_name,5); dirbuf_add(req,&b,inode6_name,6); reply_buf_limited(req,b.p,b.size,off,size); free(b.p); break; default: fuse_reply_err(req,ENOTDIR); break; } //} } staticvoidhello_ll_open(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { //change1 //if(ino!=2) switch(ino) { case2:case5:case6: if((fi->flags&3)!=O_RDONLY) fuse_reply_err(req,EACCES); else fuse_reply_open(req,fi); break; default: fuse_reply_err(req,EISDIR); break; } } staticvoidhello_ll_read(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; char*tbuf; //change1 //assert(ino==2); //reply_buf_limited(req,hello_str,strlen(hello_str),off,size); switch(ino){ case2: reply_buf_limited(req,hello_str,strlen(hello_str),off,size); break; case5: reply_buf_limited(req,inode5_str,strlen(inode5_str),off,size); break; case6: tbuf=(char*)malloc(size); for(inti=0;i<size/sizeof(int);i++) ((int*)tbuf)[i]=size; fuse_reply_buf(req,tbuf,size); free(tbuf); default: ; } //end } staticstructfuse_lowlevel_opshello_ll_oper={ .lookup =hello_ll_lookup, .getattr =hello_ll_getattr, .readdir =hello_ll_readdir, .open =hello_ll_open, .read =hello_ll_read, }; intmain(intargc,char*argv[]) { structfuse_argsargs=FUSE_ARGS_INIT(argc,argv); structfuse_session*se; structfuse_cmdline_optsopts; intret=-1; if(fuse_parse_cmdline(&args,&opts)!=0) return1; if(opts.show_help){ printf("usage:%s[options]<mountpoint>\n\n",argv[0]); fuse_cmdline_help(); fuse_lowlevel_help(); ret=0; gotoerr_out1; }elseif(opts.show_version){ printf("FUSElibraryversion%s\n",fuse_pkgversion()); fuse_lowlevel_version(); ret=0; gotoerr_out1; } se=fuse_session_new(&args,&hello_ll_oper, sizeof(hello_ll_oper),NULL); if(se==NULL) gotoerr_out1; if(fuse_set_signal_handlers(se)!=0) gotoerr_out2; if(fuse_session_mount(se,opts.mountpoint)!=0) gotoerr_out3; fuse_daemonize(opts.foreground); /*Blockuntilctrl+corfusermount-u*/ if(opts.singlethread) ret=fuse_session_loop(se); else ret=fuse_session_loop_mt(se,opts.clone_fd); fuse_session_unmount(se); err_out3: fuse_remove_signal_handlers(se); err_out2: fuse_session_destroy(se); err_out1: free(opts.mountpoint); fuse_opt_free_args(&args); returnret?1:0; } 3、fuse的根节点号是1,在源码中是以常量的方式定义的,本来想改成变量,估计工作量和稳定性会有麻烦,变通处理吧。 4、修改代码,实现自定义文件生成 /* FUSE:FilesysteminUserspace Copyright(C)2001-2007MiklosSzeredi<miklos@szeredi.hu> ThisprogramcanbedistributedunderthetermsoftheGNUGPL. SeethefileCOPYING. */ /**@file * *minimalexamplefilesystemusinglow-levelAPI * *Compilewith: * *gcc-Wallhello_ll.c`pkg-configfuse3--cflags--libs`-ohello_ll * *##Sourcecode## *\includehello_ll.c */ /*change2: 定义一个idx文件,格式为typedefstructStr_idx{ intlow_off; shorthige_off; shortfileid; }str_idx; 按每8字节一个索引的方式组合某个镜像文件,文件ID为0表示自由,用字符'F'填充。 文件ID为1,表示使用当前目录下的$MFT文件做为数据源进行加工。 测试代码,至少还需补全: 1、配置文件(文件大小、源文件路径等)的参数指定 2、idx结构的准确大小(int,short和机器位长有关系,需修改为与机器位长无关的数据类型) 3、排错:文件打不开 4、排错:文件大小与idx不符 5、排错:文件溢出处理 6、修改缓冲机制,不能先把源文件全读到内存,需要建立缓冲机制,应对读函数,或者简单地用fopen加缓冲处理。 bywww.datahf.net张宇 */ #defineFUSE_USE_VERSION30 #include<config.h> #include<fuse_lowlevel.h> #include<stdio.h> #include<stdlib.h> #include<string.h> #include<errno.h> #include<fcntl.h> #include<unistd.h> #include<assert.h> #include<string.h> staticconstchar*hello_str="HelloWorld!\n"; staticconstchar*hello_name="hello"; //change1#0 staticconstchar*inode5_str="http://www.datahf.net!\n"; staticconstchar*inode5_name="frombyte"; staticconstchar*inode3_name="frombyte.dir"; staticconstchar*inode6_name="inode6.img"; unsignedchar*databuf; #defineINODE6_SIZE(1024*1024*4) //changeend staticinthello_stat(fuse_ino_tino,structstat*stbuf) { stbuf->st_ino=ino; switch(ino){ case1: stbuf->st_mode=S_IFDIR|0755; stbuf->st_nlink=3; break; case2: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(hello_str); break; //change1#1 case3: stbuf->st_mode=S_IFDIR|0755; stbuf->st_nlink=2; break; case5: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=strlen(inode5_str); break; case6: stbuf->st_mode=S_IFREG|0444; stbuf->st_nlink=1; stbuf->st_size=INODE6_SIZE; break; //change1end default: return-1; } return0; } staticvoidhello_ll_getattr(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { structstatstbuf; (void)fi; memset(&stbuf,0,sizeof(stbuf)); if(hello_stat(ino,&stbuf)==-1) fuse_reply_err(req,ENOENT); else fuse_reply_attr(req,&stbuf,1.0); } staticvoidhello_ll_lookup(fuse_req_treq,fuse_ino_tparent,constchar*name) { structfuse_entry_parame; //change1#2 /* if(parent!=1||strcmp(name,hello_name)!=0) fuse_reply_err(req,ENOENT); else{ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); }*/ switch(parent){ case1: if(strcmp(name,hello_name)==0){ memset(&e,0,sizeof(e)); e.ino=2; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } elseif(strcmp(name,inode3_name)==0){ memset(&e,0,sizeof(e)); e.ino=3; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } else fuse_reply_err(req,ENOENT); break; case3: if(strcmp(name,inode5_name)==0){ memset(&e,0,sizeof(e)); e.ino=5; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } elseif(strcmp(name,inode6_name)==0){ memset(&e,0,sizeof(e)); e.ino=6; e.attr_timeout=1.0; e.entry_timeout=1.0; hello_stat(e.ino,&e.attr); fuse_reply_entry(req,&e); } else fuse_reply_err(req,ENOENT); break; default: fuse_reply_err(req,ENOENT); break; } //change1end } structdirbuf{ char*p; size_tsize; }; //change2 typedefstructStr_idx{ intlow_off; shorthige_off; shortfileid; }str_idx; staticvoiddirbuf_add(fuse_req_treq,structdirbuf*b,constchar*name, fuse_ino_tino) { structstatstbuf; size_toldsize=b->size; b->size+=fuse_add_direntry(req,NULL,0,name,NULL,0); b->p=(char*)realloc(b->p,b->size); memset(&stbuf,0,sizeof(stbuf)); stbuf.st_ino=ino; fuse_add_direntry(req,b->p+oldsize,b->size-oldsize,name,&stbuf, b->size); } #definemin(x,y)((x)<(y)?(x):(y)) staticintreply_buf_limited(fuse_req_treq,constchar*buf,size_tbufsize, off_toff,size_tmaxsize) { if(off<bufsize) returnfuse_reply_buf(req,buf+off, min(bufsize-off,maxsize)); else returnfuse_reply_buf(req,NULL,0); } staticvoidhello_ll_readdir(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; /* if(ino!=1) fuse_reply_err(req,ENOTDIR); else{*/ structdirbufb; switch(ino){ case1: memset(&b,0,sizeof(b)); dirbuf_add(req,&b,".",1); dirbuf_add(req,&b,"..",1); dirbuf_add(req,&b,hello_name,2); //change1 dirbuf_add(req,&b,inode3_name,3); //end reply_buf_limited(req,b.p,b.size,off,size); free(b.p); break; case3: memset(&b,0,sizeof(b)); dirbuf_add(req,&b,".",3); dirbuf_add(req,&b,"..",1); dirbuf_add(req,&b,inode5_name,5); dirbuf_add(req,&b,inode6_name,6); reply_buf_limited(req,b.p,b.size,off,size); free(b.p); break; default: fuse_reply_err(req,ENOTDIR); break; } //} } staticvoidhello_ll_open(fuse_req_treq,fuse_ino_tino, structfuse_file_info*fi) { //change1 //if(ino!=2) switch(ino) { case2:case5:case6: if((fi->flags&3)!=O_RDONLY) fuse_reply_err(req,EACCES); else fuse_reply_open(req,fi); break; default: fuse_reply_err(req,EISDIR); break; } } staticvoidhello_ll_read(fuse_req_treq,fuse_ino_tino,size_tsize, off_toff,structfuse_file_info*fi) { (void)fi; //change1 //assert(ino==2); //reply_buf_limited(req,hello_str,strlen(hello_str),off,size); switch(ino){ case2: reply_buf_limited(req,hello_str,strlen(hello_str),off,size); break; case5: reply_buf_limited(req,inode5_str,strlen(inode5_str),off,size); break; case6: fuse_reply_buf(req,databuf+off,size); default: ; } //end } staticstructfuse_lowlevel_opshello_ll_oper={ .lookup =hello_ll_lookup, .getattr =hello_ll_getattr, .readdir =hello_ll_readdir, .open =hello_ll_open, .read =hello_ll_read, }; intmain(intargc,char*argv[]) { structfuse_argsargs=FUSE_ARGS_INIT(argc,argv); structfuse_session*se; structfuse_cmdline_optsopts; intret=-1; if(fuse_parse_cmdline(&args,&opts)!=0) return1; if(opts.show_help){ printf("usage:%s[options]<mountpoint>\n\n",argv[0]); fuse_cmdline_help(); fuse_lowlevel_help(); ret=0; gotoerr_out1; }elseif(opts.show_version){ printf("FUSElibraryversion%s\n",fuse_pkgversion()); fuse_lowlevel_version(); ret=0; gotoerr_out1; } //change2 FILE*f_idx,*f_img; f_idx=fopen("./1.idx","rb"); f_img=fopen("./$MFT","rb"); if((f_idx==-1)||(f_img==-1)) { printf("f_idxis%d\nf_imgis%d\n",f_idx,f_img); gotoerr_out1; } size_ts_idx,s_img; s_idx=512; unsignedcharidx_buf[512]; databuf=NULL; databuf=(char*)malloc(INODE6_SIZE); fread(idx_buf,512,1,f_idx); inti=0; structStr_idx*tidx; tidx=(structStr_idx*)idx_buf; for(i=0;i<4;i++) { if(tidx[i].fileid==0) memset(databuf+i*1024*1024,'F',1024*1024); elseif(tidx[i].fileid==1) { fseek(f_img, tidx[i].low_off*1024*1024+tidx[i].hige_off*1024*1024, SEEK_SET); fread(databuf+i*1024*1024,1024*1024,1,f_img); } else ; printf("#i:%d,%d,%d\n",tidx[i].low_off,tidx[i].hige_off,tidx[i].fileid); } se=fuse_session_new(&args,&hello_ll_oper, sizeof(hello_ll_oper),NULL); if(se==NULL) gotoerr_out1; if(fuse_set_signal_handlers(se)!=0) gotoerr_out2; if(fuse_session_mount(se,opts.mountpoint)!=0) gotoerr_out3; fuse_daemonize(opts.foreground); /*Blockuntilctrl+corfusermount-u*/ if(opts.singlethread) ret=fuse_session_loop(se); else ret=fuse_session_loop_mt(se,opts.clone_fd); fuse_session_unmount(se); err_out3: fuse_remove_signal_handlers(se); err_out2: fuse_session_destroy(se); err_out1: free(opts.mountpoint); fuse_opt_free_args(&args); returnret?1:0; } 待续

优秀的个人博客,低调大师

Easy Retry 2.5.0 新增命名空间环境隔离、丰富的Dashboard看板、多维度告警配置

🔥🔥🔥 灵活,可靠和快速的分布式任务重试和分布式任务调度平台 > ✅️ 可重放,可管控、为提高分布式业务系统一致性的分布式任务重试平台 > ✅️ 支持秒级、可中断、可编排的高性能分布式任务调度平台 易用性 业务接入成本小。避免依赖研发人员的技术水平,保障稳定性 灵活性 能够动态调整配置,启动 / 停止任务,以及终止运行中的任务 操作简单 分钟上手,支持 WEB 页面对任务数据 CRUD 操作。 数据大盘 实时管控系统任务数据 分布式重试任务 支持多样化退避策略、多样化重试类型、流量管控等 分布式调度任务 提供丰富的任务触发策略、任务编排、任务分片、停止恢复、失败重试等 任务数据管理 可以做到数据不丢失、数据一键回放 容器化部署 服务端支持 docker 容器部署 高性能调度平台 支持服务端节点动态扩容和缩容 支持多样化的告警方式 邮箱、企业微信、钉钉、飞书 设计思想 开源组件对比 项目 Quartz Elastic-Job XXL-JOB Easy Retry 定时调度 Cron Cron Cron 1. 定时任务 2. 秒级任务(无需依赖外部中间件) 3. 固定频率 重试任务 不支持 不支持 不支持 1.支持本地&远程重试模式 2.支持各种常用组件的重试 比如dubbo/feign 3.支持多种退避策略 4.丰富的重试风暴管控手段 ...... 任务编排 不支持 不支持 不支持 可视化任务编排 分布式计算 不支持 静态分片 广播 1. 广播执行 2. 集群执行 3. 静态分片 多语言 Java 1. Java 2. 脚本任务 1. Java 2. 脚本任务 1. Java 2. 脚本任务 3. HTTP任务 4. Kettle 可视化 无 弱 1. 历史记录 2. 运行日志(不支持存储)3. 监控大盘 1. 历史记录 2. 运行日志(支持持久化) 3. 监控大盘 4. 操作记录 5. 查看日志堆栈 可运维 无 启用、禁用任务 1. 启用、禁用任务 2. 手动运行任务 3. 停止任务 1. 启用、禁用任务 2. 手动运行任务 3. 停止任务 报警监控 无 邮件 邮件 1. 邮件 2. 钉钉 3. 企微 4. 飞书 性能 每次调度通过DB抢锁,对DB压力大 ZooKeeper是性能瓶颈 采用Master节点调度,Master节点压力大 系统采用多bucket模式,借助负载均衡算法,确保每个节点能够均衡处理任务,同时支持无限水平扩展,轻松应对海量任务调度 接入成本 只依赖DB接入成本低 需引入Zookeeper增加系统复杂性和维护成本 只依赖DB接入成本低 只依赖DB接入成本低 更新日志 支持通过nginx代理 将应用代理到 ip/xxx/ 路径下访问【新增】issues(opens new window) 任务调度新增手动暂停、取消、恢复执行中任务【新增】issues(opens new window) 任务调度新增失败告警通知【新增】issues(opens new window) Dashboard 添加任务调度数据展示【新增】issues(opens new window) 支持namespace隔离不同业务线的应用 【新增】issues(opens new window) 重试告警新增重试任务进入死信队列告警类型 【新增】issues(opens new window) 修复多节点服务端存在某节点无客户端连接时,手动触发和自动触发任务失败 【BUG】 支持服务端jar包作为子服务启动【新增】 netty client修改http协议增加Host请求头【优化】 优化服务端请求客户端路径多余/【优化】 修复分片模式参数提交失败问题【BUG】 场景编辑时场景名称和组不允许编辑【优化】 定时清除调度任务的历史日志 【新增】issues(opens new window) 告警支持通知负责人配置【新增】issues(opens new window) 参与者设计开发人员名单 https://gitee.com/zhengweilins(opens new window) https://gitee.com/zuojunlin(opens new window) https://gitee.com/zsg1994(opens new window) TODO LIST 支持查看实时日志 支持空间、组、任务等手动删除功能 支持企业微信通知 系统部分截图

资源下载

更多资源
腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册