Skip to content

Commit

Permalink
xfs: tiny cleanup for xfs_link
Browse files Browse the repository at this point in the history
The source and target inodes are guaranteed to never be the same by the VFS,
so no need to check for that (and we would get into bad trouble later anyway
if that were the case).  Also clean up the error handling to use two gotos
instead of nested conditions.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Felix Blyakher <felixb@sgi.com>
  • Loading branch information
Christoph Hellwig authored and Christoph Hellwig committed Feb 4, 2009
1 parent b93b6e4 commit cb3f35b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/xfs/xfs_vnodeops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2004,8 +2004,10 @@ xfs_link(
/* Return through std_return after this point. */

error = XFS_QM_DQATTACH(mp, sip, 0);
if (!error && sip != tdp)
error = XFS_QM_DQATTACH(mp, tdp, 0);
if (error)
goto std_return;

error = XFS_QM_DQATTACH(mp, tdp, 0);
if (error)
goto std_return;

Expand Down

0 comments on commit cb3f35b

Please sign in to comment.