Commit 8264c321 authored by Rakesh Pandit's avatar Rakesh Pandit Committed by Jens Axboe

writeback: merge try_to_writeback_inodes_sb_nr() into caller

Since commit 925a6efb ("Btrfs: stop using
try_to_writeback_inodes_sb_nr to flush delalloc") this function hasn't
been used outside so stop exporting it.

In addition we merge it into try_to_writeback_inodes_sb() which is the
only caller.  Also change return type of try_to_writeback_inodes_sb to
void as the only user ext4 doesn't care.
Reviewed-by: default avatarJan Kara <jack@suse.cz>
Signed-off-by: default avatarRakesh Pandit <rakesh@tuxera.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 99fead8d
...@@ -2376,37 +2376,19 @@ void writeback_inodes_sb(struct super_block *sb, enum wb_reason reason) ...@@ -2376,37 +2376,19 @@ void writeback_inodes_sb(struct super_block *sb, enum wb_reason reason)
EXPORT_SYMBOL(writeback_inodes_sb); EXPORT_SYMBOL(writeback_inodes_sb);
/** /**
* try_to_writeback_inodes_sb_nr - try to start writeback if none underway * try_to_writeback_inodes_sb - try to start writeback if none underway
* @sb: the superblock * @sb: the superblock
* @nr: the number of pages to write * @reason: reason why some writeback work was initiated
* @reason: the reason of writeback
* *
* Invoke writeback_inodes_sb_nr if no writeback is currently underway. * Invoke __writeback_inodes_sb_nr if no writeback is currently underway.
* Returns 1 if writeback was started, 0 if not.
*/ */
bool try_to_writeback_inodes_sb_nr(struct super_block *sb, unsigned long nr, void try_to_writeback_inodes_sb(struct super_block *sb, enum wb_reason reason)
enum wb_reason reason)
{ {
if (!down_read_trylock(&sb->s_umount)) if (!down_read_trylock(&sb->s_umount))
return false; return;
__writeback_inodes_sb_nr(sb, nr, reason, true); __writeback_inodes_sb_nr(sb, get_nr_dirty_pages(), reason, true);
up_read(&sb->s_umount); up_read(&sb->s_umount);
return true;
}
EXPORT_SYMBOL(try_to_writeback_inodes_sb_nr);
/**
* try_to_writeback_inodes_sb - try to start writeback if none underway
* @sb: the superblock
* @reason: reason why some writeback work was initiated
*
* Implement by try_to_writeback_inodes_sb_nr()
* Returns 1 if writeback was started, 0 if not.
*/
bool try_to_writeback_inodes_sb(struct super_block *sb, enum wb_reason reason)
{
return try_to_writeback_inodes_sb_nr(sb, get_nr_dirty_pages(), reason);
} }
EXPORT_SYMBOL(try_to_writeback_inodes_sb); EXPORT_SYMBOL(try_to_writeback_inodes_sb);
......
...@@ -163,9 +163,7 @@ struct bdi_writeback; ...@@ -163,9 +163,7 @@ struct bdi_writeback;
void writeback_inodes_sb(struct super_block *, enum wb_reason reason); void writeback_inodes_sb(struct super_block *, enum wb_reason reason);
void writeback_inodes_sb_nr(struct super_block *, unsigned long nr, void writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
enum wb_reason reason); enum wb_reason reason);
bool try_to_writeback_inodes_sb(struct super_block *, enum wb_reason reason); void try_to_writeback_inodes_sb(struct super_block *sb, enum wb_reason reason);
bool try_to_writeback_inodes_sb_nr(struct super_block *, unsigned long nr,
enum wb_reason reason);
void sync_inodes_sb(struct super_block *); void sync_inodes_sb(struct super_block *);
void wakeup_flusher_threads(enum wb_reason reason); void wakeup_flusher_threads(enum wb_reason reason);
void wakeup_flusher_threads_bdi(struct backing_dev_info *bdi, void wakeup_flusher_threads_bdi(struct backing_dev_info *bdi,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment