From: Andrew Morton <akpm@linux-foundation.org>
To: Fabian Frederick <fabf@skynet.be>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH 1/1 linux-next] fs/affs/file.c: adding support to O_DIRECT
Date: Thu, 23 Oct 2014 13:05:24 -0700 [thread overview]
Message-ID: <20141023130524.086f8b07e9d3c6dcf21be761@linux-foundation.org> (raw)
In-Reply-To: <1413908891-6038-1-git-send-email-fabf@skynet.be>
On Tue, 21 Oct 2014 18:28:11 +0200 Fabian Frederick <fabf@skynet.be> wrote:
> Based on ext2_direct_IO
>
> --- a/fs/affs/file.c
> +++ b/fs/affs/file.c
> @@ -12,6 +12,7 @@
> * affs regular file handling primitives
> */
>
> +#include <linux/aio.h>
> #include "affs.h"
>
> #if PAGE_SIZE < 4096
> @@ -392,6 +393,22 @@ static void affs_write_failed(struct address_space *mapping, loff_t to)
> }
> }
>
> +static ssize_t
> +affs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
> + loff_t offset)
> +{
> + struct file *file = iocb->ki_filp;
> + struct address_space *mapping = file->f_mapping;
> + struct inode *inode = mapping->host;
> + size_t count = iov_iter_count(iter);
> + ssize_t ret;
> +
> + ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, affs_get_block);
> + if (ret < 0 && (rw & WRITE))
> + affs_write_failed(mapping, offset + count);
> + return ret;
> +}
> +
> static int affs_write_begin(struct file *file, struct address_space *mapping,
> loff_t pos, unsigned len, unsigned flags,
> struct page **pagep, void **fsdata)
> @@ -418,6 +435,7 @@ const struct address_space_operations affs_aops = {
> .writepage = affs_writepage,
> .write_begin = affs_write_begin,
> .write_end = generic_write_end,
> + .direct_IO = affs_direct_IO,
> .bmap = _affs_bmap
> };
Has this been runtime tested? If so, please add the results to the
changelog. Some performance numbers would be useful.
prev parent reply other threads:[~2014-10-23 20:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 16:28 Fabian Frederick
2014-10-23 20:05 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141023130524.086f8b07e9d3c6dcf21be761@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=fabf@skynet.be \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®