shhuiw@gmail.com
2012-Nov-30 06:02 UTC
[PATCH] Btrfs: cleanup: assign path->nodes[0]to leaf after ret check in __btrfs_write_out_cache
From: Wang Sheng-Hui <shhuiw@gmail.com>
If the ret check fails, the assignment is useless.
Move the assignment after the check.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html