[PATCH 02/14] writeback: Remove writeback_inodes_wb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



writeback_inodes_wb() has only single user and that is emergency
writeback when we cannot create a worker thread for writeback work. So
inline the function directly into the caller and call wb_writeback()
instead of writeback_inodes() since that is what all other places are
calling when they want some work to be done. This will reduce code
duplication when we transition do per-sb writeback.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
 fs/fs-writeback.c | 29 ++++++++---------------------
 1 file changed, 8 insertions(+), 21 deletions(-)

diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index f85ee6795a28..d631ddaa642b 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -674,25 +674,6 @@ static long writeback_inodes(struct bdi_writeback *wb,
 	return wrote;
 }
 
-static long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages,
-				enum wb_reason reason)
-{
-	struct wb_writeback_work work = {
-		.nr_pages	= nr_pages,
-		.sync_mode	= WB_SYNC_NONE,
-		.range_cyclic	= 1,
-		.reason		= reason,
-	};
-
-	spin_lock(&wb->list_lock);
-	if (list_empty(&wb->b_io))
-		queue_io(wb, &work);
-	writeback_inodes(wb, &work);
-	spin_unlock(&wb->list_lock);
-
-	return nr_pages - work.nr_pages;
-}
-
 static bool over_bground_thresh(struct backing_dev_info *bdi)
 {
 	unsigned long background_thresh, dirty_thresh;
@@ -976,8 +957,14 @@ void bdi_writeback_workfn(struct work_struct *work)
 		 * the emergency worker.  Don't hog it.  Hopefully, 1024 is
 		 * enough for efficient IO.
 		 */
-		pages_written = writeback_inodes_wb(&bdi->wb, 1024,
-						    WB_REASON_FORKER_THREAD);
+		struct wb_writeback_work work = {
+			.nr_pages	= 1024,
+			.sync_mode	= WB_SYNC_NONE,
+			.range_cyclic	= 1,
+			.reason		= WB_REASON_FORKER_THREAD,
+		};
+
+		pages_written = wb_writeback(wb, &work);
 		trace_writeback_pages_written(pages_written);
 	}
 
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux