[PATCH] Btrfs: cleanup: assign path->nodes[0]to leaf after ret check in __btrfs_write_out_cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wang Sheng-Hui <shhuiw@xxxxxxxxx>

If the ret check fails, the assignment is useless.
Move the assignment after the check.

Signed-off-by: Wang Sheng-Hui <shhuiw@xxxxxxxxx>
---
 fs/btrfs/free-space-cache.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 058fc9b..d7b3286 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1033,7 +1033,6 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
 				 GFP_NOFS);
 		goto out;
 	}
-	leaf = path->nodes[0];
 	if (ret > 0) {
 		struct btrfs_key found_key;
 		BUG_ON(!path->slots[0]);
@@ -1049,6 +1048,7 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
 			goto out;
 		}
 	}
+	leaf = path->nodes[0];
 
 	BTRFS_I(inode)->generation = trans->transid;
 	header = btrfs_item_ptr(leaf, path->slots[0],
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux