Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc2070a2 authored by Shaohua Li's avatar Shaohua Li Committed by Theodore Ts'o
Browse files

ext4: remove dead code in ext4_has_free_blocks()



percpu_counter_sum_positive() never returns a negative value.

Signed-off-by: default avatarShaohua Li <shaohua.li@intel.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent d9f34504
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -507,11 +507,6 @@ static int ext4_has_free_blocks(struct ext4_sb_info *sbi, s64 nblocks)
						EXT4_FREEBLOCKS_WATERMARK) {
		free_blocks  = percpu_counter_sum_positive(fbc);
		dirty_blocks = percpu_counter_sum_positive(dbc);
		if (dirty_blocks < 0) {
			printk(KERN_CRIT "Dirty block accounting "
					"went wrong %lld\n",
					(long long)dirty_blocks);
		}
	}
	/* Check whether we have space after
	 * accounting for current dirty blocks & root reserved blocks.