summaryrefslogtreecommitdiffstats
path: root/fs/kernfs
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2015-12-02 14:44:38 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2015-12-07 03:34:15 +0100
commitaa7c5241c380adb7e6913549292c1b83c1469bda (patch)
tree4247a21eb6370450bfa78ea6f513e560ce334900 /fs/kernfs
parentbtrfs: Use xattr handler infrastructure (diff)
downloadlinux-aa7c5241c380adb7e6913549292c1b83c1469bda.tar.xz
linux-aa7c5241c380adb7e6913549292c1b83c1469bda.zip
tmpfs: Use xattr handler infrastructure
Use the VFS xattr handler infrastructure and get rid of similar code in the filesystem. For implementing shmem_xattr_handler_set, we need a version of simple_xattr_set which removes the attribute when value is NULL. Use this to implement kernfs_iop_removexattr as well. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Reviewed-by: James Morris <james.l.morris@oracle.com> Cc: Hugh Dickins <hughd@google.com> Cc: linux-mm@kvack.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/kernfs')
-rw-r--r--fs/kernfs/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/kernfs/inode.c b/fs/kernfs/inode.c
index 756dd56aaf60..f97e1f7790b1 100644
--- a/fs/kernfs/inode.c
+++ b/fs/kernfs/inode.c
@@ -205,7 +205,7 @@ int kernfs_iop_removexattr(struct dentry *dentry, const char *name)
if (!attrs)
return -ENOMEM;
- return simple_xattr_remove(&attrs->xattrs, name);
+ return simple_xattr_set(&attrs->xattrs, name, NULL, 0, XATTR_REPLACE);
}
ssize_t kernfs_iop_getxattr(struct dentry *dentry, const char *name, void *buf,