btrfs: fix dirtied pages accounting on sub-page writes
authorWu Fengguang <fengguang.wu@intel.com>
Mon, 8 Aug 2011 21:19:47 +0000 (15:19 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Sun, 18 Dec 2011 06:20:25 +0000 (14:20 +0800)
commit32c7f202a4801252a0f3578807b75a961f792870
treec09d5578604e83c2c421aca32b6b125d70b4a2bc
parent2f800fbd777b792de54187088df19a7df0251254
btrfs: fix dirtied pages accounting on sub-page writes

When doing 1KB sequential writes to the same page,
balance_dirty_pages_ratelimited_nr() should be called once instead of 4
times, the latter makes the dirtier tasks be throttled much too heavy.

Fix it with proper de-accounting on clear_page_dirty_for_io().

CC: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
fs/btrfs/file.c