summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_attr_leaf.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-12-20 09:34:58 +0300
committerChandan Babu R <chandanbabu@kernel.org>2023-12-29 11:07:04 +0300
commit6c8d169bbd51fc10d1d0029d495962881315b4c2 (patch)
tree3f42019029773653bfabce94e9ba8d09d0053e3c /fs/xfs/libxfs/xfs_attr_leaf.h
parent14f2e4ab5d0310c2bb231941d9884fa5bae47fab (diff)
downloadlinux-6c8d169bbd51fc10d1d0029d495962881315b4c2.tar.xz
xfs: simplify xfs_attr_sf_findname
xfs_attr_sf_findname has the simple job of finding a xfs_attr_sf_entry in the attr fork, but the convoluted calling convention obfuscates that. Return the found entry as the return value instead of an pointer argument, as the -ENOATTR/-EEXIST can be trivally derived from that, and remove the basep argument, as it is equivalent of the offset of sfe in the data for if an sfe was found, or an offset of totsize if not was found. To simplify the totsize computation add a xfs_attr_sf_endptr helper that returns the imaginative xfs_attr_sf_entry at the end of the current attrs. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_attr_leaf.h')
-rw-r--r--fs/xfs/libxfs/xfs_attr_leaf.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.h b/fs/xfs/libxfs/xfs_attr_leaf.h
index ce6743463c86..56fcd689eedf 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.h
+++ b/fs/xfs/libxfs/xfs_attr_leaf.h
@@ -51,9 +51,7 @@ int xfs_attr_shortform_lookup(struct xfs_da_args *args);
int xfs_attr_shortform_getvalue(struct xfs_da_args *args);
int xfs_attr_shortform_to_leaf(struct xfs_da_args *args);
int xfs_attr_sf_removename(struct xfs_da_args *args);
-int xfs_attr_sf_findname(struct xfs_da_args *args,
- struct xfs_attr_sf_entry **sfep,
- unsigned int *basep);
+struct xfs_attr_sf_entry *xfs_attr_sf_findname(struct xfs_da_args *args);
int xfs_attr_shortform_allfit(struct xfs_buf *bp, struct xfs_inode *dp);
int xfs_attr_shortform_bytesfit(struct xfs_inode *dp, int bytes);
xfs_failaddr_t xfs_attr_shortform_verify(struct xfs_attr_shortform *sfp,