nixpkgs/pkgs/os-specific/linux/zfs/linux-3.6.patch

341 lines
11 KiB
Diff

diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-create-nameidata.m4 zfs/config/kernel-create-nameidata.m4
*** zfs-0.60-rc11/config/kernel-create-nameidata.m4 1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-create-nameidata.m4 2012-10-22 10:56:55.016756000 -0700
***************
*** 0 ****
--- 1,26 ----
+ 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>
+ ],[
+ #ifdef HAVE_MKDIR_UMODE_T
+ int (*inode_create) (struct inode *,struct dentry *,
+ umode_t, struct nameidata *) = NULL;
+ #else
+ int (*inode_create) (struct inode *,struct dentry *,
+ int, struct nameidata *) = NULL;
+ #endif
+ 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)
+ ])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-create-umode-t.m4 zfs/config/kernel-create-umode-t.m4
*** zfs-0.60-rc11/config/kernel-create-umode-t.m4 2012-10-22 10:26:07.080358000 -0700
--- zfs/config/kernel-create-umode-t.m4 1969-12-31 16:00:00.000000000 -0800
***************
*** 1,26 ****
- dnl #
- dnl # 3.3 API change
- dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
- dnl # umode_t type rather than an int. The expectation is that any backport
- dnl # would also change all three prototypes. However, if it turns out that
- dnl # some distribution doesn't backport the whole thing this could be
- dnl # broken apart in to three seperate checks.
- dnl #
- AC_DEFUN([ZFS_AC_KERNEL_CREATE_UMODE_T], [
- AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
- ZFS_LINUX_TRY_COMPILE([
- #include <linux/fs.h>
- ],[
- int (*create) (struct inode *, struct dentry *, umode_t,
- struct nameidata *) = NULL;
- struct inode_operations iops __attribute__ ((unused)) = {
- .create = create,
- };
- ],[
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_CREATE_UMODE_T, 1,
- [iops->create()/mkdir()/mknod() take umode_t])
- ],[
- AC_MSG_RESULT(no)
- ])
- ])
--- 0 ----
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-lookup-nameidata.m4 zfs/config/kernel-lookup-nameidata.m4
*** zfs-0.60-rc11/config/kernel-lookup-nameidata.m4 1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-lookup-nameidata.m4 2012-10-22 10:56:55.017130000 -0700
***************
*** 0 ****
--- 1,21 ----
+ dnl #
+ dnl # 3.6 API change
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_LOOKUP_NAMEIDATA], [
+ AC_MSG_CHECKING([whether iops->lookup() takes struct nameidata])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ struct dentry * (*inode_lookup) (struct inode *,struct dentry *,
+ struct nameidata *) = NULL;
+ struct inode_operations iops __attribute__ ((unused)) = {
+ .lookup = inode_lookup,
+ };
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_LOOKUP_NAMEIDATA, 1,
+ [iops->lookup() operation takes nameidata])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel.m4 zfs/config/kernel.m4
*** zfs-0.60-rc11/config/kernel.m4 2012-10-22 10:26:07.082539000 -0700
--- zfs/config/kernel.m4 2012-10-22 10:57:19.052391000 -0700
***************
*** 49,56 ****
ZFS_AC_KERNEL_NR_CACHED_OBJECTS
ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
ZFS_AC_KERNEL_FALLOCATE
ZFS_AC_KERNEL_TRUNCATE_RANGE
- ZFS_AC_KERNEL_CREATE_UMODE_T
ZFS_AC_KERNEL_AUTOMOUNT
ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
ZFS_AC_KERNEL_CLEAR_INODE
--- 49,58 ----
ZFS_AC_KERNEL_NR_CACHED_OBJECTS
ZFS_AC_KERNEL_FREE_CACHED_OBJECTS
ZFS_AC_KERNEL_FALLOCATE
+ ZFS_AC_KERNEL_MKDIR_UMODE_T
+ ZFS_AC_KERNEL_LOOKUP_NAMEIDATA
+ ZFS_AC_KERNEL_CREATE_NAMEIDATA
ZFS_AC_KERNEL_TRUNCATE_RANGE
ZFS_AC_KERNEL_AUTOMOUNT
ZFS_AC_KERNEL_ENCODE_FH_WITH_INODE
ZFS_AC_KERNEL_CLEAR_INODE
***************
*** 66,71 ****
--- 68,74 ----
ZFS_AC_KERNEL_BDI
ZFS_AC_KERNEL_BDI_SETUP_AND_REGISTER
ZFS_AC_KERNEL_SET_NLINK
+ ZFS_AC_KERNEL_5ARG_SGET
AS_IF([test "$LINUX_OBJ" != "$LINUX"], [
KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-mkdir-umode-t.m4 zfs/config/kernel-mkdir-umode-t.m4
*** zfs-0.60-rc11/config/kernel-mkdir-umode-t.m4 1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-mkdir-umode-t.m4 2012-10-22 10:56:55.017271000 -0700
***************
*** 0 ****
--- 1,25 ----
+ dnl #
+ dnl # 3.3 API change
+ dnl # The VFS .create, .mkdir and .mknod callbacks were updated to take a
+ dnl # umode_t type rather than an int. The expectation is that any backport
+ dnl # would also change all three prototypes. However, if it turns out that
+ dnl # some distribution doesn't backport the whole thing this could be
+ dnl # broken apart in to three seperate checks.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_MKDIR_UMODE_T], [
+ AC_MSG_CHECKING([whether iops->create()/mkdir()/mknod() take umode_t])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ int (*mkdir) (struct inode *,struct dentry *,umode_t) = NULL;
+ struct inode_operations iops __attribute__ ((unused)) = {
+ .mkdir = mkdir,
+ };
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_MKDIR_UMODE_T, 1,
+ [iops->create()/mkdir()/mknod() take umode_t])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ ])
diff -crN '--exclude=.git' zfs-0.60-rc11/config/kernel-sget-args.m4 zfs/config/kernel-sget-args.m4
*** zfs-0.60-rc11/config/kernel-sget-args.m4 1969-12-31 16:00:00.000000000 -0800
--- zfs/config/kernel-sget-args.m4 2012-10-22 10:56:55.017404000 -0700
***************
*** 0 ****
--- 1,23 ----
+ dnl #
+ dnl # 3.6 API change,
+ dnl # 'sget' now takes the mount flags as an argument.
+ dnl #
+ AC_DEFUN([ZFS_AC_KERNEL_5ARG_SGET],
+ [AC_MSG_CHECKING([whether sget() wants 5 args])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+ ],[
+ struct file_system_type *type = NULL;
+ int (*test)(struct super_block *,void *) = NULL;
+ int (*set)(struct super_block *,void *) = NULL;
+ int flags = 0;
+ void *data = NULL;
+ (void) sget(type, test, set, flags, data);
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_5ARG_SGET, 1, [sget() wants 5 args])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+ ])
+
diff -crN '--exclude=.git' zfs-0.60-rc11/include/linux/vfs_compat.h zfs/include/linux/vfs_compat.h
*** zfs-0.60-rc11/include/linux/vfs_compat.h 2012-10-22 10:26:07.087810000 -0700
--- zfs/include/linux/vfs_compat.h 2012-10-22 10:56:55.018213000 -0700
***************
*** 115,121 ****
* umode_t type rather than an int. To cleanly handle both definitions
* the zpl_umode_t type is introduced and set accordingly.
*/
! #ifdef HAVE_CREATE_UMODE_T
typedef umode_t zpl_umode_t;
#else
typedef int zpl_umode_t;
--- 115,121 ----
* umode_t type rather than an int. To cleanly handle both definitions
* the zpl_umode_t type is introduced and set accordingly.
*/
! #ifdef HAVE_MKDIR_UMODE_T
typedef umode_t zpl_umode_t;
#else
typedef int zpl_umode_t;
***************
*** 131,134 ****
--- 131,144 ----
#define clear_inode(ip) end_writeback(ip)
#endif /* HAVE_EVICT_INODE && !HAVE_CLEAR_INODE */
+ /*
+ * 3.6 API change,
+ * The sget() helper function now takes the mount flags as an argument.
+ */
+ #ifdef HAVE_5ARG_SGET
+ #define zpl_sget(type, cmp, set, fl, mtd) sget(type, cmp, set, fl, mtd)
+ #else
+ #define zpl_sget(type, cmp, set, fl, mtd) sget(type, cmp, set, mtd)
+ #endif /* HAVE_5ARG_SGET */
+
#endif /* _ZFS_VFS_H */
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zfs_ctldir.c zfs/module/zfs/zfs_ctldir.c
*** zfs-0.60-rc11/module/zfs/zfs_ctldir.c 2012-10-22 10:26:07.149142000 -0700
--- zfs/module/zfs/zfs_ctldir.c 2012-10-22 10:56:55.018581000 -0700
***************
*** 920,927 ****
* race cannot occur to an expired mount point because
* we hold the zsb->z_ctldir_lock to prevent the race.
*/
! sbp = sget(&zpl_fs_type, zfsctl_test_super,
! zfsctl_set_super, &id);
if (IS_ERR(sbp)) {
error = -PTR_ERR(sbp);
} else {
--- 920,927 ----
* race cannot occur to an expired mount point because
* we hold the zsb->z_ctldir_lock to prevent the race.
*/
! sbp = zpl_sget(&zpl_fs_type, zfsctl_test_super,
! zfsctl_set_super, 0, &id);
if (IS_ERR(sbp)) {
error = -PTR_ERR(sbp);
} else {
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_ctldir.c zfs/module/zfs/zpl_ctldir.c
*** zfs-0.60-rc11/module/zfs/zpl_ctldir.c 2012-10-22 10:26:07.156116000 -0700
--- zfs/module/zfs/zpl_ctldir.c 2012-10-22 10:56:55.018882000 -0700
***************
*** 143,149 ****
--- 143,153 ----
}
static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
zpl_root_lookup(struct inode *dip, struct dentry *dentry, struct nameidata *nd)
+ #else
+ zpl_root_lookup(struct inode *dip, struct dentry *dentry, unsigned int flags)
+ #endif
{
cred_t *cr = CRED();
struct inode *ip;
***************
*** 180,187 ****
--- 184,197 ----
};
static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
struct nameidata *nd)
+ #else
+ zpl_snapdir_lookup(struct inode *dip, struct dentry *dentry,
+ unsigned int flags)
+ #endif
+
{
cred_t *cr = CRED();
struct inode *ip;
***************
*** 410,417 ****
--- 420,432 ----
#endif /* HAVE_AUTOMOUNT */
static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
zpl_shares_lookup(struct inode *dip, struct dentry *dentry,
struct nameidata *nd)
+ #else
+ zpl_shares_lookup(struct inode *dip, struct dentry *dentry,
+ unsigned int flags)
+ #endif
{
cred_t *cr = CRED();
struct inode *ip = NULL;
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_inode.c zfs/module/zfs/zpl_inode.c
*** zfs-0.60-rc11/module/zfs/zpl_inode.c 2012-10-22 10:26:07.156492000 -0700
--- zfs/module/zfs/zpl_inode.c 2012-10-22 10:56:55.019152000 -0700
***************
*** 31,37 ****
--- 31,41 ----
static struct dentry *
+ #ifdef HAVE_LOOKUP_NAMEIDATA
zpl_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
+ #else
+ zpl_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
+ #endif
{
cred_t *cr = CRED();
struct inode *ip;
***************
*** 71,78 ****
--- 75,87 ----
}
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;
diff -crN '--exclude=.git' zfs-0.60-rc11/module/zfs/zpl_super.c zfs/module/zfs/zpl_super.c
*** zfs-0.60-rc11/module/zfs/zpl_super.c 2012-10-22 10:26:07.156616000 -0700
--- zfs/module/zfs/zpl_super.c 2012-10-22 10:56:55.019421000 -0700
***************
*** 316,322 ****
.delete_inode = zpl_inode_delete,
#endif /* HAVE_EVICT_INODE */
.put_super = zpl_put_super,
- .write_super = NULL,
.sync_fs = zpl_sync_fs,
.statfs = zpl_statfs,
.remount_fs = zpl_remount_fs,
--- 316,321 ----