summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-08-22 22:59:27 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-22 22:59:27 -0700
commitf07812ca2925f6dc6027883ab15891781dba4827 (patch)
treee12f1eb2d11cb984b9f9c71801e1b0b75cd812bf /include/linux
parentd4f9d02b9151b9ff87a950ed42220de4f740d27b (diff)
[PATCH] Writeback page range hint
Modify mpage_writepages to optionally only write back dirty pages within a specified range in a file (as in the case of O_SYNC). Cheat a little to avoid changes to prototypes of aops - just put the <start, end> hint into the writeback_control struct instead. If <start, end> are not set, then default to writing back all the mapping's dirty pages. Signed-off-by: Suparna Bhattacharya <suparna@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/writeback.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index e4450070ac78..48d95e59230b 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -29,7 +29,9 @@ enum writeback_sync_modes {
};
/*
- * A control structure which tells the writeback code what to do
+ * A control structure which tells the writeback code what to do. These are
+ * always on the stack, and hence need no locking. They are always initialised
+ * in a manner such that unspecified fields are set to zero.
*/
struct writeback_control {
struct backing_dev_info *bdi; /* If !NULL, only write back this
@@ -40,10 +42,19 @@ struct writeback_control {
long nr_to_write; /* Write this many pages, and decrement
this for each page written */
long pages_skipped; /* Pages which were not written */
- int nonblocking; /* Don't get stuck on request queues */
- int encountered_congestion; /* An output: a queue is full */
- int for_kupdate; /* A kupdate writeback */
- int for_reclaim; /* Invoked from the page allocator */
+
+ /*
+ * For a_ops->writepages(): is start or end are non-zero then this is
+ * a hint that the filesystem need only write out the pages inside that
+ * byterange. The byte at `end' is included in the writeout request.
+ */
+ loff_t start;
+ loff_t end;
+
+ int nonblocking:1; /* Don't get stuck on request queues */
+ int encountered_congestion:1; /* An output: a queue is full */
+ int for_kupdate:1; /* A kupdate writeback */
+ int for_reclaim:1; /* Invoked from the page allocator */
};
/*