]> Pileus Git - ~andy/linux/blobdiff - fs/ceph/super.c
ceph: do caps accounting per mds_client
[~andy/linux] / fs / ceph / super.c
index 7c663d9b9f818a18d93c731422a8168ff5f1f77b..1a0bb4863a5d9feff183006b9b467d4908223595 100644 (file)
@@ -89,7 +89,7 @@ static int ceph_statfs(struct dentry *dentry, struct kstatfs *buf)
 
        buf->f_files = le64_to_cpu(st.num_objects);
        buf->f_ffree = -1;
-       buf->f_namelen = PATH_MAX;
+       buf->f_namelen = NAME_MAX;
        buf->f_frsize = PAGE_CACHE_SIZE;
 
        /* leave fsid little-endian, regardless of host endianness */
@@ -630,7 +630,6 @@ static struct ceph_client *ceph_create_client(struct ceph_mount_args *args)
 
        /* caps */
        client->min_caps = args->max_readdir;
-       ceph_adjust_min_caps(client->min_caps);
 
        /* subsystems */
        err = ceph_monc_init(&client->monc, client);
@@ -669,10 +668,16 @@ static void ceph_destroy_client(struct ceph_client *client)
 
        /* unmount */
        ceph_mdsc_stop(&client->mdsc);
-       ceph_monc_stop(&client->monc);
        ceph_osdc_stop(&client->osdc);
 
-       ceph_adjust_min_caps(-client->min_caps);
+       /*
+        * make sure mds and osd connections close out before destroying
+        * the auth module, which is needed to free those connections'
+        * ceph_authorizers.
+        */
+       ceph_msgr_flush();
+
+       ceph_monc_stop(&client->monc);
 
        ceph_debugfs_client_cleanup(client);
        destroy_workqueue(client->wb_wq);
@@ -738,7 +743,7 @@ static struct dentry *open_root_dentry(struct ceph_client *client,
        dout("open_root_inode opening '%s'\n", path);
        req = ceph_mdsc_create_request(mdsc, CEPH_MDS_OP_GETATTR, USE_ANY_MDS);
        if (IS_ERR(req))
-               return ERR_PTR(PTR_ERR(req));
+               return ERR_CAST(req);
        req->r_path1 = kstrdup(path, GFP_NOFS);
        req->r_ino1.ino = CEPH_INO_ROOT;
        req->r_ino1.snap = CEPH_NOSNAP;
@@ -918,7 +923,7 @@ static int ceph_compare_super(struct super_block *sb, void *data)
 /*
  * construct our own bdi so we can control readahead, etc.
  */
-static atomic_long_t bdi_seq = ATOMIC_INIT(0);
+static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0);
 
 static int ceph_register_bdi(struct super_block *sb, struct ceph_client *client)
 {
@@ -1035,8 +1040,6 @@ static int __init init_ceph(void)
        if (ret)
                goto out_msgr;
 
-       ceph_caps_init();
-
        ret = register_filesystem(&ceph_fs_type);
        if (ret)
                goto out_icache;
@@ -1061,7 +1064,6 @@ static void __exit exit_ceph(void)
 {
        dout("exit_ceph\n");
        unregister_filesystem(&ceph_fs_type);
-       ceph_caps_finalize();
        destroy_caches();
        ceph_msgr_exit();
        ceph_debugfs_cleanup();