mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
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>
This commit is contained in:
parent
9172abbcd3
commit
aa7c5241c3
4 changed files with 67 additions and 132 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue