]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-fuse: trim ceph-fuse -V output 21600/head
authorJos Collin <jcollin@redhat.com>
Thu, 8 Mar 2018 13:12:25 +0000 (18:42 +0530)
committerJos Collin <jcollin@redhat.com>
Mon, 23 Apr 2018 13:14:22 +0000 (18:44 +0530)
Trim 'ceph-fuse -V' output to print the FUSE library version and exit.

Fixes: http://tracker.ceph.com/issues/23248
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit bfa5d4e3be54a188e9931d9d26a3e053fa95c531)

src/ceph_fuse.cc

index 851425af097017b6d7d475bef3e53bf76fe1bdf1..cab48fc5d73fb4b5485844342ac2a1d5148af4ec 100644 (file)
@@ -93,6 +93,19 @@ int main(int argc, const char **argv, const char *envp[]) {
       filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS;
     } else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) {
       usage();
+    } else if (ceph_argparse_flag(args, i, "-V", (char*)nullptr)) {
+      const char* tmpargv[] = {
+       "ceph-fuse",
+       "-V"
+      };
+
+      struct fuse_args fargs = FUSE_ARGS_INIT(2, (char**)tmpargv);
+      if (fuse_parse_cmdline(&fargs, nullptr, nullptr, nullptr) == -1) {
+       derr << "fuse_parse_cmdline failed." << dendl;
+      }
+      assert(fargs.allocated);
+      fuse_opt_free_args(&fargs);
+      exit(0);
     } else {
       ++i;
     }