Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Linux 3.6 fixes (part 4)

- .create in inode_operations takes a bool flag instead of struct
  nameidata.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
  • Loading branch information...
commit 17e9f04c901dac6e4f62a4c2a8e5526bd5240a77 1 parent e47aa5b
@nialv7 nialv7 authored committed
View
21 config/kernel-create-nameidata.m4
@@ -0,0 +1,21 @@
+dnl #
+dnl # 3.6 API change
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_CREATE_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->create() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ int (*inode_create) (struct inode *,struct dentry *,
+ umode_t, struct nameidata *) = NULL;
+ struct inode_operations iops __attribute__ ((unused)) = {
+ .create = inode_create,
+ };
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_CREATE_NAMEIDATA, 1,
+ [iops->create() operation takes nameidata])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
View
1  config/kernel.m4
@@ -51,6 +51,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
ZFS_AC_KERNEL_FALLOCATE
ZFS_AC_KERNEL_LOOKUP_NAMEIDATA
+ ZFS_AC_KERNEL_CREATE_NAMEIDATA
ZFS_AC_KERNEL_TRUNCATE_RANGE
ZFS_AC_KERNEL_MKDIR_UMODE_T
ZFS_AC_KERNEL_AUTOMOUNT
View
5 module/zfs/zpl_inode.c
@@ -75,8 +75,13 @@ zpl_vap_init(vattr_t *vap, struct inode *dir, struct dentry *dentry,
}
static int
+#ifdef HAVE_CREATE_NAMEIDATA
zpl_create(struct inode *dir, struct dentry *dentry, zpl_umode_t mode,
struct nameidata *nd)
+#else
+zpl_create(struct inode *dir, struct dentry *dentry, zpl_umode_t mode,
+ bool flag)
+#endif
{
cred_t *cr = CRED();
struct inode *ip;
Please sign in to comment.
Something went wrong with that request. Please try again.