LINUX_IOP_CREATE_TAKES_UMODE_T
LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES
LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE
+ LINUX_DENTRY_OPEN_TAKES_PATH
dnl If we are guaranteed that keyrings will work - that is
dnl a) The kernel has keyrings enabled
})
#endif
+#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
+static inline struct file *
+afs_dentry_open(struct dentry *dp, struct vfsmount *mnt, int flags, const struct cred *creds) {
+#if defined(DENTRY_OPEN_TAKES_PATH)
+ struct path path;
+ struct file *filp;
+ path.mnt = mnt;
+ path.dentry = dp;
+ filp = dentry_open(&path, flags, creds);
+ return filp;
+#else
+ return dentry_open(dp, mntget(mnt), flags, creds);
+#endif
+}
+#endif
+
#endif /* AFS_LINUX_OSI_COMPAT_H */
#if defined(STRUCT_TASK_STRUCT_HAS_CRED)
/* Use stashed credentials - prevent selinux/apparmor problems */
- filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
+ filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds);
if (IS_ERR(filp))
- filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());
+ filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred());
#else
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
#endif
[define if kmap_atomic takes no km_type argument],
[-Werror])
])
+
+
+AC_DEFUN([LINUX_DENTRY_OPEN_TAKES_PATH], [
+ AC_CHECK_LINUX_BUILD([whether dentry_open takes a path argument],
+ [ac_cv_linux_dentry_open_takes_path],
+ [#include <linux/fs.h>],
+ [struct path p;
+ dentry_open(&p, 0, NULL);],
+ [DENTRY_OPEN_TAKES_PATH],
+ [define if dentry_open takes a path argument],
+ [-Werror])
+])