Skip to contentSkip to conversation

io-accounting: direct-io

PATCH In review [email protected] 1 participant 1 message Dec 8, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 8/13 io-accounting: direct-io

From: Andrew Morton <[email protected]>

Account for direct-io.

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]>

---

 fs/direct-io.c |    8 ++++++++
 1 file changed, 8 insertions(+)
fs/direct-io.c renamed from fs/direct-io.c~io-accounting-direct-io +8 -0
diff -puN fs/direct-io.c~io-accounting-direct-io fs/direct-io.c
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/highmem.h>
 #include <linux/pagemap.h>
+#include <linux/task_io_accounting_ops.h>
 #include <linux/bio.h>
 #include <linux/wait.h>
 #include <linux/err.h>
@@ -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?
 	 */

_