])
])
+dnl #
+dnl # 3.14 API change,
+dnl # Check if inode_operations contains the function set_acl
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL], [
+ AC_MSG_CHECKING([whether iops->set_acl() exists])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/fs.h>
+
+ int set_acl_fn(struct inode *inode, struct posix_acl *acl, int type)
+ { return 0; }
+
+ static const struct inode_operations
+ iops __attribute__ ((unused)) = {
+ .set_acl = set_acl_fn,
+ };
+ ],[
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_SET_ACL, 1, [iops->set_acl() exists])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
+
dnl #
dnl # 4.7 API change,
dnl # The kernel get_acl will now check cache before calling i_op->get_acl and
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL
ZFS_AC_KERNEL_INODE_OPERATIONS_CHECK_ACL_WITH_FLAGS
ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
+ ZFS_AC_KERNEL_INODE_OPERATIONS_SET_ACL
ZFS_AC_KERNEL_GET_ACL_HANDLE_CACHE
ZFS_AC_KERNEL_SHOW_OPTIONS
ZFS_AC_KERNEL_FILE_INODE
extern int zpl_xattr_security_init(struct inode *ip, struct inode *dip,
const struct qstr *qstr);
#if defined(CONFIG_FS_POSIX_ACL)
-extern int zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl);
+extern int zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type);
extern struct posix_acl *zpl_get_acl(struct inode *ip, int type);
#if !defined(HAVE_GET_ACL)
#if defined(HAVE_CHECK_ACL_WITH_FLAGS)
.fallocate = zpl_fallocate,
#endif /* HAVE_INODE_FALLOCATE */
#if defined(CONFIG_FS_POSIX_ACL)
+#if defined(HAVE_SET_ACL)
+ .set_acl = zpl_set_acl,
+#endif
#if defined(HAVE_GET_ACL)
.get_acl = zpl_get_acl,
#elif defined(HAVE_CHECK_ACL)
#endif
.listxattr = zpl_xattr_list,
#if defined(CONFIG_FS_POSIX_ACL)
+#if defined(HAVE_SET_ACL)
+ .set_acl = zpl_set_acl,
+#endif
#if defined(HAVE_GET_ACL)
.get_acl = zpl_get_acl,
#elif defined(HAVE_CHECK_ACL)
#endif
.listxattr = zpl_xattr_list,
#if defined(CONFIG_FS_POSIX_ACL)
+#if defined(HAVE_SET_ACL)
+ .set_acl = zpl_set_acl,
+#endif
#if defined(HAVE_GET_ACL)
.get_acl = zpl_get_acl,
#elif defined(HAVE_CHECK_ACL)
*/
#ifdef CONFIG_FS_POSIX_ACL
int
-zpl_set_acl(struct inode *ip, int type, struct posix_acl *acl)
+zpl_set_acl(struct inode *ip, struct posix_acl *acl, int type)
{
struct super_block *sb = ITOZSB(ip)->z_sb;
char *name, *value = NULL;
umode_t mode;
if (S_ISDIR(ip->i_mode)) {
- error = zpl_set_acl(ip, ACL_TYPE_DEFAULT, acl);
+ error = zpl_set_acl(ip, acl, ACL_TYPE_DEFAULT);
if (error)
goto out;
}
ip->i_mode = mode;
zfs_mark_inode_dirty(ip);
if (error > 0)
- error = zpl_set_acl(ip, ACL_TYPE_ACCESS, acl);
+ error = zpl_set_acl(ip, acl, ACL_TYPE_ACCESS);
}
}
out:
error = __posix_acl_chmod(&acl, GFP_KERNEL, ip->i_mode);
if (!error)
- error = zpl_set_acl(ip, ACL_TYPE_ACCESS, acl);
+ error = zpl_set_acl(ip, acl, ACL_TYPE_ACCESS);
zpl_posix_acl_release(acl);
acl = NULL;
}
- error = zpl_set_acl(ip, type, acl);
+ error = zpl_set_acl(ip, acl, type);
zpl_posix_acl_release(acl);
return (error);
acl = NULL;
}
- error = zpl_set_acl(ip, type, acl);
+ error = zpl_set_acl(ip, acl, type);
zpl_posix_acl_release(acl);
return (error);