]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
fixed inode cap init bug
authorSage Weil <sage@newdream.net>
Fri, 18 Jan 2008 20:29:13 +0000 (12:29 -0800)
committerSage Weil <sage@newdream.net>
Fri, 18 Jan 2008 20:29:13 +0000 (12:29 -0800)
src/kernel/inode.c
src/kernel/super.c

index 5ff9c9f4326ebdf98d1df9115a0898e7d3add01e..03110bff27bca6e90bc7d42fa37cbc3a4fc6f86e 100644 (file)
@@ -73,15 +73,6 @@ int ceph_fill_inode(struct inode *inode, struct ceph_mds_reply_inode *info)
        ci->i_frag_map[0].frag = 0;
        ci->i_frag_map[0].mds = 0; // FIXME
        
-       ci->i_nr_caps = 0;
-       for (i=0; i<4; i++)
-               ci->i_nr_by_mode[i] = 0;
-       ci->i_cap_wanted = 0;
-       
-       ci->i_wr_size = 0;
-       ci->i_wr_mtime.tv_sec = 0;
-       ci->i_wr_mtime.tv_nsec = 0;
-
        ci->i_old_atime = inode->i_atime;
 
        inode->i_mapping->a_ops = &ceph_aops;
index 20e6b5bdc97696303bb734eb4b5469e57f75826c..93ea04c3b49c88f0f7b67ff8c24b61802067bf94 100644 (file)
@@ -93,6 +93,8 @@ static struct kmem_cache *ceph_inode_cachep;
 static struct inode *ceph_alloc_inode(struct super_block *sb)
 {
        struct ceph_inode_info *ci;
+       int i;
+
        ci = kmem_cache_alloc(ceph_inode_cachep, GFP_KERNEL);
        if (!ci)
                return NULL;
@@ -112,6 +114,14 @@ static struct inode *ceph_alloc_inode(struct super_block *sb)
        ci->i_caps = ci->i_caps_static;
        atomic_set(&ci->i_cap_count, 0);
 
+       for (i=0; i<4; i++)
+               ci->i_nr_by_mode[i] = 0;
+       ci->i_cap_wanted = 0;
+       
+       ci->i_wr_size = 0;
+       ci->i_wr_mtime.tv_sec = 0;
+       ci->i_wr_mtime.tv_nsec = 0;
+       
        return &ci->vfs_inode;
 }