提交 605e74e2 编写于 作者: C Christoph Hellwig 提交者: Darrick J. Wong

xfs: simplify xfs_attr_remove_args

Directly return from the subfunctions and avoid the error variable.  Also
remove the not really needed dp local variable.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Signed-off-by: NDarrick J. Wong <djwong@kernel.org>
上级 2ac131df
...@@ -386,21 +386,16 @@ int ...@@ -386,21 +386,16 @@ int
xfs_attr_remove_args( xfs_attr_remove_args(
struct xfs_da_args *args) struct xfs_da_args *args)
{ {
struct xfs_inode *dp = args->dp; if (!xfs_inode_hasattr(args->dp))
int error; return -ENOATTR;
if (!xfs_inode_hasattr(dp)) { if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
error = -ENOATTR; ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE);
} else if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) { return xfs_attr_shortform_remove(args);
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 (xfs_attr_is_leaf(args->dp))
return error; return xfs_attr_leaf_removename(args);
return xfs_attr_node_removename(args);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册