Skip to content

Commit

Permalink
libfs: Use IOP_XATTR flag for empty directory handling
Browse files Browse the repository at this point in the history
Instead of special xattr inode operations, use the IOP_XATTR inode
operations flag for the special libfs empty directories.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Andreas Gruenbacher authored and Al Viro committed Oct 8, 2016
1 parent 5f6e59a commit f5c2443
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1150,24 +1150,6 @@ static int empty_dir_setattr(struct dentry *dentry, struct iattr *attr)
return -EPERM;
}

static int empty_dir_setxattr(struct dentry *dentry, struct inode *inode,
const char *name, const void *value,
size_t size, int flags)
{
return -EOPNOTSUPP;
}

static ssize_t empty_dir_getxattr(struct dentry *dentry, struct inode *inode,
const char *name, void *value, size_t size)
{
return -EOPNOTSUPP;
}

static int empty_dir_removexattr(struct dentry *dentry, const char *name)
{
return -EOPNOTSUPP;
}

static ssize_t empty_dir_listxattr(struct dentry *dentry, char *list, size_t size)
{
return -EOPNOTSUPP;
Expand All @@ -1178,9 +1160,6 @@ static const struct inode_operations empty_dir_inode_operations = {
.permission = generic_permission,
.setattr = empty_dir_setattr,
.getattr = empty_dir_getattr,
.setxattr = empty_dir_setxattr,
.getxattr = empty_dir_getxattr,
.removexattr = empty_dir_removexattr,
.listxattr = empty_dir_listxattr,
};

Expand Down Expand Up @@ -1216,6 +1195,7 @@ void make_empty_dir_inode(struct inode *inode)
inode->i_blocks = 0;

inode->i_op = &empty_dir_inode_operations;
inode->i_opflags &= ~IOP_XATTR;
inode->i_fop = &empty_dir_operations;
}

Expand Down

0 comments on commit f5c2443

Please sign in to comment.