diff mbox

Orangefs: pseudo-support O_DIRECT, or, O_DIRECT as a hint.

Message ID 1464273094-31862-1-git-send-email-hubcap@logtruck.clemson.edu (mailing list archive)
State New, archived
Headers show

Commit Message

Mike Marshall May 26, 2016, 2:31 p.m. UTC
From: Mike Marshall <hubcap@omnibond.com>

Allow userspace applications to use O_DIRECT in open without failing
on EINVAL.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
---

There was a thread about making O_DIRECT a hint a few weeks ago -
always allow it, and just let the file system deal with it however
it wants. I know that would make some OrangeFS users happy, so in the
mean time, here is a patch that will make OrangeFS allow O_DIRECT, if
y'all think it looks OK, I'd like to try to get it pulled...

 fs/orangefs/inode.c | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)
diff mbox

Patch

diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 85640e9..df53830 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -124,19 +124,17 @@  static int orangefs_releasepage(struct page *page, gfp_t foo)
  * will need to be able to use O_DIRECT on open in order to support
  * AIO. Modeled after NFS, they do this too.
  */
-/*
- * static ssize_t orangefs_direct_IO(int rw,
- *			struct kiocb *iocb,
- *			struct iov_iter *iter,
- *			loff_t offset)
- *{
- *	gossip_debug(GOSSIP_INODE_DEBUG,
- *		     "orangefs_direct_IO: %s\n",
- *		     iocb->ki_filp->f_path.dentry->d_name.name);
- *
- *	return -EINVAL;
- *}
- */
+
+static ssize_t orangefs_direct_IO(struct kiocb *iocb,
+				  struct iov_iter *iter,
+				  loff_t offset)
+{
+	gossip_debug(GOSSIP_INODE_DEBUG,
+		     "orangefs_direct_IO: %s\n",
+		     iocb->ki_filp->f_path.dentry->d_name.name);
+
+	return -EINVAL;
+}
 
 struct backing_dev_info orangefs_backing_dev_info = {
 	.name = "orangefs",
@@ -150,7 +148,7 @@  const struct address_space_operations orangefs_address_operations = {
 	.readpages = orangefs_readpages,
 	.invalidatepage = orangefs_invalidatepage,
 	.releasepage = orangefs_releasepage,
-/*	.direct_IO = orangefs_direct_IO */
+	.direct_IO = orangefs_direct_IO,
 };
 
 static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr)