mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] io-accounting: write-cancel accounting
Account for the number of byte writes which this process caused to not happen after all. Cc: Jay Lan <[email protected]> Cc: Shailabh Nagar <[email protected]> Cc: Balbir Singh <[email protected]> Cc: Chris Sturtivant <[email protected]> Cc: Tony Ernst <[email protected]> Cc: Guillaume Thouvenin <[email protected]> Cc: David Wright <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
55e829af06
commit
e08748ce01
2 changed files with 9 additions and 2 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include <linux/module.h>
|
||||
#include <linux/pagemap.h>
|
||||
#include <linux/pagevec.h>
|
||||
#include <linux/task_io_accounting_ops.h>
|
||||
#include <linux/buffer_head.h> /* grr. try_to_release_page,
|
||||
do_invalidatepage */
|
||||
|
||||
|
|
@ -69,7 +70,8 @@ truncate_complete_page(struct address_space *mapping, struct page *page)
|
|||
if (PagePrivate(page))
|
||||
do_invalidatepage(page, 0);
|
||||
|
||||
clear_page_dirty(page);
|
||||
if (test_clear_page_dirty(page))
|
||||
task_io_account_cancelled_write(PAGE_CACHE_SIZE);
|
||||
ClearPageUptodate(page);
|
||||
ClearPageMappedToDisk(page);
|
||||
remove_from_page_cache(page);
|
||||
|
|
|
|||
Loading…
Reference in a new issue