xfs
[Top] [All Lists]

[PATCH 04/17] xfs: tiny cleanup for xfs_link

To: xfs@xxxxxxxxxxx
Subject: [PATCH 04/17] xfs: tiny cleanup for xfs_link
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 26 Jan 2009 02:31:40 -0500
References: <20090126073136.384490000@xxxxxxxxxxxxxxxxxxxxxx>
User-agent: quilt/0.47-1
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@xxxxxx>

Index: xfs-dev/fs/xfs/xfs_vnodeops.c
===================================================================
--- xfs-dev.orig/fs/xfs/xfs_vnodeops.c  2008-12-01 12:56:22.000000000 +0100
+++ xfs-dev/fs/xfs/xfs_vnodeops.c       2008-12-01 12:56:43.000000000 +0100
@@ -2027,8 +2027,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;
 

<Prev in Thread] Current Thread [Next in Thread>