diff options
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r-- | fs/bcachefs/fs.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c index 958849c30071..f1849eb8327d 100644 --- a/fs/bcachefs/fs.c +++ b/fs/bcachefs/fs.c @@ -1521,6 +1521,7 @@ static const struct vm_operations_struct bch_vm_ops = { .page_mkwrite = bch2_page_mkwrite, }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) static int bch2_mmap_prepare(struct vm_area_desc *desc) { file_accessed(desc->file); @@ -1528,6 +1529,15 @@ static int bch2_mmap_prepare(struct vm_area_desc *desc) desc->vm_ops = &bch_vm_ops; return 0; } +#else +static int bch2_mmap(struct file *file, struct vm_area_struct *vma) +{ + file_accessed(file); + + vma->vm_ops = &bch_vm_ops; + return 0; +} +#endif /* Directories: */ @@ -1719,7 +1729,11 @@ static const struct file_operations bch_file_operations = { .llseek = bch2_llseek, .read_iter = bch2_read_iter, .write_iter = bch2_write_iter, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,17,0) .mmap_prepare = bch2_mmap_prepare, +#else + .mmap = bch2_mmap, +#endif .get_unmapped_area = thp_get_unmapped_area, .fsync = bch2_fsync, .splice_read = filemap_splice_read, |