]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
fuse2fs: rename the inusefile option to lockfile
authorTheodore Ts'o <tytso@mit.edu>
Thu, 12 Jun 2025 19:00:08 +0000 (15:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 12 Jun 2025 19:00:08 +0000 (15:00 -0400)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/fuse2fs.c

index d889bda43953f1c6fad70386a91649f322938b41..0f9cb6849aa7adcf14bfbd7688c00df9b84d00ba 100644 (file)
@@ -212,7 +212,7 @@ struct fuse2fs {
        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)) \
@@ -4235,7 +4235,7 @@ static struct fuse_opt fuse2fs_opts[] = {
        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),
@@ -4288,7 +4288,7 @@ static int fuse2fs_opt_proc(void *data, const char *arg,
        "    -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"
@@ -4417,22 +4417,22 @@ int main(int argc, char *argv[])
                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) */
@@ -4639,14 +4639,14 @@ out:
                        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);