Added new BMAP methods for 5.6(new_bmap.patch) and 5.2(old_bmap.patch)
authorMr. Ubuntu <ubuntu@dhcp186.fsl.cs.sunysb.edu>
Thu, 12 May 2022 21:54:12 +0000 (17:54 -0400)
committerMr. Ubuntu <ubuntu@dhcp186.fsl.cs.sunysb.edu>
Thu, 12 May 2022 21:54:12 +0000 (17:54 -0400)
bug-fixes/new_bmap.patch [new file with mode: 0644]

diff --git a/bug-fixes/new_bmap.patch b/bug-fixes/new_bmap.patch
new file mode 100644 (file)
index 0000000..f054320
--- /dev/null
@@ -0,0 +1,24 @@
+diff --git a/fs/wrapfs/mmap.c b/fs/wrapfs/mmap.c
+index 9897fa585b97..3eea96f41deb 100644
+--- a/fs/wrapfs/mmap.c
++++ b/fs/wrapfs/mmap.c
+@@ -84,8 +84,19 @@ static ssize_t wrapfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
+       return -EINVAL;
+ }
++static sector_t wrapfs_bmap(struct address_space *mapping, sector_t block)
++{
++      struct inode *lower_inode = wrapfs_lower_inode(mapping->host);
++      int ret = bmap(lower_inode, &block);
++
++      if (ret)
++              return 0;
++      return block;
++}
++
+ const struct address_space_operations wrapfs_aops = {
+       .direct_IO = wrapfs_direct_IO,
++      .bmap = wrapfs_bmap,
+ };
+ const struct vm_operations_struct wrapfs_vm_ops = {