From 07120f1abdff80f3d1351f733661abe28d609535 Mon Sep 17 00:00:00 2001 From: Allison Collins Date: Mon, 20 Jul 2020 21:47:22 -0700 Subject: xfs: Add xfs_has_attr and subroutines This patch adds a new functions to check for the existence of an attribute. Subroutines are also added to handle the cases of leaf blocks, nodes or shortform. Common code that appears in existing attr add and remove functions have been factored out to help reduce the appearance of duplicated code. We will need these routines later for delayed attributes since delayed operations cannot return error codes. Signed-off-by: Allison Collins Reviewed-by: Chandan Rajendra Reviewed-by: Brian Foster Reviewed-by: Darrick J. Wong [darrick: fix a leak-on-error bug reported by Dan Carpenter] [darrick: fix unused variable warning reported by 0day] Signed-off-by: Darrick J. Wong Acked-by: Dave Chinner Reported-by: dan.carpenter@oracle.com Reported-by: kernel test robot --- fs/xfs/libxfs/xfs_attr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/xfs/libxfs/xfs_attr.h') diff --git a/fs/xfs/libxfs/xfs_attr.h b/fs/xfs/libxfs/xfs_attr.h index db4717657ca1..3e97a935e712 100644 --- a/fs/xfs/libxfs/xfs_attr.h +++ b/fs/xfs/libxfs/xfs_attr.h @@ -89,6 +89,7 @@ int xfs_attr_get_ilocked(struct xfs_da_args *args); int xfs_attr_get(struct xfs_da_args *args); int xfs_attr_set(struct xfs_da_args *args); int xfs_attr_set_args(struct xfs_da_args *args); +int xfs_has_attr(struct xfs_da_args *args); int xfs_attr_remove_args(struct xfs_da_args *args); bool xfs_attr_namecheck(const void *name, size_t length); -- cgit