From: Andrew Morton Date: Sun, 10 Dec 2006 10:19:47 +0000 (-0800) Subject: [PATCH] io-accounting: direct-io X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=98c4d57decf97bf8ddfe948a3266aa56b38b1a51;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] io-accounting: direct-io Account for direct-io. Cc: Jay Lan Cc: Shailabh Nagar Cc: Balbir Singh Cc: Chris Sturtivant Cc: Tony Ernst Cc: Guillaume Thouvenin Cc: David Wright Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/direct-io.c b/fs/direct-io.c index 5981e17f46f0..45d34d807391 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -675,6 +676,13 @@ submit_page_section(struct dio *dio, struct page *page, { int ret = 0; + if (dio->rw & WRITE) { + /* + * Read accounting is performed in submit_bio() + */ + task_io_account_write(len); + } + /* * Can we just grow the current page's presence in the dio? */