From d3c0bab5632337f6d3841fbe0dc238a743cb4472 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Thu, 22 Jun 2017 03:35:28 +0200 Subject: [PATCH] btrfs: remove trivial wrapper btrfs_force_ra It's a simple call page_cache_sync_readahead, same arguments in the same order. Signed-off-by: David Sterba --- fs/btrfs/ctree.h | 8 -------- fs/btrfs/ioctl.c | 4 ++-- fs/btrfs/send.c | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 95a50b88c31e..b9d5d95bc583 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3136,14 +3136,6 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, u64 *orig_start, u64 *orig_block_len, u64 *ram_bytes); -/* This forces readahead on a given range of bytes in an inode */ -static inline void btrfs_force_ra(struct address_space *mapping, - struct file_ra_state *ra, struct file *file, - pgoff_t offset, unsigned long req_size) -{ - page_cache_sync_readahead(mapping, ra, file, offset, req_size); -} - struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry); int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index); int btrfs_unlink_inode(struct btrfs_trans_handle *trans, diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 7d144a676d95..8189cb328d4a 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -1364,8 +1364,8 @@ int btrfs_defrag_file(struct inode *inode, struct file *file, if (i + cluster > ra_index) { ra_index = max(i, ra_index); if (ra) - btrfs_force_ra(inode->i_mapping, ra, file, - ra_index, cluster); + page_cache_sync_readahead(inode->i_mapping, ra, + file, ra_index, cluster); ra_index += cluster; } diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index b082210df9c8..59fb1ed6ca20 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -4733,7 +4733,7 @@ static ssize_t fill_read_buf(struct send_ctx *sctx, u64 offset, u32 len) /* initial readahead */ memset(&sctx->ra, 0, sizeof(struct file_ra_state)); file_ra_state_init(&sctx->ra, inode->i_mapping); - btrfs_force_ra(inode->i_mapping, &sctx->ra, NULL, index, + page_cache_sync_readahead(inode->i_mapping, &sctx->ra, NULL, index, last_index - index + 1); while (index <= last_index) {