summaryrefslogtreecommitdiff
path: root/fs/erofs/xattr.c
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2023-02-01 16:14:56 +0300
committerChristian Brauner (Microsoft) <brauner@kernel.org>2023-03-06 11:57:12 +0300
commita5488f29835c0eb5561b46e71c23f6c39aab6c83 (patch)
tree72f17e309903875f8296d483d535126d505d1ec5 /fs/erofs/xattr.c
parent0c95c025a02e477b2d112350e1c78bb0cc994c51 (diff)
downloadlinux-a5488f29835c0eb5561b46e71c23f6c39aab6c83.tar.xz
fs: simplify ->listxattr() implementation
The ext{2,4}, erofs, f2fs, and jffs2 filesystems use the same logic to check whether a given xattr can be listed. Simplify them and avoid open-coding the same check by calling the helper we introduced earlier. Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: linux-f2fs-devel@lists.sourceforge.net Cc: linux-erofs@lists.ozlabs.org Cc: linux-ext4@vger.kernel.org Cc: linux-mtd@lists.infradead.org Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'fs/erofs/xattr.c')
-rw-r--r--fs/erofs/xattr.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/erofs/xattr.c b/fs/erofs/xattr.c
index 3de058f17428..015462763bdd 100644
--- a/fs/erofs/xattr.c
+++ b/fs/erofs/xattr.c
@@ -486,13 +486,9 @@ static int xattr_entrylist(struct xattr_iter *_it,
unsigned int prefix_len;
const char *prefix;
- const struct xattr_handler *h =
- erofs_xattr_handler(entry->e_name_index);
-
- if (!h || (h->list && !h->list(it->dentry)))
+ prefix = erofs_xattr_prefix(entry->e_name_index, it->dentry);
+ if (!prefix)
return 1;
-
- prefix = xattr_prefix(h);
prefix_len = strlen(prefix);
if (!it->buffer) {