Unionfs: support direct-IO (DIO) operations
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 12 Aug 2014 02:24:57 +0000 (22:24 -0400)
committerErez Zadok <ezk@cs.sunysb.edu>
Tue, 12 Aug 2014 02:24:57 +0000 (22:24 -0400)
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
Signed-off-by: Mengyang Li <li.mengyang@stonybrook.edu>
fs/unionfs/mmap.c

index afcd3598611d57c4c17898cdb91ff6613cdd2fb4..94d234aeb3d5b117d52987593268308010489adf 100644 (file)
@@ -101,12 +101,18 @@ out:
 }
 
 /*
- * XXX: the default address_space_ops for unionfs 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.
+ * This function should never be called directly.
+ * It's here only for the check a_ops->direct_IO during vfs_open.
  */
+static ssize_t unionfs_direct_IO(int rw, struct kiocb *iocb,
+                                const struct iovec *iov, loff_t offset,
+                                unsigned long nr_segs)
+{
+       return -EINVAL;
+}
+
 struct address_space_operations unionfs_aops = {
-       /* empty on purpose */
+       .direct_IO      = unionfs_direct_IO,
 };
 
 /*