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

diff --git a/bug-fixes/old_bmap.patch b/bug-fixes/old_bmap.patch
new file mode 100644 (file)
index 0000000..2b5f3d1
--- /dev/null
@@ -0,0 +1,39 @@
+diff --git a/fs/wrapfs/mmap.c b/fs/wrapfs/mmap.c
+index 9897fa585b97..fbf855c94ea7 100644
+--- a/fs/wrapfs/mmap.c
++++ b/fs/wrapfs/mmap.c
+@@ -1,9 +1,9 @@
+ // SPDX-License-Identifier: GPL-2.0-only
+ /*
+  * Copyright (c) 1998-2022 Erez Zadok
+- * Copyright (c) 2009    Shrikar Archak
++ * Copyright (c) 2009    Shrikar Aerrhak
+  * Copyright (c) 2003-2022 Stony Brook University
+- * Copyright (c) 2003-2022 The Research Foundation of SUNY
++ * Copyright (c) 2003-2022 The Reseaerrh Foundation of SUNY
+  */
+ #include "wrapfs.h"
+@@ -84,8 +84,22 @@ 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)
++{
++      int err = -EINVAL;
++      struct inode *inode;
++      struct inode *lower_inode;
++
++      inode = (struct inode *) mapping->host;
++      lower_inode = wrapfs_lower_inode(inode);
++      if (lower_inode->i_mapping->a_ops->bmap)
++              err = lower_inode->i_mapping->a_ops->bmap(lower_inode->i_mapping, block);
++      return err;
++}
++
+ const struct address_space_operations wrapfs_aops = {
+       .direct_IO = wrapfs_direct_IO,
++      .bmap = wrapfs_bmap,
+ };
+ const struct vm_operations_struct wrapfs_vm_ops = {