mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Linux 3.14 compat: assign inode->set_acl
Linux 3.14 introduces inode->set_acl(). Normally, acl modification will come from setxattr, which will handle by the acl xattr_handler, and we already handles that well. However, nfsd will directly calls inode->set_acl or return error if it doesn't exists. Reviewed-by: Tim Chase <tim@chase2k.com> Reviewed-by: Massimo Maggi <me@massimo-maggi.eu> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Chunwei Chen <david.chen@osnexus.com> Closes #5371 Closes #5375
This commit is contained in:
@@ -716,6 +716,9 @@ const struct inode_operations zpl_inode_operations = {
|
||||
.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)
|
||||
@@ -752,6 +755,9 @@ const struct inode_operations zpl_dir_inode_operations = {
|
||||
#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)
|
||||
@@ -792,6 +798,9 @@ const struct inode_operations zpl_special_inode_operations = {
|
||||
#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)
|
||||
|
||||
@@ -936,7 +936,7 @@ xattr_handler_t zpl_xattr_security_handler = {
|
||||
*/
|
||||
#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;
|
||||
@@ -1140,7 +1140,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
|
||||
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;
|
||||
}
|
||||
@@ -1151,7 +1151,7 @@ zpl_init_acl(struct inode *ip, struct inode *dir)
|
||||
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:
|
||||
@@ -1178,7 +1178,7 @@ zpl_chmod_acl(struct inode *ip)
|
||||
|
||||
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);
|
||||
|
||||
@@ -1308,7 +1308,7 @@ __zpl_xattr_acl_set_access(struct inode *ip, const char *name,
|
||||
acl = NULL;
|
||||
}
|
||||
|
||||
error = zpl_set_acl(ip, type, acl);
|
||||
error = zpl_set_acl(ip, acl, type);
|
||||
zpl_posix_acl_release(acl);
|
||||
|
||||
return (error);
|
||||
@@ -1348,7 +1348,7 @@ __zpl_xattr_acl_set_default(struct inode *ip, const char *name,
|
||||
acl = NULL;
|
||||
}
|
||||
|
||||
error = zpl_set_acl(ip, type, acl);
|
||||
error = zpl_set_acl(ip, acl, type);
|
||||
zpl_posix_acl_release(acl);
|
||||
|
||||
return (error);
|
||||
|
||||
Reference in New Issue
Block a user