btrfs: use generic posix ACL infrastructure
Also don't bother to set up a .get_acl method for symlinks as we do not support access control (ACLs or even mode bits) for symlinks in Linux. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
committed by
Al Viro
parent
37bc15392a
commit
996a710d46
@@ -4464,7 +4464,7 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr)
|
||||
err = btrfs_dirty_inode(inode);
|
||||
|
||||
if (!err && attr->ia_valid & ATTR_MODE)
|
||||
err = btrfs_acl_chmod(inode);
|
||||
err = posix_acl_chmod(inode, inode->i_mode);
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -8649,12 +8649,14 @@ static const struct inode_operations btrfs_dir_inode_operations = {
|
||||
.removexattr = btrfs_removexattr,
|
||||
.permission = btrfs_permission,
|
||||
.get_acl = btrfs_get_acl,
|
||||
.set_acl = btrfs_set_acl,
|
||||
.update_time = btrfs_update_time,
|
||||
};
|
||||
static const struct inode_operations btrfs_dir_ro_inode_operations = {
|
||||
.lookup = btrfs_lookup,
|
||||
.permission = btrfs_permission,
|
||||
.get_acl = btrfs_get_acl,
|
||||
.set_acl = btrfs_set_acl,
|
||||
.update_time = btrfs_update_time,
|
||||
};
|
||||
|
||||
@@ -8724,6 +8726,7 @@ static const struct inode_operations btrfs_file_inode_operations = {
|
||||
.permission = btrfs_permission,
|
||||
.fiemap = btrfs_fiemap,
|
||||
.get_acl = btrfs_get_acl,
|
||||
.set_acl = btrfs_set_acl,
|
||||
.update_time = btrfs_update_time,
|
||||
};
|
||||
static const struct inode_operations btrfs_special_inode_operations = {
|
||||
@@ -8735,6 +8738,7 @@ static const struct inode_operations btrfs_special_inode_operations = {
|
||||
.listxattr = btrfs_listxattr,
|
||||
.removexattr = btrfs_removexattr,
|
||||
.get_acl = btrfs_get_acl,
|
||||
.set_acl = btrfs_set_acl,
|
||||
.update_time = btrfs_update_time,
|
||||
};
|
||||
static const struct inode_operations btrfs_symlink_inode_operations = {
|
||||
@@ -8748,7 +8752,6 @@ static const struct inode_operations btrfs_symlink_inode_operations = {
|
||||
.getxattr = btrfs_getxattr,
|
||||
.listxattr = btrfs_listxattr,
|
||||
.removexattr = btrfs_removexattr,
|
||||
.get_acl = btrfs_get_acl,
|
||||
.update_time = btrfs_update_time,
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user