Linux 3.5: encode_fh API change
authorMarc Dionne <marc.c.dionne@gmail.com>
Sun, 3 Jun 2012 01:35:53 +0000 (21:35 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 7 Jun 2012 12:13:50 +0000 (05:13 -0700)
The encode_fh export operation now expects two inode arguments
instead of a dentry and a "connectable" flag.  Use the inode of
the dentry we're interested in, and NULL as the parent inode which
is the same as passing a 0 flag in the previous API.

Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804
Reviewed-on: http://gerrit.openafs.org/7523
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

acinclude.m4
src/afs/LINUX/osi_compat.h
src/cf/linux-test4.m4

index b1a6d5d..8c94911 100644 (file)
@@ -957,6 +957,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_D_COUNT_IS_INT
                 LINUX_IOP_MKDIR_TAKES_UMODE_T
                 LINUX_IOP_CREATE_TAKES_UMODE_T
+                LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES
 
                 dnl If we are guaranteed that keyrings will work - that is
                 dnl  a) The kernel has keyrings enabled
index 6213734..52c4d2d 100644 (file)
@@ -351,7 +351,11 @@ afs_get_dentry_from_fh(struct super_block *afs_cacheSBp, afs_dcache_id_t *ainode
 static inline int
 afs_get_fh_from_dentry(struct dentry *dp, afs_ufs_dcache_id_t *ainode, int *max_lenp) {
     if (dp->d_sb->s_export_op->encode_fh)
+#if defined(EXPORT_OP_ENCODE_FH_TAKES_INODES)
+        return dp->d_sb->s_export_op->encode_fh(dp->d_inode, &ainode->raw[0], max_lenp, NULL);
+#else
         return dp->d_sb->s_export_op->encode_fh(dp, &ainode->raw[0], max_lenp, 0);
+#endif
 #if defined(NEW_EXPORT_OPS)
     /* If fs doesn't provide an encode_fh method, assume the default INO32 type */
     *max_lenp = sizeof(struct fid)/4;
index 7ff0a5c..ac3fbea 100644 (file)
@@ -651,3 +651,17 @@ AC_DEFUN([LINUX_IOP_CREATE_TAKES_UMODE_T], [
                        [define if inode.i_op->create takes a umode_t argument],
                        [-Werror])
 ])
+
+
+AC_DEFUN([LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES], [
+  AC_CHECK_LINUX_BUILD([whether export operation encode_fh takes inode arguments],
+                       [ac_cv_linux_export_op_encode_fh__takes_inodes],
+                       [#include <linux/exportfs.h>],
+                       [struct export_operations _exp_ops;
+                       int _encode_fh(struct inode *i, __u32 *fh, int *len, struct inode *p)
+                               {return 0;};
+                       _exp_ops.encode_fh = _encode_fh;],
+                       [EXPORT_OP_ENCODE_FH_TAKES_INODES],
+                       [define if encode_fh export op takes inode arguments],
+                       [-Werror])
+])