From eb9cf1fe096f5f005734dd2e39c164e12770574d Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Thu, 8 Mar 2018 18:42:25 +0530 Subject: [PATCH] ceph-fuse: trim ceph-fuse -V output 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 (cherry picked from commit bfa5d4e3be54a188e9931d9d26a3e053fa95c531) --- src/ceph_fuse.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ceph_fuse.cc b/src/ceph_fuse.cc index 851425af097..cab48fc5d73 100644 --- a/src/ceph_fuse.cc +++ b/src/ceph_fuse.cc @@ -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; } -- 2.47.3