diff options
-rw-r--r-- | fs/fs-writeback.c | 17 | ||||
-rw-r--r-- | include/linux/writeback.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 49bc1b8e8f19..f6c2155e0026 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -1187,6 +1187,23 @@ void writeback_inodes_sb(struct super_block *sb) | |||
1187 | EXPORT_SYMBOL(writeback_inodes_sb); | 1187 | EXPORT_SYMBOL(writeback_inodes_sb); |
1188 | 1188 | ||
1189 | /** | 1189 | /** |
1190 | * writeback_inodes_sb_if_idle - start writeback if none underway | ||
1191 | * @sb: the superblock | ||
1192 | * | ||
1193 | * Invoke writeback_inodes_sb if no writeback is currently underway. | ||
1194 | * Returns 1 if writeback was started, 0 if not. | ||
1195 | */ | ||
1196 | int writeback_inodes_sb_if_idle(struct super_block *sb) | ||
1197 | { | ||
1198 | if (!writeback_in_progress(sb->s_bdi)) { | ||
1199 | writeback_inodes_sb(sb); | ||
1200 | return 1; | ||
1201 | } else | ||
1202 | return 0; | ||
1203 | } | ||
1204 | EXPORT_SYMBOL(writeback_inodes_sb_if_idle); | ||
1205 | |||
1206 | /** | ||
1190 | * sync_inodes_sb - sync sb inode pages | 1207 | * sync_inodes_sb - sync sb inode pages |
1191 | * @sb: the superblock | 1208 | * @sb: the superblock |
1192 | * | 1209 | * |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c18c008f4bbf..76e8903cd204 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -70,6 +70,7 @@ struct writeback_control { | |||
70 | struct bdi_writeback; | 70 | struct bdi_writeback; |
71 | int inode_wait(void *); | 71 | int inode_wait(void *); |
72 | void writeback_inodes_sb(struct super_block *); | 72 | void writeback_inodes_sb(struct super_block *); |
73 | int writeback_inodes_sb_if_idle(struct super_block *); | ||
73 | void sync_inodes_sb(struct super_block *); | 74 | void sync_inodes_sb(struct super_block *); |
74 | void writeback_inodes_wbc(struct writeback_control *wbc); | 75 | void writeback_inodes_wbc(struct writeback_control *wbc); |
75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 76 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |