]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
linux: 2.6.38: New d_op handling
authorMarc Dionne <marc.c.dionne@gmail.com>
Tue, 25 Jan 2011 22:17:21 +0000 (17:17 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 8 Feb 2011 14:55:10 +0000 (06:55 -0800)
In 2.6.38, the super block structure has a new field to hold the
default dentry ops.  The vfs will automatically set it for new
dentries in most cases.

Set s_d_op to our set of operations, and omit setting the dentry
ops where the vfs will already do it (and where new locking rules
prohibit it).

Reviewed-on: http://gerrit.openafs.org/3758
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit 08bb83d95027bb3ac68834d12b72bdc647fa24a9)

Change-Id: Ia108e8c7c624521965bdbddd7a37ebf281eb7967
Reviewed-on: http://gerrit.openafs.org/3869
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
acinclude.m4
src/afs/LINUX/osi_vfsops.c
src/afs/LINUX/osi_vnodeops.c

index b52627036f203969cf36582083e78c22df20c991..b51ba9ca97a7d94eacd44d5d37e676629e240105 100644 (file)
@@ -774,6 +774,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h])
                 AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h])
                 AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])
+                AC_CHECK_LINUX_STRUCT([super_block], [s_d_op], [fs.h])
                 AC_CHECK_LINUX_STRUCT([super_operations], [alloc_inode],
                                       [fs.h])
                 AC_CHECK_LINUX_STRUCT([super_operations], [evict_inode],
index 22146d7502613c6b810d32d51e691e052440c731..921efac78d6031cf7e95303140e0862e4c4d2a21 100644 (file)
@@ -108,6 +108,11 @@ afs_fill_super(struct super_block *sb, void *data, int silent)
     sb->s_blocksize_bits = 10;
     sb->s_magic = AFS_VFSMAGIC;
     sb->s_op = &afs_sops;      /* Super block (vfs) ops */
+
+#if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
+    sb->s_d_op = &afs_dentry_operations;
+#endif
+
     /* used for inodes backing_dev_info field, also */
     afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info));
 #if defined(HAVE_LINUX_BDI_INIT)
@@ -182,7 +187,9 @@ afs_root(struct super_block *afsp)
                /* setup super_block and mount point inode. */
                afs_globalVp = tvp;
                afsp->s_root = d_alloc_root(ip);
+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
                afsp->s_root->d_op = &afs_dentry_operations;
+#endif
            } else
                code = ENOENT;
        }
index d4b8b8ff9af6ecd4db506215246f576f458fa090..02aadd48ff7b483f3214f5d3cca7b1ab93b7c832 100644 (file)
@@ -1015,7 +1015,9 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
        afs_getattr(vcp, &vattr, credp);
        afs_fill_inode(ip, &vattr);
        insert_inode_hash(ip);
+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
        dp->d_op = &afs_dentry_operations;
+#endif
        dp->d_time = hgetlo(VTOAFS(dip)->f.m.DataVersion);
        d_instantiate(dp, ip);
     }
@@ -1053,7 +1055,9 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
        if (hlist_unhashed(&ip->i_hash))
            insert_inode_hash(ip);
     }
+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
     dp->d_op = &afs_dentry_operations;
+#endif
     dp->d_time = hgetlo(VTOAFS(dip)->f.m.DataVersion);
     AFS_GUNLOCK();
 
@@ -1237,7 +1241,9 @@ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
        afs_getattr(tvcp, &vattr, credp);
        afs_fill_inode(ip, &vattr);
 
+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
        dp->d_op = &afs_dentry_operations;
+#endif
        dp->d_time = hgetlo(VTOAFS(dip)->f.m.DataVersion);
        d_instantiate(dp, ip);
     }