From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933714Ab0HEQa6 (ORCPT ); Thu, 5 Aug 2010 12:30:58 -0400 Received: from mga03.intel.com ([143.182.124.21]:19701 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760631Ab0HEQ3W (ORCPT ); Thu, 5 Aug 2010 12:29:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.55,323,1278313200"; d="scan'208";a="308628154" Message-Id: <20100805162433.807859106@intel.com> User-Agent: quilt/0.48-1 Date: Fri, 06 Aug 2010 00:10:59 +0800 From: Wu Fengguang To: Andrew Morton Cc: Wu Fengguang , LKML , Jan Kara , Mel Gorman CC: Dave Chinner , Christoph Hellwig , Chris Mason , Jens Axboe , Peter Zijlstra , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" Subject: [PATCH 08/13] writeback: pass writeback_control down to move_expired_inodes() References: <20100805161051.501816677@intel.com> Content-Disposition: inline; filename=writeback-pass-wbc-to-queue_io.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is to prepare for moving the dirty expire policy to move_expired_inodes(). No behavior change. Acked-by: Jan Kara Acked-by: Mel Gorman Signed-off-by: Wu Fengguang --- fs/fs-writeback.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- linux-next.orig/fs/fs-writeback.c 2010-08-05 23:28:18.000000000 +0800 +++ linux-next/fs/fs-writeback.c 2010-08-05 23:28:19.000000000 +0800 @@ -213,8 +213,8 @@ static bool inode_dirtied_after(struct i * Move expired dirty inodes from @delaying_queue to @dispatch_queue. */ static void move_expired_inodes(struct list_head *delaying_queue, - struct list_head *dispatch_queue, - unsigned long *older_than_this) + struct list_head *dispatch_queue, + struct writeback_control *wbc) { LIST_HEAD(tmp); struct list_head *pos, *node; @@ -224,8 +224,8 @@ static void move_expired_inodes(struct l while (!list_empty(delaying_queue)) { inode = list_entry(delaying_queue->prev, struct inode, i_list); - if (older_than_this && - inode_dirtied_after(inode, *older_than_this)) + if (wbc->older_than_this && + inode_dirtied_after(inode, *wbc->older_than_this)) break; if (sb && sb != inode->i_sb) do_sb_sort = 1; @@ -262,10 +262,10 @@ static void move_expired_inodes(struct l * | * +--> dequeue for IO */ -static void queue_io(struct bdi_writeback *wb, unsigned long *older_than_this) +static void queue_io(struct bdi_writeback *wb, struct writeback_control *wbc) { list_splice_init(&wb->b_more_io, &wb->b_io); - move_expired_inodes(&wb->b_dirty, &wb->b_io, older_than_this); + move_expired_inodes(&wb->b_dirty, &wb->b_io, wbc); } static int write_inode(struct inode *inode, struct writeback_control *wbc) @@ -528,7 +528,7 @@ void writeback_inodes_wb(struct bdi_writ wbc->wb_start = jiffies; /* livelock avoidance */ spin_lock(&inode_lock); if (!wbc->for_kupdate || list_empty(&wb->b_io)) - queue_io(wb, wbc->older_than_this); + queue_io(wb, wbc); while (!list_empty(&wb->b_io)) { struct inode *inode = list_entry(wb->b_io.prev, @@ -557,7 +557,7 @@ static void __writeback_inodes_sb(struct wbc->wb_start = jiffies; /* livelock avoidance */ spin_lock(&inode_lock); if (!wbc->for_kupdate || list_empty(&wb->b_io)) - queue_io(wb, wbc->older_than_this); + queue_io(wb, wbc); writeback_sb_inodes(sb, wb, wbc, true); spin_unlock(&inode_lock); }