summaryrefslogtreecommitdiff
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/libxfs/xfs_attr.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index fd61c67f5739..43ef85678cba 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -386,21 +386,16 @@ int
xfs_attr_remove_args(
struct xfs_da_args *args)
{
- struct xfs_inode *dp = args->dp;
- int error;
+ if (!xfs_inode_hasattr(args->dp))
+ return -ENOATTR;
- if (!xfs_inode_hasattr(dp)) {
- error = -ENOATTR;
- } else if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
- ASSERT(dp->i_afp->if_flags & XFS_IFINLINE);
- error = xfs_attr_shortform_remove(args);
- } else if (xfs_attr_is_leaf(dp)) {
- error = xfs_attr_leaf_removename(args);
- } else {
- error = xfs_attr_node_removename(args);
+ if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
+ ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE);
+ return xfs_attr_shortform_remove(args);
}
-
- return error;
+ if (xfs_attr_is_leaf(args->dp))
+ return xfs_attr_leaf_removename(args);
+ return xfs_attr_node_removename(args);
}
/*