]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kclient: remove static caps from inode
authorSage Weil <sage@newdream.net>
Tue, 14 Oct 2008 23:18:24 +0000 (16:18 -0700)
committerSage Weil <sage@newdream.net>
Tue, 14 Oct 2008 23:18:24 +0000 (16:18 -0700)
Since most inodes will never have a capability, there is no point in embedding them
in the ceph_inode_info and paying the memory overhead in the general case.

src/TODO
src/kernel/caps.c
src/kernel/super.c
src/kernel/super.h

index 45ff54fab180abf1c2f07c91efbb26f32c0708f4..99d53edd7bb264c548810e0e05d2213dc99603d9 100644 (file)
--- a/src/TODO
+++ b/src/TODO
@@ -1,6 +1,3 @@
-kclient
-- rip out STATIC_CAPS
-
 v0.5
 - debug restart, cosd reformat, etc.
 - finish btrfs ioctl interface
index 1f61255fe1627ddf454975a102e8d3368f8613c1..8069a387531ce2de38ae451a9d9af445b6208302 100644 (file)
@@ -114,11 +114,6 @@ retry:
        spin_lock(&inode->i_lock);
        cap = __get_cap_for_mds(inode, mds);
        if (!cap) {
-               for (i = 0; i < STATIC_CAPS; i++)
-                       if (ci->i_static_caps[i].mds == -1) {
-                               cap = &ci->i_static_caps[i];
-                               break;
-                       }
                if (!cap) {
                        if (new_cap) {
                                cap = new_cap;
@@ -223,11 +218,8 @@ int __ceph_remove_cap(struct ceph_cap *cap)
        /* remove from inode list */
        rb_erase(&cap->ci_node, &ci->i_caps);
        cap->session = 0;
-       cap->mds = -1;  /* mark unused */
 
-       if (cap < ci->i_static_caps ||
-           cap >= ci->i_static_caps + STATIC_CAPS)
-               kfree(cap);
+       kfree(cap);
 
        if (RB_EMPTY_ROOT(&ci->i_caps)) {
                list_del_init(&ci->i_snap_realm_item);
index 0eff5213e15efa7aaa2c2cccb451861b74c7d0db..5dd4e581cf2da6489f3aa14508bd73310cd21b92 100644 (file)
@@ -183,8 +183,6 @@ static struct inode *ceph_alloc_inode(struct super_block *sb)
        ci->i_xattr_data = 0;
 
        ci->i_caps = RB_ROOT;
-       for (i = 0; i < STATIC_CAPS; i++)
-               ci->i_static_caps[i].mds = -1;
        for (i = 0; i < CEPH_FILE_MODE_NUM; i++)
                ci->i_nr_by_mode[i] = 0;
        init_waitqueue_head(&ci->i_cap_wq);
index 75efa1299eb6e56e0adf66862f30a7a042491858..46bd419c86658824d501cb3cb6a9eb7c3e9294a3 100644 (file)
@@ -175,14 +175,12 @@ static inline struct ceph_client *ceph_client(struct super_block *sb)
  * Each cap is referenced by the inode's i_caps tree and by a per-mds
  * session capability list.
  */
-#define STATIC_CAPS 1   /* how many to embed in each inode? */
-
 struct ceph_cap {
        struct ceph_inode_info *ci;
        struct rb_node ci_node;         /* per-ci cap tree */
        struct ceph_mds_session *session;
        struct list_head session_caps;  /* per-session caplist */
-       int mds;          /* must be -1 if not in use */
+       int mds;
        int issued;       /* latest, from the mds */
        int implemented;  /* what we've implemented (for tracking revocation) */
        u32 seq, mseq, gen;
@@ -262,7 +260,6 @@ struct ceph_inode_info {
 
        /* capabilities */
        struct rb_root i_caps;           /* cap list */
-       struct ceph_cap i_static_caps[STATIC_CAPS];
        wait_queue_head_t i_cap_wq;      /* threads waiting on a capability */
        unsigned long i_hold_caps_until; /* jiffies */
        struct list_head i_cap_delay_list;  /* for delayed cap release to mds */