source: branches/fc15-dev/server/common/patches/openafs-0005-linux-2.6.38-New-d_op-handling.patch @ 1881

Last change on this file since 1881 was 1835, checked in by achernya, 13 years ago
OpenAFS builds on F15 Get OpenAFS to build on F15, using the cherry-picked patches.
File size: 3.8 KB
RevLine 
[1835]1From a615bc198e3fd99378d248eeb5868c773b0a2ec5 Mon Sep 17 00:00:00 2001
2From: Marc Dionne <marc.c.dionne@gmail.com>
3Date: Tue, 25 Jan 2011 17:17:21 -0500
4Subject: [PATCH 5/8] linux: 2.6.38: New d_op handling
5
6In 2.6.38, the super block structure has a new field to hold the
7default dentry ops.  The vfs will automatically set it for new
8dentries in most cases.
9
10Set s_d_op to our set of operations, and omit setting the dentry
11ops where the vfs will already do it (and where new locking rules
12prohibit it).
13
14Reviewed-on: http://gerrit.openafs.org/3758
15Tested-by: BuildBot <buildbot@rampaginggeek.com>
16Reviewed-by: Derrick Brashear <shadow@dementia.org>
17(cherry picked from commit 08bb83d95027bb3ac68834d12b72bdc647fa24a9)
18
19Change-Id: Ia808d6bcd119f3999a1805b1d31678f5a3ba3d55
20Signed-off-by: Anders Kaseorg <andersk@mit.edu>
21Reviewed-on: http://gerrit.openafs.org/3994
22Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
23Tested-by: BuildBot <buildbot@rampaginggeek.com>
24Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
25Reviewed-by: Russ Allbery <rra@stanford.edu>
26Reviewed-on: http://gerrit.openafs.org/4041
27Reviewed-by: Derrick Brashear <shadow@dementia.org>
28Tested-by: Derrick Brashear <shadow@dementia.org>
29---
30 acinclude.m4                 |    1 +
31 src/afs/LINUX/osi_vfsops.c   |    8 ++++++++
32 src/afs/LINUX/osi_vnodeops.c |    6 ++++++
33 3 files changed, 15 insertions(+), 0 deletions(-)
34
35diff --git a/acinclude.m4 b/acinclude.m4
36index de82283..7904e20 100644
37--- a/acinclude.m4
38+++ b/acinclude.m4
39@@ -749,6 +749,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
40                 LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE
41                 LINUX_FS_STRUCT_SUPER_HAS_EVICT_INODE
42                 LINUX_FS_STRUCT_SUPER_BLOCK_HAS_S_BDI
43+                AC_CHECK_LINUX_STRUCT([super_block], [s_d_op], [fs.h])
44                 LINUX_STRUCT_BDI_HAS_NAME
45                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
46                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
47diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
48index fb69d39..2a937e4 100644
49--- a/src/afs/LINUX/osi_vfsops.c
50+++ b/src/afs/LINUX/osi_vfsops.c
51@@ -140,6 +140,12 @@ afs_read_super(struct super_block *sb, void *data, int silent)
52     sb->s_blocksize_bits = 10;
53     sb->s_magic = AFS_VFSMAGIC;
54     sb->s_op = &afs_sops;      /* Super block (vfs) ops */
55+
56+#if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
57+    sb->s_d_op = &afs_dentry_operations;
58+#endif
59+
60+#if defined(AFS_LINUX26_ENV)
61     /* used for inodes backing_dev_info field, also */
62     afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info));
63 #if defined(HAVE_BDI_INIT)
64@@ -227,7 +233,9 @@ afs_root(struct super_block *afsp)
65 #else
66                afsp->s_root = d_alloc_root(ip, NULL);
67 #endif
68+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
69                afsp->s_root->d_op = &afs_dentry_operations;
70+#endif
71            } else
72                code = ENOENT;
73        }
74diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
75index 8352769..03294b2 100644
76--- a/src/afs/LINUX/osi_vnodeops.c
77+++ b/src/afs/LINUX/osi_vnodeops.c
78@@ -1067,7 +1067,9 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode)
79        afs_getattr(vcp, &vattr, credp);
80        afs_fill_inode(ip, &vattr);
81        insert_inode_hash(ip);
82+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
83        dp->d_op = &afs_dentry_operations;
84+#endif
85        dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
86        d_instantiate(dp, ip);
87     }
88@@ -1123,7 +1125,9 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
89            )
90            insert_inode_hash(ip);
91     }
92+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
93     dp->d_op = &afs_dentry_operations;
94+#endif
95     dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
96     AFS_GUNLOCK();
97 
98@@ -1315,7 +1319,9 @@ afs_linux_mkdir(struct inode *dip, struct dentry *dp, int mode)
99        afs_getattr(tvcp, &vattr, credp);
100        afs_fill_inode(ip, &vattr);
101 
102+#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
103        dp->d_op = &afs_dentry_operations;
104+#endif
105        dp->d_time = hgetlo(VTOAFS(dip)->m.DataVersion);
106        d_instantiate(dp, ip);
107     }
108--
1091.7.3.4
110
Note: See TracBrowser for help on using the repository browser.