summaryrefslogtreecommitdiff
path: root/fs/sdcardfs
diff options
context:
space:
mode:
authorDaniel Rosenberg <drosen@google.com>2017-02-24 15:49:45 -0800
committerAmit Pundir <amit.pundir@linaro.org>2017-04-10 13:12:16 +0530
commitba832b0760889ce6434f9895789ffcda3d5da6e6 (patch)
tree4b8ceebf28531db7bf3f43f545edaf2e3a119ce4 /fs/sdcardfs
parentb20531a034b622854ff2ce5feef5c617b1d21bc6 (diff)
ANDROID: sdcardfs: support direct-IO (DIO) operations
This comes from the wrapfs patch 2e346c83b26e Wrapfs: support direct-IO (DIO) operations Signed-off-by: Li Mengyang <li.mengyang@stonybrook.edu> Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu> Signed-off-by: Daniel Rosenberg <drosen@google.com> Bug: 34133558 Change-Id: I3fd779c510ab70d56b1d918f99c20421b524cdc4
Diffstat (limited to 'fs/sdcardfs')
-rw-r--r--fs/sdcardfs/mmap.c21
-rw-r--r--fs/sdcardfs/sdcardfs.h1
2 files changed, 5 insertions, 17 deletions
diff --git a/fs/sdcardfs/mmap.c b/fs/sdcardfs/mmap.c
index 7dd715875ef1..0d4089c62c3a 100644
--- a/fs/sdcardfs/mmap.c
+++ b/fs/sdcardfs/mmap.c
@@ -85,27 +85,14 @@ static ssize_t sdcardfs_direct_IO(struct kiocb *iocb,
struct iov_iter *iter, loff_t pos)
{
/*
- * This function returns zero on purpose in order to support direct IO.
- * __dentry_open checks a_ops->direct_IO and returns EINVAL if it is null.
- *
- * However, this function won't be called by certain file operations
- * including generic fs functions. * reads and writes are delivered to
- * the lower file systems and the direct IOs will be handled by them.
- *
- * NOTE: exceptionally, on the recent kernels (since Linux 3.8.x),
- * swap_writepage invokes this function directly.
+ * 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().
*/
- printk(KERN_INFO "%s, operation is not supported\n", __func__);
- return 0;
+ return -EINVAL;
}
-/*
- * XXX: the default address_space_ops for sdcardfs 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.
- */
const struct address_space_operations sdcardfs_aops = {
- /* empty on purpose */
.direct_IO = sdcardfs_direct_IO,
};
diff --git a/fs/sdcardfs/sdcardfs.h b/fs/sdcardfs/sdcardfs.h
index f3cced313108..042f989f0bea 100644
--- a/fs/sdcardfs/sdcardfs.h
+++ b/fs/sdcardfs/sdcardfs.h
@@ -29,6 +29,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>