summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-06-30 16:35:37 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2020-09-10 13:13:10 -0400
commit7d679fb274b1a05bf06894c681e7ab6393f4742f (patch)
treeac638e355beb2326e4fb4192b3f02cf6a3ce514e /fs/bcachefs/fs.c
parent4e21b048c317fac4ca43eb7cdcf8918f84dec12a (diff)
bcachefs: Fixes for 4.19
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r--fs/bcachefs/fs.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index e504e6b19abe..071c3a3de98d 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -861,10 +861,6 @@ static int bch2_fiemap(struct inode *vinode, struct fiemap_extent_info *info,
bool have_extent = false;
int ret = 0;
- ret = fiemap_prep(&ei->v, info, start, &len, FIEMAP_FLAG_SYNC);
- if (ret)
- return ret;
-
if (start + len < start)
return -EINVAL;
@@ -971,6 +967,15 @@ static int bch2_vfs_readdir(struct file *file, struct dir_context *ctx)
return bch2_readdir(c, inode->v.i_ino, ctx);
}
+static int bch2_clone_file_range(struct file *file_src, loff_t pos_src,
+ struct file *file_dst, loff_t pos_dst,
+ u64 len)
+{
+ return bch2_remap_file_range(file_src, pos_src,
+ file_dst, pos_dst,
+ len, 0);
+}
+
static const struct file_operations bch_file_operations = {
.llseek = bch2_llseek,
.read_iter = bch2_read_iter,
@@ -988,7 +993,7 @@ static const struct file_operations bch_file_operations = {
#ifdef CONFIG_COMPAT
.compat_ioctl = bch2_compat_fs_ioctl,
#endif
- .remap_file_range = bch2_remap_file_range,
+ .clone_file_range = bch2_clone_file_range,
};
static const struct inode_operations bch_file_inode_operations = {
@@ -1537,7 +1542,7 @@ static struct dentry *bch2_mount(struct file_system_type *fs_type,
sb->s_bdi->congested_fn = bch2_congested;
sb->s_bdi->congested_data = c;
- sb->s_bdi->ra_pages = VM_READAHEAD_PAGES;
+ sb->s_bdi->ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_SIZE;
for_each_online_member(ca, c, i) {
struct block_device *bdev = ca->disk_sb.bdev;