])
#
+# 3.5 encode_fh has parent inode passed in directly
+# see kernel commit b0b0382b
+#
+AC_DEFUN([LC_HAVE_ENCODE_FH_PARENT],
+[AC_MSG_CHECKING([if encode_fh have parent inode as parameter])
+tmp_flags="$EXTRA_KCFLAGS"
+EXTRA_KCFLAGS="-Werror"
+LB_LINUX_TRY_COMPILE([
+ #include <linux/exportfs.h>
+ #include <linux/fs.h>
+ #include <linux/types.h>
+ int ll_encode_fh(struct inode *i, __u32 *a, int *b, struct inode *p)
+ {
+ return 0;
+ }
+],[
+ struct export_operations exp_op;
+ exp_op.encode_fh = ll_encode_fh;
+],[
+ AC_DEFINE(HAVE_ENCODE_FH_PARENT, 1,
+ [have parent inode as parameter])
+ AC_MSG_RESULT([yes])
+],[
+ AC_MSG_RESULT([no])
+])
+EXTRA_KCFLAGS="$tmp_flags"
+])
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 3.5
LC_HAVE_CLEAR_INODE
+ LC_HAVE_ENCODE_FH_PARENT
#
if test x$enable_server = xyes ; then
* 2 -- contains child file handle and parent file handle;
* 255 -- error.
*/
+#ifndef HAVE_ENCODE_FH_PARENT
static int ll_encode_fh(struct dentry *de, __u32 *fh, int *plen,
- int connectable)
+ int connectable)
{
- struct inode *inode = de->d_inode;
- struct inode *parent = de->d_parent->d_inode;
- struct lustre_nfs_fid *nfs_fid = (void *)fh;
- ENTRY;
+ struct inode *inode = de->d_inode;
+ struct inode *parent = de->d_parent->d_inode;
+#else
+static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,
+ struct inode *parent)
+{
+#endif
+ struct lustre_nfs_fid *nfs_fid = (void *)fh;
+ ENTRY;
- CDEBUG(D_INFO, "encoding for (%lu,"DFID") maxlen=%d minlen=%d\n",
- inode->i_ino, PFID(ll_inode2fid(inode)), *plen,
- (int)sizeof(struct lustre_nfs_fid));
+ CDEBUG(D_INFO, "encoding for (%lu,"DFID") maxlen=%d minlen=%d\n",
+ inode->i_ino, PFID(ll_inode2fid(inode)), *plen,
+ (int)sizeof(struct lustre_nfs_fid));
- if (*plen < sizeof(struct lustre_nfs_fid)/4)
- RETURN(255);
+ if (*plen < sizeof(struct lustre_nfs_fid) / 4)
+ RETURN(255);
- nfs_fid->lnf_child = *ll_inode2fid(inode);
- nfs_fid->lnf_parent = *ll_inode2fid(parent);
- *plen = sizeof(struct lustre_nfs_fid)/4;
+ nfs_fid->lnf_child = *ll_inode2fid(inode);
+ nfs_fid->lnf_parent = *ll_inode2fid(parent);
+ *plen = sizeof(struct lustre_nfs_fid) / 4;
- RETURN(LUSTRE_NFS_FID);
+ RETURN(LUSTRE_NFS_FID);
}
static int ll_nfs_get_name_filldir(void *cookie, const char *name, int namelen,