Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1980

kernel-2.6.18-238.el5.src.rpm

From: Jerome Marchand <jmarchan@redhat.com>
Date: Tue, 3 Mar 2009 17:27:32 +0100
Subject: [misc] IO accounting: account for direct-io
Message-id: 20090303162958.855282330@dhcp-0-152.brq.redhat.com
O-Subject: [RHEL5.4 Patch 10/12] IO accounting: account for direct-io.
Bugzilla: 461636
RH-Acked-by: Jeff Moyer <jmoyer@redhat.com>
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>

bz461636

Account for direct-io.

Patch is upstream:
commit 98c4d57decf97bf8ddfe948a3266aa56b38b1a51

diff --git a/fs/direct-io.c b/fs/direct-io.c
index da7a1d6..3402bbc 100644
--- a/fs/direct-io.c
+++ b/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>
@@ -669,6 +670,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?
 	 */