summaryrefslogtreecommitdiff
path: root/libbcachefs/fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2025-09-18 23:57:54 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2025-09-18 23:58:13 -0400
commit89d66942017582c07dcd8ecfc5e5ae32a5c20c57 (patch)
tree0221b19d77635c8cd643965264e68571b0f4c747 /libbcachefs/fs.c
parent9688e2e45543440183c10a83ae2b1ff4adba709b (diff)
Update bcachefs sources to 0c67e96b7201 bcachefs: vendor closures
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/fs.c')
-rw-r--r--libbcachefs/fs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libbcachefs/fs.c b/libbcachefs/fs.c
index 958849c3..f1849eb8 100644
--- a/libbcachefs/fs.c
+++ b/libbcachefs/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,