Index: branches/fc15-dev/server/common/patches/openafs-0001-Linux-Add-autoconf-macro-for-structure-checks.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0001-Linux-Add-autoconf-macro-for-structure-checks.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0001-Linux-Add-autoconf-macro-for-structure-checks.patch	(revision 1835)
@@ -0,0 +1,52 @@
+From 71ec6d24f675082d09926f87db2bfad639d6df74 Mon Sep 17 00:00:00 2001
+From: Simon Wilkinson <sxw@inf.ed.ac.uk>
+Date: Tue, 27 Apr 2010 13:02:20 +0100
+Subject: [PATCH 1/8] Linux: Add autoconf macro for structure checks
+
+Add a new autoconf macro for doing structure element checks.
+
+Reviewed-on: http://gerrit.openafs.org/1853
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit 02f2c7cb3734d44dc90b77d631909373daefacd3)
+
+Change-Id: Id7768128e058805baf8d44f2610f3345b25ac973
+[andersk@mit.edu: Remove modifications of existing structure checks]
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3992
+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/4037
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ src/cf/linux-test1.m4 |   14 ++++++++++++++
+ 1 files changed, 14 insertions(+), 0 deletions(-)
+
+diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4
+index 0b40eb7..2da3bb8 100644
+--- a/src/cf/linux-test1.m4
++++ b/src/cf/linux-test1.m4
+@@ -84,3 +84,17 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [
+     ac_linux_kbuild_requires_extra_cflags=yes)
+     CPPFLAGS="$save_CPPFLAGS"
+     AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)])
++
++dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes])
++AC_DEFUN([AC_CHECK_LINUX_STRUCT],
++ [AS_VAR_PUSHDEF([ac_linux_struct], [ac_cv_linux_struct_$1_has_$2])dnl
++  AC_CACHE_CHECK([for $2 in struct $1], [ac_linux_struct],
++   [AC_TRY_KBUILD([#include <linux/$3>],
++		  [struct $1 _test; printk("%x\n", &_test.$2); ],
++		  AS_VAR_SET([ac_linux_struct], [yes]),
++		  AS_VAR_SET([ac_linux_struct], [no]))
++   ])
++  AS_IF([test AS_VAR_GET([ac_linux_struct]) = yes],
++	[AC_DEFINE(AS_TR_CPP(STRUCT_$1_HAS_$2), 1,
++		   [Define if kernel struct $1 has the $2 element])])
++ ])
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0002-Linux-Add-general-autoconf-macro-for-Linux-kernel.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0002-Linux-Add-general-autoconf-macro-for-Linux-kernel.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0002-Linux-Add-general-autoconf-macro-for-Linux-kernel.patch	(revision 1835)
@@ -0,0 +1,100 @@
+From 0b40abe79e44c98adbbd5adb80ac2f10e6d1316a Mon Sep 17 00:00:00 2001
+From: Simon Wilkinson <sxw@inf.ed.ac.uk>
+Date: Tue, 27 Apr 2010 17:41:22 +0100
+Subject: [PATCH 2/8] Linux: Add general autoconf macro for Linux kernel
+
+Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
+takes a "checking" message, the autoconf variable to use to cache
+the results, headers and code to run, preprocessor variable to
+define, and a description of that variable.
+
+Reviewed-on: http://gerrit.openafs.org/1854
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit a89d6b029d059d01b8bbfc18b9ee6e3f5a964b85)
+
+Change-Id: I75c5efbf69b54e0f0b1aedcb157992e13c6a8aa7
+[andersk@mit.edu: Remove reimplementation of existing check macros]
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3993
+Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Russ Allbery <rra@stanford.edu>
+Reviewed-on: http://gerrit.openafs.org/4038
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ src/cf/linux-test1.m4 |   28 ++++++++++++++++++----------
+ src/cf/linux-test4.m4 |   11 +++++------
+ 2 files changed, 23 insertions(+), 16 deletions(-)
+
+diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4
+index 2da3bb8..3115cdb 100644
+--- a/src/cf/linux-test1.m4
++++ b/src/cf/linux-test1.m4
+@@ -85,16 +85,24 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [
+     CPPFLAGS="$save_CPPFLAGS"
+     AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)])
+ 
++dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define])
++AC_DEFUN([AC_CHECK_LINUX_BUILD],
++ [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl
++  AC_CACHE_CHECK([$1], [ac_linux_build],
++   [AC_TRY_KBUILD([$3], [$4],
++		  AS_VAR_SET([ac_linux_build], [yes]),
++		  AS_VAR_SET([ac_linux_build], [no]))
++   ])
++  AS_IF([test AS_VAR_GET([ac_linux_build]) = yes],
++        [AC_DEFINE([$5],1,[$6])])
++ ])
++
+ dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes])
+ AC_DEFUN([AC_CHECK_LINUX_STRUCT],
+- [AS_VAR_PUSHDEF([ac_linux_struct], [ac_cv_linux_struct_$1_has_$2])dnl
+-  AC_CACHE_CHECK([for $2 in struct $1], [ac_linux_struct],
+-   [AC_TRY_KBUILD([#include <linux/$3>],
+-		  [struct $1 _test; printk("%x\n", &_test.$2); ],
+-		  AS_VAR_SET([ac_linux_struct], [yes]),
+-		  AS_VAR_SET([ac_linux_struct], [no]))
+-   ])
+-  AS_IF([test AS_VAR_GET([ac_linux_struct]) = yes],
+-	[AC_DEFINE(AS_TR_CPP(STRUCT_$1_HAS_$2), 1,
+-		   [Define if kernel struct $1 has the $2 element])])
++ [AC_CHECK_LINUX_BUILD([for $2 in struct $1],
++		       [ac_cv_linux_struct_$1_has_$2],
++		       [#include <linux/$3>],
++		       [struct $1 _test; printk("%x\n", &_test.$2); ],
++		       AS_TR_CPP(STRUCT_$1_HAS_$2),
++		       [Define if kernel struct $1 has the $2 element])
+  ])
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 89fccf5..3f22f7a 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -675,18 +675,17 @@ struct nameidata _nameidata;
+ 
+ 
+ AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
+-  AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
+-  AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
+-    AC_TRY_KBUILD(
++  AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes a nameidata],
++		       [ac_cv_linux_func_i_permission_takes_nameidata],
+ [#include <linux/fs.h>
+ #include <linux/namei.h>],
+ [struct inode _inode;
+ struct dentry _dentry;
+ struct nameidata _nameidata;
+ (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+-      ac_cv_linux_func_i_permission_takes_nameidata=yes,
+-      ac_cv_linux_func_i_permission_takes_nameidata=no)])
+-  AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
++		       [IOP_PERMISSION_TAKES_NAMEIDATA],
++		       [define if your iops.permission takes a nameidata argument])
++])
+ 
+ 
+ AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0003-Linux-allow-compile-flags-to-be-passed-to-AC_CHECK_L.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0003-Linux-allow-compile-flags-to-be-passed-to-AC_CHECK_L.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0003-Linux-allow-compile-flags-to-be-passed-to-AC_CHECK_L.patch	(revision 1835)
@@ -0,0 +1,68 @@
+From 644c2853a171a3853bdb2d084287ff2e02dbca4f Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Fri, 28 Jan 2011 19:03:39 -0500
+Subject: [PATCH 3/8] Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD
+
+Some linux autoconf tests require particular compile flags such as
+-Werror.  Add a parameter to the AC_CHECK_LINUX_BUILD macro that
+lets the caller pass in any needed special flags.
+
+Reviewed-on: http://gerrit.openafs.org/3769
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit ca38c9546e323b59189670b80740510fb9ec5269)
+
+Change-Id: If4daa7b1202e30046d22bda5eca6b191130945ea
+[andersk@mit.edu: Remove modifications of existing tests]
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3996
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Russ Allbery <rra@stanford.edu>
+Reviewed-on: http://gerrit.openafs.org/4039
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ src/cf/linux-test1.m4 |    7 +++++--
+ src/cf/linux-test4.m4 |    3 ++-
+ 2 files changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4
+index 3115cdb..97a520f 100644
+--- a/src/cf/linux-test1.m4
++++ b/src/cf/linux-test1.m4
+@@ -85,13 +85,16 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [
+     CPPFLAGS="$save_CPPFLAGS"
+     AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)])
+ 
+-dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define])
++dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define], [CFLAGS])
+ AC_DEFUN([AC_CHECK_LINUX_BUILD],
+  [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl
+   AC_CACHE_CHECK([$1], [ac_linux_build],
+-   [AC_TRY_KBUILD([$3], [$4],
++   [save_CPPFLAGS="$CPPFLAGS"
++     CPPFLAGS="$CPPFLAGS $7"
++     AC_TRY_KBUILD([$3], [$4],
+ 		  AS_VAR_SET([ac_linux_build], [yes]),
+ 		  AS_VAR_SET([ac_linux_build], [no]))
++     CPPFLAGS="$save_CPPFLAGS"
+    ])
+   AS_IF([test AS_VAR_GET([ac_linux_build]) = yes],
+         [AC_DEFINE([$5],1,[$6])])
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 3f22f7a..67ddf91 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -684,7 +684,8 @@ struct dentry _dentry;
+ struct nameidata _nameidata;
+ (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ 		       [IOP_PERMISSION_TAKES_NAMEIDATA],
+-		       [define if your iops.permission takes a nameidata argument])
++		       [define if your iops.permission takes a nameidata argument],
++		       [])
+ ])
+ 
+ 
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0004-Linux-2.6.38-Adjust-for-permission-inode-operation-c.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0004-Linux-2.6.38-Adjust-for-permission-inode-operation-c.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0004-Linux-2.6.38-Adjust-for-permission-inode-operation-c.patch	(revision 1835)
@@ -0,0 +1,111 @@
+From 29ef9bb31f31c371272ee9b2860729af2277ab95 Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Fri, 28 Jan 2011 19:41:32 -0500
+Subject: [PATCH 4/8] Linux: 2.6.38: Adjust for permission inode operation changes
+
+The permission i_op has a new signature with a flags argument, and
+must now deal with RCU path walking.
+- Fix existing configure test for this i_op, it succeeds when it
+shouldn't
+- Add a new configure test for the new signature
+- Make our permission i_op "RCU-walk aware" - return ECHILD if
+called in that mode
+
+Reviewed-on: http://gerrit.openafs.org/3770
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit 5bcc0ea735ea519298c98b46c66bf1326cdee5e4)
+
+Change-Id: I38db16f0f62500f46fad9c92d045ccfa6cfe1c38
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3997
+Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Russ Allbery <rra@stanford.edu>
+Reviewed-on: http://gerrit.openafs.org/4040
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ acinclude.m4                 |    1 +
+ src/afs/LINUX/osi_vnodeops.c |   13 +++++++++++--
+ src/cf/linux-test4.m4        |   16 ++++++++++++++--
+ 3 files changed, 26 insertions(+), 4 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 60c47d1..de82283 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -768,6 +768,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 	  	 LINUX_WRITE_INODE_RETURN_TYPE
+ 	  	 LINUX_IOP_I_CREATE_TAKES_NAMEIDATA
+ 	  	 LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA
++		 LINUX_IOP_I_PERMISSION_TAKES_FLAGS
+ 	  	 LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA
+ 	  	 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
+ 	  	 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 2389389..8352769 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1786,16 +1786,25 @@ afs_linux_updatepage(struct file *fp, struct page *pp, unsigned long offset,
+  * Check access rights - returns error if can't check or permission denied.
+  */
+ static int
+-#ifdef IOP_PERMISSION_TAKES_NAMEIDATA
++#if defined(IOP_PERMISSION_TAKES_FLAGS)
++afs_linux_permission(struct inode *ip, int mode, unsigned int flags)
++#elif defined(IOP_PERMISSION_TAKES_NAMEIDATA)
+ afs_linux_permission(struct inode *ip, int mode, struct nameidata *nd)
+ #else
+ afs_linux_permission(struct inode *ip, int mode)
+ #endif
+ {
+     int code;
+-    cred_t *credp = crref();
++    cred_t *credp;
+     int tmp = 0;
+ 
++#if defined(IOP_PERMISSION_TAKES_FLAGS)
++    /* We don't support RCU path walking */
++    if (flags & IPERM_FLAG_RCU)
++       return -ECHILD;
++#endif
++
++    credp = crref();
+     AFS_GLOCK();
+     if (mode & MAY_EXEC)
+ 	tmp |= VEXEC;
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 67ddf91..88e4863 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -680,12 +680,24 @@ AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
+ [#include <linux/fs.h>
+ #include <linux/namei.h>],
+ [struct inode _inode;
+-struct dentry _dentry;
+ struct nameidata _nameidata;
+ (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
+ 		       [IOP_PERMISSION_TAKES_NAMEIDATA],
+ 		       [define if your iops.permission takes a nameidata argument],
+-		       [])
++		       [-Werror])
++])
++
++
++AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_FLAGS], [
++  AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes flags],
++			[ac_cv_linux_func_i_permission_takes_flags],
++			[#include <linux/fs.h>],
++			[struct inode _inode;
++			unsigned int flags = 0;
++			(void)_inode.i_op->permission(&_inode, 0, flags);],
++		       [IOP_PERMISSION_TAKES_FLAGS],
++		       [define if your iops.permission takes a flags argument],
++		       [-Werror])
+ ])
+ 
+ 
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0005-linux-2.6.38-New-d_op-handling.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0005-linux-2.6.38-New-d_op-handling.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0005-linux-2.6.38-New-d_op-handling.patch	(revision 1835)
@@ -0,0 +1,110 @@
+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/acinclude.m4
++++ b/acinclude.m4
+@@ -749,6 +749,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 		 LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE
+ 		 LINUX_FS_STRUCT_SUPER_HAS_EVICT_INODE
+ 		 LINUX_FS_STRUCT_SUPER_BLOCK_HAS_S_BDI
++		 AC_CHECK_LINUX_STRUCT([super_block], [s_d_op], [fs.h])
+ 		 LINUX_STRUCT_BDI_HAS_NAME
+ 	         LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
+ 	         LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index fb69d39..2a937e4 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -140,6 +140,12 @@ afs_read_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
++
++#if defined(AFS_LINUX26_ENV)
+     /* used for inodes backing_dev_info field, also */
+     afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info));
+ #if defined(HAVE_BDI_INIT)
+@@ -227,7 +233,9 @@ afs_root(struct super_block *afsp)
+ #else
+ 		afsp->s_root = d_alloc_root(ip, NULL);
+ #endif
++#if !defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
+ 		afsp->s_root->d_op = &afs_dentry_operations;
++#endif
+ 	    } else
+ 		code = ENOENT;
+ 	}
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 8352769..03294b2 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1067,7 +1067,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)->m.DataVersion);
+ 	d_instantiate(dp, ip);
+     }
+@@ -1123,7 +1125,9 @@ afs_linux_lookup(struct inode *dip, struct dentry *dp)
+ 	    )
+ 	    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)->m.DataVersion);
+     AFS_GUNLOCK();
+ 
+@@ -1315,7 +1319,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)->m.DataVersion);
+ 	d_instantiate(dp, ip);
+     }
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0006-linux-2.6.38-Make-d_revalidate-RCU-walk-aware.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0006-linux-2.6.38-Make-d_revalidate-RCU-walk-aware.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0006-linux-2.6.38-Make-d_revalidate-RCU-walk-aware.patch	(revision 1835)
@@ -0,0 +1,51 @@
+From 7bcd8c5884683a38cbe04faa631bda15b38a492b Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Tue, 25 Jan 2011 18:18:56 -0500
+Subject: [PATCH 6/8] linux: 2.6.38: Make d_revalidate RCU-walk aware
+
+Signal to the vfs that we don't support path RCU walk in
+d_revalidate.  It will call back in non-RCU mode.
+
+Reviewed-on: http://gerrit.openafs.org/3759
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit 52556d50298e4a636f07e9a3cf0b6557c882c82d)
+
+Change-Id: Id346ca87a1a064ab7d66140156cb8eb48a888566
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3995
+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/4042
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ src/afs/LINUX/osi_vnodeops.c |    6 ++++++
+ 1 files changed, 6 insertions(+), 0 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index 03294b2..e2a3e28 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -865,10 +865,16 @@ afs_linux_dentry_revalidate(struct dentry *dp)
+     int valid;
+     struct afs_fakestat_state fakestate;
+ 
++#ifdef LOOKUP_RCU
++    /* We don't support RCU path walking */
++    if (nd->flags & LOOKUP_RCU)
++       return -ECHILD;
++#endif
+ #ifdef AFS_LINUX24_ENV
+     lock_kernel();
+ #endif
+     AFS_GLOCK();
++
+     afs_InitFakeStat(&fakestate);
+ 
+     if (dp->d_inode) {
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0007-Linux-2.6.38-deal-with-dcache_lock-removal.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0007-Linux-2.6.38-deal-with-dcache_lock-removal.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0007-Linux-2.6.38-deal-with-dcache_lock-removal.patch	(revision 1835)
@@ -0,0 +1,164 @@
+From 2c3b79c8c242d12398eff647753370787b7cf300 Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Fri, 28 Jan 2011 20:59:17 -0500
+Subject: [PATCH 7/8] Linux: 2.6.38: deal with dcache_lock removal
+
+dcache_lock is gone in 2.6.38, and some of the vfs locking rules
+have changed.
+
+Of interest for openafs:
+- inode->i_lock protects the d_alias list
+- dentry->d_lock protects d_unhashed()
+
+Add a new configure test for dcache_lock, and replace its use by
+the appropriate new lock(s).
+
+Reviewed-on: http://gerrit.openafs.org/3771
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit 2eca7aef7b2940e4ef5f9901ce28481af6edb6dd)
+
+Change-Id: Ie405bb1e40cca4ba83bca3e051e2ab54b8850ac6
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3998
+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/4043
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ acinclude.m4          |    1 +
+ src/afs/afs_daemons.c |    8 ++++++++
+ src/afs/afs_vcache.c  |   35 +++++++++++++++++++++++++++++++++--
+ src/cf/linux-test4.m4 |   11 +++++++++++
+ 4 files changed, 53 insertions(+), 2 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 7904e20..655fb11 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -817,6 +817,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 		 LINUX_GENERIC_FILE_AIO_READ
+ 		 LINUX_INIT_WORK_HAS_DATA
+ 		 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
++		 LINUX_HAVE_DCACHE_LOCK
+ 		 LINUX_SYSCTL_TABLE_CHECKING
+ 		 LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME
+ 		 LINUX_HAVE_IGET
+diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c
+index bd5bba8..3d9d977 100644
+--- a/src/afs/afs_daemons.c
++++ b/src/afs/afs_daemons.c
+@@ -376,7 +376,11 @@ afs_CheckRootVolume(void)
+ 		    dp = d_find_alias(AFSTOV(afs_globalVp));
+ 		    
+ #if defined(AFS_LINUX24_ENV)
++#if defined(HAVE_DCACHE_LOCK)
+ 		    spin_lock(&dcache_lock);
++#else
++		    spin_lock(&AFSTOV(vcp)->i_lock);
++#endif
+ #if defined(AFS_LINUX26_ENV)
+ 		    spin_lock(&dp->d_lock);
+ #endif
+@@ -388,7 +392,11 @@ afs_CheckRootVolume(void)
+ #if defined(AFS_LINUX26_ENV)
+ 		    spin_unlock(&dp->d_lock);
+ #endif
++#if defined(HAVE_DCACHE_LOCK)
+ 		    spin_unlock(&dcache_lock);
++#else
++		    spin_unlock(&AFSTOV(vcp)->i_lock);
++#endif
+ #endif
+ 		    dput(dp);
+ 		    
+diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c
+index 201bae7..63e6a27 100644
+--- a/src/afs/afs_vcache.c
++++ b/src/afs/afs_vcache.c
+@@ -673,12 +673,15 @@ afs_ShakeLooseVCaches(afs_int32 anumber)
+ #if defined(AFS_LINUX22_ENV)
+ 	    if (tvc != afs_globalVp && VREFCOUNT(tvc) > 1 && tvc->opens == 0) {
+                 struct dentry *dentry;
++		struct inode *inode = AFSTOV(tvc);
+                 struct list_head *cur, *head;
+                 AFS_GUNLOCK();
++
++#if defined(HAVE_DCACHE_LOCK)
+ #if defined(AFS_LINUX24_ENV)
+                 spin_lock(&dcache_lock);
+ #endif
+-		head = &(AFSTOV(tvc))->i_dentry;
++		head = &inode->i_dentry;
+ 
+ restart:
+                 cur = head;
+@@ -687,7 +690,6 @@ restart:
+ 
+ 		    if (d_unhashed(dentry))
+ 			continue;
+-
+ 		    dget_locked(dentry);
+ 
+ #if defined(AFS_LINUX24_ENV)
+@@ -707,6 +709,35 @@ restart:
+ #if defined(AFS_LINUX24_ENV)
+ 		spin_unlock(&dcache_lock);
+ #endif
++#else /* HAVE_DCACHE_LOCK */
++		spin_lock(&inode->i_lock);
++		head = &inode->i_dentry;
++
++restart:
++		cur = head;
++		while ((cur = cur->next) != head) {
++		    dentry = list_entry(cur, struct dentry, d_alias);
++
++		    spin_lock(&dentry->d_lock);
++		    if (d_unhashed(dentry)) {
++			spin_unlock(&dentry->d_lock);
++			continue;
++		    }
++		    spin_unlock(&dentry->d_lock);
++		    dget(dentry);
++
++		    spin_unlock(&inode->i_lock);
++		    if (d_invalidate(dentry) == -EBUSY) {
++			dput(dentry);
++			/* perhaps lock and try to continue? (use cur as head?) */
++			goto inuse;
++		    }
++		    dput(dentry);
++		    spin_lock(&inode->i_lock);
++		    goto restart;
++		}
++		spin_unlock(&inode->i_lock);
++#endif /* HAVE_DCACHE_LOCK */
+ 	    inuse:
+ 		AFS_GLOCK();
+ 	    }
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 88e4863..2f426ce 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -1316,3 +1316,14 @@ AC_DEFUN([LINUX_HAVE_INODE_SETATTR], [
+   if test "x$ac_cv_linux_inode_setattr" = "xyes"; then
+     AC_DEFINE([HAVE_LINUX_INODE_SETATTR], 1, [define if your kernel has inode_setattr()])
+   fi])
++
++AC_DEFUN([LINUX_HAVE_DCACHE_LOCK], [
++  AC_CHECK_LINUX_BUILD([for dcache_lock],
++			[ac_cv_linux_have_dcache_lock],
++			[#include <linux/dcache.h> ],
++			[printk("%p", &dcache_lock);],
++			[HAVE_DCACHE_LOCK],
++			[define if dcache_lock exists],
++			[])
++])
++
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0008-Linux-2.6.38-dentry-d_count-is-not-an-atomic.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0008-Linux-2.6.38-dentry-d_count-is-not-an-atomic.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0008-Linux-2.6.38-dentry-d_count-is-not-an-atomic.patch	(revision 1835)
@@ -0,0 +1,86 @@
+From 7c3999e05c928991d22e3eeae2c69e5759c6ea4a Mon Sep 17 00:00:00 2001
+From: Marc Dionne <marc.c.dionne@gmail.com>
+Date: Wed, 2 Feb 2011 21:55:27 -0500
+Subject: [PATCH 8/8] Linux: 2.6.38: dentry->d_count is not an atomic
+
+d_count is now an int protected by the dentry's d_lock.
+Take the lock when we use it, instead of using an atomic_*
+function.
+
+Reviewed-on: http://gerrit.openafs.org/3883
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+(cherry picked from commit 281f5bf5fbb0a546edcce62ef4e097ae9bbdbf73)
+
+Change-Id: Id6b17d9cfe18d348a66df02f6b309fc53b00da86
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+Reviewed-on: http://gerrit.openafs.org/3999
+Tested-by: BuildBot <buildbot@rampaginggeek.com>
+Reviewed-by: Russ Allbery <rra@stanford.edu>
+Reviewed-on: http://gerrit.openafs.org/4044
+Reviewed-by: Derrick Brashear <shadow@dementia.org>
+Tested-by: Derrick Brashear <shadow@dementia.org>
+---
+ acinclude.m4                 |    1 +
+ src/afs/LINUX/osi_vnodeops.c |    9 +++++++++
+ src/cf/linux-test4.m4        |   12 ++++++++++++
+ 3 files changed, 22 insertions(+), 0 deletions(-)
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 655fb11..c3f5e15 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -818,6 +818,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
+ 		 LINUX_INIT_WORK_HAS_DATA
+ 		 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
+ 		 LINUX_HAVE_DCACHE_LOCK
++		 LINUX_D_COUNT_IS_INT
+ 		 LINUX_SYSCTL_TABLE_CHECKING
+ 		 LINUX_STRUCT_CTL_TABLE_HAS_CTL_NAME
+ 		 LINUX_HAVE_IGET
+diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c
+index e2a3e28..3118ec7 100644
+--- a/src/afs/LINUX/osi_vnodeops.c
++++ b/src/afs/LINUX/osi_vnodeops.c
+@@ -1396,9 +1396,18 @@ afs_linux_rename(struct inode *oldip, struct dentry *olddp,
+ #endif
+ 
+ #if defined(AFS_LINUX24_ENV)
++#if defined(D_COUNT_INT)
++    spin_lock(&olddp->d_lock);
++    if (olddp->d_count > 1) {
++	spin_unlock(&olddp->d_lock);
++	shrink_dcache_parent(olddp);
++    } else
++	spin_unlock(&olddp->d_lock);
++#else
+     if (atomic_read(&olddp->d_count) > 1)
+ 	shrink_dcache_parent(olddp);
+ #endif
++#endif
+ 
+     AFS_GLOCK();
+     code = afs_rename(VTOAFS(oldip), oldname, VTOAFS(newip), newname, credp);
+diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
+index 2f426ce..b428f37 100644
+--- a/src/cf/linux-test4.m4
++++ b/src/cf/linux-test4.m4
+@@ -1327,3 +1327,15 @@ AC_DEFUN([LINUX_HAVE_DCACHE_LOCK], [
+ 			[])
+ ])
+ 
++
++AC_DEFUN([LINUX_D_COUNT_IS_INT], [
++  AC_CHECK_LINUX_BUILD([if dentry->d_count is an int],
++			[ac_cv_linux_d_count_int],
++			[#include <linux/dcache.h> ],
++			[struct dentry _d;
++			dget(&_d);
++			_d.d_count = 1;],
++			[D_COUNT_INT],
++			[define if dentry->d_count is an int],
++			[-Werror])
++])
+-- 
+1.7.3.4
+
Index: branches/fc15-dev/server/common/patches/openafs-0009-fix-broken-earlier.patch
===================================================================
--- branches/fc15-dev/server/common/patches/openafs-0009-fix-broken-earlier.patch	(revision 1835)
+++ branches/fc15-dev/server/common/patches/openafs-0009-fix-broken-earlier.patch	(revision 1835)
@@ -0,0 +1,67 @@
+From 1f4c2d96550e8c51178a68633965e4f0b788bc39 Mon Sep 17 00:00:00 2001
+From: Anders Kaseorg <andersk@mit.edu>
+Date: Sat, 30 Apr 2011 23:35:02 -0400
+Subject: [PATCH] =?UTF-8?q?Fix=20cherry-pick=20of=20=E2=80=9Clinux:=202.6.38:=20New=20d=5Fop=20handling=E2=80=9D?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Conflicts in this cherry-pick (http://gerrit.openafs.org/4041) were
+resolved incorrectly.  The correct resolution of
+"""
+ <<<<<<< HEAD
+ ||||||| parent of 0d95e6b... linux: 2.6.38: New d_op handling
+ #if defined(AFS_LINUX26_ENV)
+ =======
+
+ #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
+     sb->s_d_op = &afs_dentry_operations;
+ #endif
+
+ #if defined(AFS_LINUX26_ENV)
+ >>>>>>> 0d95e6b... linux: 2.6.38: New d_op handling
+"""
+is
+"""
+
+ #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
+     sb->s_d_op = &afs_dentry_operations;
+ #endif
+
+"""
+and not
+"""
+
+ #if defined(STRUCT_SUPER_BLOCK_HAS_S_D_OP)
+     sb->s_d_op = &afs_dentry_operations;
+ #endif
+
+ #if defined(AFS_LINUX26_ENV)
+"""
+
+As usual, it’s impossible to tell the difference in the default
+conflict style, so I urge everyone reading this to run
+
+git config --global merge.conflictstyle diff3
+
+Change-Id: I09fb77b2f1d80beda7b81fa1f40f663117dae920
+Signed-off-by: Anders Kaseorg <andersk@mit.edu>
+---
+ src/afs/LINUX/osi_vfsops.c |    1 -
+ 1 files changed, 0 insertions(+), 1 deletions(-)
+
+diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c
+index 2a937e4..904bd79 100644
+--- a/src/afs/LINUX/osi_vfsops.c
++++ b/src/afs/LINUX/osi_vfsops.c
+@@ -145,7 +145,6 @@ afs_read_super(struct super_block *sb, void *data, int silent)
+     sb->s_d_op = &afs_dentry_operations;
+ #endif
+ 
+-#if defined(AFS_LINUX26_ENV)
+     /* used for inodes backing_dev_info field, also */
+     afs_backing_dev_info = osi_Alloc(sizeof(struct backing_dev_info));
+ #if defined(HAVE_BDI_INIT)
+-- 
+1.7.3.4
+
