]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/ceph/super.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[mv-sheeva.git] / fs / ceph / super.c
index cd81c84e96fc36531e46978aea1086c30272ae06..75d02eaa1279f7abf42505e6318dce6adb753f04 100644 (file)
@@ -11,6 +11,7 @@
 #include <linux/rwsem.h>
 #include <linux/sched.h>
 #include <linux/seq_file.h>
+#include <linux/slab.h>
 #include <linux/statfs.h>
 #include <linux/string.h>
 #include <linux/version.h>
@@ -292,7 +293,9 @@ enum {
        Opt_wsize,
        Opt_rsize,
        Opt_osdtimeout,
+       Opt_osdkeepalivetimeout,
        Opt_mount_timeout,
+       Opt_osd_idle_ttl,
        Opt_caps_wanted_delay_min,
        Opt_caps_wanted_delay_max,
        Opt_readdir_max_entries,
@@ -321,7 +324,9 @@ static match_table_t arg_tokens = {
        {Opt_wsize, "wsize=%d"},
        {Opt_rsize, "rsize=%d"},
        {Opt_osdtimeout, "osdtimeout=%d"},
+       {Opt_osdkeepalivetimeout, "osdkeepalive=%d"},
        {Opt_mount_timeout, "mount_timeout=%d"},
+       {Opt_osd_idle_ttl, "osd_idle_ttl=%d"},
        {Opt_caps_wanted_delay_min, "caps_wanted_delay_min=%d"},
        {Opt_caps_wanted_delay_max, "caps_wanted_delay_max=%d"},
        {Opt_readdir_max_entries, "readdir_max_entries=%d"},
@@ -365,8 +370,10 @@ static struct ceph_mount_args *parse_mount_args(int flags, char *options,
        /* start with defaults */
        args->sb_flags = flags;
        args->flags = CEPH_OPT_DEFAULT;
-       args->osd_timeout = 5;    /* seconds */
+       args->osd_timeout = CEPH_OSD_TIMEOUT_DEFAULT;
+       args->osd_keepalive_timeout = CEPH_OSD_KEEPALIVE_DEFAULT;
        args->mount_timeout = CEPH_MOUNT_TIMEOUT_DEFAULT; /* seconds */
+       args->osd_idle_ttl = CEPH_OSD_IDLE_TTL_DEFAULT;   /* seconds */
        args->caps_wanted_delay_min = CEPH_CAPS_WANTED_DELAY_MIN_DEFAULT;
        args->caps_wanted_delay_max = CEPH_CAPS_WANTED_DELAY_MAX_DEFAULT;
        args->rsize = CEPH_MOUNT_RSIZE_DEFAULT;
@@ -465,6 +472,9 @@ static struct ceph_mount_args *parse_mount_args(int flags, char *options,
                case Opt_osdtimeout:
                        args->osd_timeout = intval;
                        break;
+               case Opt_osdkeepalivetimeout:
+                       args->osd_keepalive_timeout = intval;
+                       break;
                case Opt_mount_timeout:
                        args->mount_timeout = intval;
                        break;
@@ -542,7 +552,7 @@ static struct ceph_client *ceph_create_client(struct ceph_mount_args *args)
 
        mutex_init(&client->mount_mutex);
 
-       init_waitqueue_head(&client->mount_wq);
+       init_waitqueue_head(&client->auth_wq);
 
        client->sb = NULL;
        client->mount_state = CEPH_MOUNT_MOUNTING;
@@ -550,7 +560,7 @@ static struct ceph_client *ceph_create_client(struct ceph_mount_args *args)
 
        client->msgr = NULL;
 
-       client->mount_err = 0;
+       client->auth_err = 0;
        atomic_long_set(&client->writeback_count, 0);
 
        err = bdi_init(&client->backing_dev_info);
@@ -575,6 +585,9 @@ static struct ceph_client *ceph_create_client(struct ceph_mount_args *args)
        if (!client->wb_pagevec_pool)
                goto fail_trunc_wq;
 
+       /* caps */
+       client->min_caps = args->max_readdir;
+       ceph_adjust_min_caps(client->min_caps);
 
        /* subsystems */
        err = ceph_monc_init(&client->monc, client);
@@ -616,6 +629,8 @@ static void ceph_destroy_client(struct ceph_client *client)
        ceph_monc_stop(&client->monc);
        ceph_osdc_stop(&client->osdc);
 
+       ceph_adjust_min_caps(-client->min_caps);
+
        ceph_debugfs_client_cleanup(client);
        destroy_workqueue(client->wb_wq);
        destroy_workqueue(client->pg_inv_wq);
@@ -742,13 +757,13 @@ static int ceph_mount(struct ceph_client *client, struct vfsmount *mnt,
 
                /* wait */
                dout("mount waiting for mon_map\n");
-               err = wait_event_interruptible_timeout(client->mount_wq, /* FIXME */
-                              have_mon_map(client) || (client->mount_err < 0),
+               err = wait_event_interruptible_timeout(client->auth_wq,
+                              have_mon_map(client) || (client->auth_err < 0),
                               timeout);
                if (err == -EINTR || err == -ERESTARTSYS)
                        goto out;
-               if (client->mount_err < 0) {
-                       err = client->mount_err;
+               if (client->auth_err < 0) {
+                       err = client->auth_err;
                        goto out;
                }
        }