From: Sage Weil Date: Fri, 6 Jun 2008 17:14:03 +0000 (-0700) Subject: kclient: add mount_attempts mount option X-Git-Tag: v0.3~153 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0894862c3369819e677a8187261d9289e85cc719;p=ceph.git kclient: add mount_attempts mount option --- diff --git a/src/kernel/osd_client.c b/src/kernel/osd_client.c index b6175bb5ab8..9af6f9fcab0 100644 --- a/src/kernel/osd_client.c +++ b/src/kernel/osd_client.c @@ -255,7 +255,7 @@ done: bad: derr(0, "got corrupt osd_op_reply got %d expected %d\n", - msg->front.iov_len, sizeof(*rhead)); + (int)msg->front.iov_len, (int)sizeof(*rhead)); } diff --git a/src/kernel/super.c b/src/kernel/super.c index 17646b0945e..be3954651fc 100644 --- a/src/kernel/super.c +++ b/src/kernel/super.c @@ -344,6 +344,7 @@ enum { Opt_port, Opt_wsize, Opt_osdtimeout, + Opt_mount_attempts, /* int args above */ Opt_ip, Opt_unsafewrites, @@ -366,6 +367,7 @@ static match_table_t arg_tokens = { {Opt_port, "port=%d"}, {Opt_wsize, "wsize=%d"}, {Opt_osdtimeout, "osdtimeout=%d"}, + {Opt_mount_attempts, "mount_attempts=%d"}, /* int args above */ {Opt_ip, "ip=%s"}, {Opt_debug_console, "debug_console"}, @@ -428,6 +430,7 @@ static int parse_mount_args(int flags, char *options, const char *dev_name, args->sb_flags = flags; args->flags = CEPH_MOUNT_DEFAULT; args->osd_timeout = 5; /* seconds */ + args->mount_attempts = 2; /* 2 attempts */ /* ip1[,ip2...]:/server/path */ c = strchr(dev_name, ':'); @@ -532,6 +535,9 @@ static int parse_mount_args(int flags, char *options, const char *dev_name, case Opt_osdtimeout: args->osd_timeout = intval; break; + case Opt_mount_attempts: + args->mount_attempts = intval; + break; case Opt_unsafewrites: args->flags |= CEPH_MOUNT_UNSAFE_WRITES; break; @@ -692,7 +698,7 @@ int ceph_mount(struct ceph_client *client, struct vfsmount *mnt) struct ceph_msg *mount_msg; struct dentry *root; int err; - int attempts = 2;//10; + int attempts = client->mount_args.mount_attempts; int which; char r; diff --git a/src/kernel/super.h b/src/kernel/super.h index 6cff52b61c9..698bdccd751 100644 --- a/src/kernel/super.h +++ b/src/kernel/super.h @@ -84,6 +84,7 @@ static inline unsigned long time_sub(unsigned long a, unsigned long b) struct ceph_mount_args { int sb_flags; int flags; + int mount_attempts; struct ceph_fsid fsid; struct ceph_entity_addr my_addr; int num_mon;