diff options
author | Curt Wohlgemuth <curtw@google.com> | 2011-10-07 23:51:56 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-10-30 12:33:27 -0400 |
commit | ad4e38dd6a33bb3a4882c487d7abe621e583b982 (patch) | |
tree | 5b78b8929ade5372b2e24d4c1793f8cb39962146 /fs/fs-writeback.c | |
parent | ece13ac31bbe492d940ba0bc4ade2ae1521f46a5 (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>
Diffstat (limited to 'fs/fs-writeback.c')
-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 6401cd76f109..c51029693600 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -251,7 +251,7 @@ static bool inode_dirtied_after(struct inode *inode, unsigned long t) | |||
251 | */ | 251 | */ |
252 | static int move_expired_inodes(struct list_head *delaying_queue, | 252 | static int move_expired_inodes(struct list_head *delaying_queue, |
253 | struct list_head *dispatch_queue, | 253 | struct list_head *dispatch_queue, |
254 | unsigned long *older_than_this) | 254 | struct wb_writeback_work *work) |
255 | { | 255 | { |
256 | LIST_HEAD(tmp); | 256 | LIST_HEAD(tmp); |
257 | struct list_head *pos, *node; | 257 | struct list_head *pos, *node; |
@@ -262,8 +262,8 @@ static int move_expired_inodes(struct list_head *delaying_queue, | |||
262 | 262 | ||
263 | while (!list_empty(delaying_queue)) { | 263 | while (!list_empty(delaying_queue)) { |
264 | inode = wb_inode(delaying_queue->prev); | 264 | inode = wb_inode(delaying_queue->prev); |
265 | if (older_than_this && | 265 | if (work->older_than_this && |
266 | inode_dirtied_after(inode, *older_than_this)) | 266 | inode_dirtied_after(inode, *work->older_than_this)) |
267 | break; | 267 | break; |
268 | if (sb && sb != inode->i_sb) | 268 | if (sb && sb != inode->i_sb) |
269 | do_sb_sort = 1; | 269 | do_sb_sort = 1; |
@@ -302,13 +302,13 @@ out: | |||
302 | * | | 302 | * | |
303 | * +--> dequeue for IO | 303 | * +--> dequeue for IO |
304 | */ | 304 | */ |
305 | static void queue_io(struct bdi_writeback *wb, unsigned long *older_than_this) | 305 | static void queue_io(struct bdi_writeback *wb, struct wb_writeback_work *work) |
306 | { | 306 | { |
307 | int moved; | 307 | int moved; |
308 | assert_spin_locked(&wb->list_lock); | 308 | assert_spin_locked(&wb->list_lock); |
309 | list_splice_init(&wb->b_more_io, &wb->b_io); | 309 | list_splice_init(&wb->b_more_io, &wb->b_io); |
310 | moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, older_than_this); | 310 | moved = move_expired_inodes(&wb->b_dirty, &wb->b_io, work); |
311 | trace_writeback_queue_io(wb, older_than_this, moved); | 311 | trace_writeback_queue_io(wb, work, moved); |
312 | } | 312 | } |
313 | 313 | ||
314 | static int write_inode(struct inode *inode, struct writeback_control *wbc) | 314 | static int write_inode(struct inode *inode, struct writeback_control *wbc) |
@@ -651,7 +651,7 @@ long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages) | |||
651 | 651 | ||
652 | spin_lock(&wb->list_lock); | 652 | spin_lock(&wb->list_lock); |
653 | if (list_empty(&wb->b_io)) | 653 | if (list_empty(&wb->b_io)) |
654 | queue_io(wb, NULL); | 654 | queue_io(wb, &work); |
655 | __writeback_inodes_wb(wb, &work); | 655 | __writeback_inodes_wb(wb, &work); |
656 | spin_unlock(&wb->list_lock); | 656 | spin_unlock(&wb->list_lock); |
657 | 657 | ||
@@ -745,7 +745,7 @@ static long wb_writeback(struct bdi_writeback *wb, | |||
745 | 745 | ||
746 | trace_writeback_start(wb->bdi, work); | 746 | trace_writeback_start(wb->bdi, work); |
747 | if (list_empty(&wb->b_io)) | 747 | if (list_empty(&wb->b_io)) |
748 | queue_io(wb, work->older_than_this); | 748 | queue_io(wb, work); |
749 | if (work->sb) | 749 | if (work->sb) |
750 | progress = writeback_sb_inodes(work->sb, wb, work); | 750 | progress = writeback_sb_inodes(work->sb, wb, work); |
751 | else | 751 | else |