Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ceph-fuse: add process to ceph-fuse --help #6821

Merged
merged 1 commit into from Dec 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 27 additions & 1 deletion src/ceph_fuse.cc
Expand Up @@ -37,9 +37,32 @@ using namespace std;
#include <sys/types.h>
#include <fcntl.h>

#include <fuse.h>

static void fuse_usage()
{
const char **argv = (const char **) malloc((2) * sizeof(char *));
argv[0] = "ceph-fuse";
argv[1] = "-h";
struct fuse_args args = FUSE_ARGS_INIT(2, (char**)argv);
if (fuse_parse_cmdline(&args, NULL, NULL, NULL) == -1) {
derr << "fuse_parse_cmdline failed." << dendl;
fuse_opt_free_args(&args);
free(argv);
}

assert(args.allocated); // Checking fuse has realloc'd args so we can free newargv
free(argv);
}
void usage()
{
cerr << "usage: ceph-fuse [-m mon-ip-addr:mon-port] <mount point>" << std::endl;
cout <<
"usage: ceph-fuse [-m mon-ip-addr:mon-port] <mount point> [OPTIONS]\n"
" --client_mountpoint/-r <root_directory>\n"
" use root_directory as the mounted root, rather than the full Ceph tree.\n"
"\n";
fuse_usage();
generic_client_usage();
}

int main(int argc, const char **argv, const char *envp[]) {
Expand All @@ -57,6 +80,9 @@ int main(int argc, const char **argv, const char *envp[]) {
} else if (ceph_argparse_flag(args, i, "--localize-reads", (char*)NULL)) {
cerr << "setting CEPH_OSD_FLAG_LOCALIZE_READS" << std::endl;
filer_flags |= CEPH_OSD_FLAG_LOCALIZE_READS;
} else if (ceph_argparse_flag(args, i, "-h", "--help", (char*)NULL)) {
usage();
assert(0);
} else {
++i;
}
Expand Down