Wrapfs: support direct-IO (DIO) operations
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 20 Jun 2014 23:39:40 +0000 (19:39 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 3 Apr 2016 19:23:33 +0000 (15:23 -0400)
Signed-off-by: Li Mengyang <li.mengyang@stonybrook.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/wrapfs/mmap.c
fs/wrapfs/wrapfs.h

index dc0bd27935c8514e7e2d6b83338215d41debfac4..3305108ce7096cee57dbbead212e89e809f61c9b 100644 (file)
@@ -72,13 +72,19 @@ out:
        return err;
 }
 
-/*
- * XXX: the default address_space_ops for wrapfs is empty.  We cannot set
- * our inode->i_mapping->a_ops to NULL because too many code paths expect
- * the a_ops vector to be non-NULL.
- */
+static ssize_t wrapfs_direct_IO(int rw, struct kiocb *iocb,
+                               struct iov_iter *iov, loff_t offset)
+{
+       /*
+        * This function should never be called directly.  We need it
+        * to exist, to get past a check in open_check_o_direct(),
+        * which is called from do_last().
+        */
+       return -EINVAL;
+}
+
 const struct address_space_operations wrapfs_aops = {
-       /* empty on purpose */
+       .direct_IO = wrapfs_direct_IO,
 };
 
 const struct vm_operations_struct wrapfs_vm_ops = {
index 24928834a5637a73ca753f54564319f4ab5f0602..6520c0f32d7a55edc8fcc788014c1c9cc14a989a 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/dcache.h>
 #include <linux/file.h>
 #include <linux/fs.h>
+#include <linux/aio.h>
 #include <linux/mm.h>
 #include <linux/mount.h>
 #include <linux/namei.h>