From a7081f033249c767976397ab7faf926d69123685 Mon Sep 17 00:00:00 2001 From: Erez Zadok Date: Mon, 11 Aug 2014 22:10:28 -0400 Subject: [PATCH] Unionfs: support direct-IO (DIO) operations Signed-off-by: Erez Zadok Signed-off-by: Mengyang Li --- fs/unionfs/mmap.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/unionfs/mmap.c b/fs/unionfs/mmap.c index 488a582d80e..7db21bfa90e 100644 --- a/fs/unionfs/mmap.c +++ b/fs/unionfs/mmap.c @@ -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, }; /* -- 2.34.1