diff options
author | Curt Wohlgemuth <curtw@google.com> | 2011-10-07 23:51:56 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2012-09-28 15:37:52 -0400 |
commit | 715cff686907bc87a7dadcc944f77746b1786ce8 (patch) | |
tree | 5aecdb70ad06292820c51db87f61f51cfa52a3b4 /fs | |
parent | 1b558eeb0e7fc606eea4ca4004c0891d331a99f6 (diff) |
writeback: send work item to queue_io, move_expired_inodes
Instead of sending ->older_than_this to queue_io() and
move_expired_inodes(), send the entire wb_writeback_work
structure. There are other fields of a work item that are
useful in these routines and in tracepoints.
Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Christopher Kenna <cjk@cs.unc.edu>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs-writeback.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 1d9ebbbd343..73c3992b2bb 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -265,7 +265,7 @@ static bool inode_dirtied_after(struct inode *inode, unsigned long t) | |||
265 | */ | 265 | */ |
266 | static int move_expired_inodes(struct list_head *delaying_queue, | 266 | static int move_expired_inodes(struct list_head *delaying_queue, |
267 | struct list_head *dispatch_queue, | 267 | struct list_head *dispatch_queue, |
268 | unsigned long *older_than_this) | 268 | struct wb_writeback_work *work) |
269 | { | 269 | { |
270 | LIST_HEAD(tmp); | 270 | LIST_HEAD(tmp); |
271 | struct list_head *pos, *node; | 271 | struct list_head *pos, *node; |
@@ -276,8 +276,8 @@ static int move_expired_inodes(struct list_head *delaying_queue, | |||
276 | 276 | ||
277 | while (!list_empty(delaying_queue)) { | 277 | while (!list_empty(delaying_queue)) { |
278 | inode = wb_inode(delaying_queue->prev); | 278 | inode = wb_inode(delaying_queue->prev); |
279 | if (older_than_this && | 279 | if (work->older_than_this && |
280 | inode_dirtied_after(inode, *older_than_this)) | 280 | inode_dirtied_after(inode, *work->older_than_this)) |
281 | break; | 281 | break; |
282 | if (sb && sb != inode->i_sb) | 282 | if (sb && sb != inode->i_sb) |
283 | do_sb_sort = 1; | 283 | do_sb_sort = 1; |
@@ -316,13 +316,13 @@ out: | |||
316 | * | | 316 | * | |
317 | * +--> dequeue for IO | 317 | * +--> dequeue for IO |
318 | */ | 318 | */ |
319 | static void queue_io(struct bdi_writeback *wb, unsigned long *older_than_this) | 319 | static void queue_io(struct bdi_writeback *wb, struct wb_writeback_work *work) |
320 | { | 320 | { |
321 | int moved; | 321 | int moved; |
322 | assert_spin_locked(&wb->list_lock); | 322 | assert_spin_locked(&wb->list_lock); |
323 | list_splice_init(&wb->b_more_io, &wb->b_io); | 323 | list_splice_init(&wb->b_more_io, &wb->b_io); |
324 | moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, older_than_this); | 324 | moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, work); |
325 | trace_writeback_queue_io(wb, older_than_this, moved); | 325 | trace_writeback_queue_io(wb, work, moved); |
326 | } | 326 | } |
327 | 327 | ||
328 | static int write_inode(struct inode *inode, struct writeback_control *wbc) | 328 | static int write_inode(struct inode *inode, struct writeback_control *wbc) |
@@ -667,7 +667,7 @@ long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages, | |||
667 | 667 | ||
668 | spin_lock(&wb->list_lock); | 668 | spin_lock(&wb->list_lock); |
669 | if (list_empty(&wb->b_io)) | 669 | if (list_empty(&wb->b_io)) |
670 | queue_io(wb, NULL); | 670 | queue_io(wb, &work); |
671 | __writeback_inodes_wb(wb, &work); | 671 | __writeback_inodes_wb(wb, &work); |
672 | spin_unlock(&wb->list_lock); | 672 | spin_unlock(&wb->list_lock); |
673 | 673 | ||
@@ -761,7 +761,7 @@ static long wb_writeback(struct bdi_writeback *wb, | |||
761 | 761 | ||
762 | trace_writeback_start(wb->bdi, work); | 762 | trace_writeback_start(wb->bdi, work); |
763 | if (list_empty(&wb->b_io)) | 763 | if (list_empty(&wb->b_io)) |
764 | queue_io(wb, work->older_than_this); | 764 | queue_io(wb, work); |
765 | if (work->sb) | 765 | if (work->sb) |
766 | progress = writeback_sb_inodes(work->sb, wb, work); | 766 | progress = writeback_sb_inodes(work->sb, wb, work); |
767 | else | 767 | else |