unsigned long offset;
unsigned int next_generation;
unsigned long long cache_size;
- char *inusefile;
+ char *lockfile;
};
#define FUSE2FS_CHECK_MAGIC(fs, ptr, num) do {if ((ptr)->magic != (num)) \
FUSE_OPT_KEY("noblock_validity", FUSE2FS_IGNORED),
FUSE_OPT_KEY("nodelalloc", FUSE2FS_IGNORED),
FUSE_OPT_KEY("cache_size=%s", FUSE2FS_CACHE_SIZE),
- FUSE2FS_OPT("inusefile=%s", inusefile, 0),
+ FUSE2FS_OPT("lockfile=%s", lockfile, 0),
FUSE_OPT_KEY("-V", FUSE2FS_VERSION),
FUSE_OPT_KEY("--version", FUSE2FS_VERSION),
" -o offset=<bytes> similar to mount -o offset=<bytes>, mount the partition starting at <bytes>\n"
" -o norecovery don't replay the journal\n"
" -o fuse2fs_debug enable fuse2fs debugging\n"
- " -o inusefile=<file> file to show that fuse is still using the file system image\n"
+ " -o lockfile=<file> file to show that fuse is still using the file system image\n"
" -o kernel run this as if it were the kernel, which sets:\n"
" allow_others,default_permissions,suid,dev\n"
" -o directio use O_DIRECT to read and write the disk\n"
fctx.alloc_all_blocks = 1;
}
- if(fctx.inusefile) {
- FILE* inusefile=fopen(fctx.inusefile, "w");
- if(!inusefile) {
- fprintf(stderr, "Requested inusefile=%s but couldn't open the file for writing\n", fctx.inusefile);
+ if(fctx.lockfile) {
+ FILE* lockfile=fopen(fctx.lockfile, "w");
+ if(!lockfile) {
+ fprintf(stderr, "Requested lockfile=%s but couldn't open the file for writing\n", fctx.lockfile);
exit(1);
}
- fclose(inusefile);
- char* resolved = realpath(fctx.inusefile, NULL);
+ fclose(lockfile);
+ char* resolved = realpath(fctx.lockfile, NULL);
if (!resolved) {
perror("realpath");
- fprintf(stderr, "Could not resolve realpath for inusefile=%s\n", fctx.inusefile);
- unlink(fctx.inusefile);
+ fprintf(stderr, "Could not resolve realpath for lockfile=%s\n", fctx.lockfile);
+ unlink(fctx.lockfile);
exit(1);
}
- free(fctx.inusefile);
- fctx.inusefile = resolved;
+ free(fctx.lockfile);
+ fctx.lockfile = resolved;
}
/* Start up the fs (while we still can use stdout) */
com_err(argv[0], err, "while closing fs");
global_fs = NULL;
}
- if(fctx.inusefile) {
- err = unlink(fctx.inusefile);
+ if(fctx.lockfile) {
+ err = unlink(fctx.lockfile);
if (err)
com_err(argv[0], errno, "while unlinking '%s'",
- fctx.inusefile);
+ fctx.lockfile);
}
- if (fctx.inusefile)
- free(fctx.inusefile);
+ if (fctx.lockfile)
+ free(fctx.lockfile);
if (fctx.device)
free(fctx.device);
fuse_opt_free_args(&args);