]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: add mount_attempts mount option
authorSage Weil <sage@newdream.net>
Fri, 6 Jun 2008 17:14:03 +0000 (10:14 -0700)
committerSage Weil <sage@newdream.net>
Fri, 6 Jun 2008 17:14:03 +0000 (10:14 -0700)
src/kernel/osd_client.c
src/kernel/super.c
src/kernel/super.h

index b6175bb5ab89e30577de0ef7604cd430f50c5707..9af6f9fcab06a1af44b47417920171af338b3b44 100644 (file)
@@ -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));
 }
 
 
index 17646b0945e9e45aa8783c47a90a30169da0d05a..be3954651fc21f90dfda9e7a6de066de946060ff 100644 (file)
@@ -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;
 
index 6cff52b61c989b9d84374c203847fc9597116779..698bdccd751b6c524004cdf6d8ba6ed8ed4cb3db 100644 (file)
@@ -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;