writeback: make writeback_in_progress() take bdi_writeback instead of backing_dev_info
authorTejun Heo <tj@kernel.org>
Fri, 22 May 2015 21:13:53 +0000 (17:13 -0400)
committerJens Axboe <axboe@fb.com>
Tue, 2 Jun 2015 14:33:36 +0000 (08:33 -0600)
writeback_in_progress() currently takes @bdi and returns whether
writeback is in progress on its root wb (bdi_writeback).  In
preparation for cgroup writeback support, make it take wb instead.
While at it, make it an inline function.

This patch doesn't make any functional difference.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/fs-writeback.c
include/linux/backing-dev.h
mm/page-writeback.c

index 79f11af67357bf7a1c0d30129ebf8d287f55a2fa..45baf6c89b99396052d7426af0e08c6fe60ccf88 100644 (file)
@@ -65,19 +65,6 @@ struct wb_writeback_work {
  */
 unsigned int dirtytime_expire_interval = 12 * 60 * 60;
 
-/**
- * writeback_in_progress - determine whether there is writeback in progress
- * @bdi: the device's backing_dev_info structure.
- *
- * Determine whether there is writeback waiting to be handled against a
- * backing device.
- */
-int writeback_in_progress(struct backing_dev_info *bdi)
-{
-       return test_bit(WB_writeback_running, &bdi->wb.state);
-}
-EXPORT_SYMBOL(writeback_in_progress);
-
 static inline struct inode *wb_inode(struct list_head *head)
 {
        return list_entry(head, struct inode, i_wb_list);
@@ -1532,7 +1519,7 @@ int try_to_writeback_inodes_sb_nr(struct super_block *sb,
                                  unsigned long nr,
                                  enum wb_reason reason)
 {
-       if (writeback_in_progress(sb->s_bdi))
+       if (writeback_in_progress(&sb->s_bdi->wb))
                return 1;
 
        if (!down_read_trylock(&sb->s_umount))
index 0ff40c228bee98c974fe46b6fdb089eeae05e6a2..f04956c900ec05400fea8f23d12fefc40d721766 100644 (file)
@@ -156,7 +156,17 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
 
 extern struct backing_dev_info noop_backing_dev_info;
 
-int writeback_in_progress(struct backing_dev_info *bdi);
+/**
+ * writeback_in_progress - determine whether there is writeback in progress
+ * @wb: bdi_writeback of interest
+ *
+ * Determine whether there is writeback waiting to be handled against a
+ * bdi_writeback.
+ */
+static inline bool writeback_in_progress(struct bdi_writeback *wb)
+{
+       return test_bit(WB_writeback_running, &wb->state);
+}
 
 static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
 {
index 682e3a6a8b2eca9e70d9c418c82ee9a268c0b864..e3b5c1dddf1dd3b0ac7dd000d91498da1ed4506b 100644 (file)
@@ -1455,7 +1455,7 @@ static void balance_dirty_pages(struct address_space *mapping,
                        break;
                }
 
-               if (unlikely(!writeback_in_progress(bdi)))
+               if (unlikely(!writeback_in_progress(wb)))
                        bdi_start_background_writeback(bdi);
 
                if (!strictlimit)
@@ -1573,7 +1573,7 @@ pause:
        if (!dirty_exceeded && wb->dirty_exceeded)
                wb->dirty_exceeded = 0;
 
-       if (writeback_in_progress(bdi))
+       if (writeback_in_progress(wb))
                return;
 
        /*