source:
branches/fc15-dev/server/common/patches/openafs-0005-linux-2.6.38-New-d_op-handling.patch
@
1893
Last change on this file since 1893 was 1835, checked in by achernya, 13 years ago | |
---|---|
File size: 3.8 KB |
-
acinclude.m4
From a615bc198e3fd99378d248eeb5868c773b0a2ec5 Mon Sep 17 00:00:00 2001 From: Marc Dionne <marc.c.dionne@gmail.com> Date: Tue, 25 Jan 2011 17:17:21 -0500 Subject: [PATCH 5/8] linux: 2.6.38: New d_op handling 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: Ia808d6bcd119f3999a1805b1d31678f5a3ba3d55 Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reviewed-on: http://gerrit.openafs.org/3994 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com> Reviewed-by: Russ Allbery <rra@stanford.edu> Reviewed-on: http://gerrit.openafs.org/4041 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org> --- acinclude.m4 | 1 + src/afs/LINUX/osi_vfsops.c | 8 ++++++++ src/afs/LINUX/osi_vnodeops.c | 6 ++++++ 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index de82283..7904e20 100644
a b case $AFS_SYSNAME in *_linux* | *_umlinux*) 749 749 LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE 750 750 LINUX_FS_STRUCT_SUPER_HAS_EVICT_INODE 751 751 LINUX_FS_STRUCT_SUPER_BLOCK_HAS_S_BDI 752 AC_CHECK_LINUX_STRUCT([super_block], [s_d_op], [fs.h]) 752 753 LINUX_STRUCT_BDI_HAS_NAME 753 754 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK 754 755 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK -
src/afs/LINUX/osi_vfsops.c
diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c index fb69d39..2a937e4 100644
a b afs_read_super(struct super_block *sb, void *data, int silent) 140 140 sb->s_blocksize_bits = 10; 141 141 sb->s_magic = AFS_VFSMAGIC; 142 142 sb->s_op = &afs_sops; /* Super block (vfs) ops */ 143 144 #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) 145 sb->s_d_op = &afs_dentry_operations; 146 #endif 147 148 #if defined(AFS_LINUX26_ENV) 143 149 /* used for inodes backing_dev_info field, also */ 144 150 afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info)); 145 151 #if defined(HAVE_BDI_INIT) … … afs_root(struct super_block *afsp) 227 233 #else 228 234 afsp->s_root = d_alloc_root(ip, NULL); 229 235 #endif 236 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) 230 237 afsp->s_root->d_op = &afs_dentry_operations; 238 #endif 231 239 } else 232 240 code = ENOENT; 233 241 } -
src/afs/LINUX/osi_vnodeops.c
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 8352769..03294b2 100644
a b afs_linux_create(struct inode *dip, struct dentry *dp, int mode) 1067 1067 afs_getattr(vcp, &vattr, credp); 1068 1068 afs_fill_inode(ip, &vattr); 1069 1069 insert_inode_hash(ip); 1070 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) 1070 1071 dp->d_op = &afs_dentry_operations; 1072 #endif 1071 1073 dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion); 1072 1074 d_instantiate(dp, ip); 1073 1075 } … … afs_linux_lookup(struct inode *dip, struct dentry *dp) 1123 1125 ) 1124 1126 insert_inode_hash(ip); 1125 1127 } 1128 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) 1126 1129 dp->d_op = &afs_dentry_operations; 1130 #endif 1127 1131 dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion); 1128 1132 AFS_GUNLOCK(); 1129 1133 … … afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode) 1315 1319 afs_getattr(tvcp, &vattr, credp); 1316 1320 afs_fill_inode(ip, &vattr); 1317 1321 1322 #if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP) 1318 1323 dp->d_op = &afs_dentry_operations; 1324 #endif 1319 1325 dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion); 1320 1326 d_instantiate(dp, ip); 1321 1327 }
Note: See TracBrowser
for help on using the repository browser.