From: Andrew Morton Account for direct-io. Cc: Jay Lan Cc: Shailabh Nagar Cc: Balbir Singh Cc: Chris Sturtivant Cc: Tony Ernst Cc: Guillaume Thouvenin Signed-off-by: Andrew Morton --- fs/direct-io.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff -puN fs/direct-io.c~io-accounting-direct-io fs/direct-io.c --- a/fs/direct-io.c~io-accounting-direct-io +++ a/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, str { 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? */ _