Wrapfs: support direct-IO (DIO) operations
authorErez Zadok <ezk@cs.sunysb.edu>
Sat, 21 Jun 2014 00:28:12 +0000 (20:28 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 27 Dec 2016 03:11:38 +0000 (22:11 -0500)
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..6000e33f660c2c7d342e8019bc4d45efacece267 100644 (file)
@@ -72,13 +72,20 @@ 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,
+                               const struct iovec *iov, loff_t offset,
+                               unsigned long nr_segs)
+{
+       /*
+        * 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 f45a9825d0668efe3c97d6ede6509316eef75f14..9aa387cb8d8a8ff15a75a2f29543b15d5b186f10 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>