[PATCH] Btrfs: use self-explaining variable

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

 



This uses a bool 'do_backup' to help understand this piece of code.

Signed-off-by: Liu Bo <bo.li.liu@xxxxxxxxxx>
---
This is based on a patch "Btrfs: do not backup tree roots when fsync".

 fs/btrfs/disk-io.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index cdb7043..9811b9d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -3691,6 +3691,7 @@ int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 	int max_errors;
 	int total_errors = 0;
 	u64 flags;
+	bool do_backup = (max_mirrors == 0);
 
 	do_barriers = !btrfs_test_opt(fs_info, NOBARRIER);
 
@@ -3699,7 +3700,7 @@ int write_all_supers(struct btrfs_fs_info *fs_info, int max_mirrors)
 	 * not from fsync where the tree roots in fs_info have not
 	 * been consistent on disk.
 	 */
-	if (max_mirrors == 0)
+	if (do_backup)
 		backup_super_roots(fs_info);
 
 	sb = fs_info->super_for_commit;
-- 
2.9.4

--
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