From: Edward Shishkin <edward.shishkin@gmail.com>
To: Ivan Shapovalov <intelfx100@gmail.com>, reiserfs-devel@vger.kernel.org
Subject: Re: reiser4: porting to 3.16: any reason ->aio_read() of struct file_operations has been left out?
Date: Wed, 20 Aug 2014 01:39:42 +0200 [thread overview]
Message-ID: <53F3E03E.7030805@gmail.com> (raw)
In-Reply-To: <10671542.MCAVDCHSND@intelfx-laptop>
On 08/20/2014 12:32 AM, Ivan Shapovalov wrote:
> From `git log` I've seen that VFS people intend to replace ->aio_read() and
> ->aio_write() of struct file_operations with new methods ->read_iter() and
> ->write_iter().
>
> (Along with a couple of related new helpers, differing from previous just in
> calling _iter methods instead of aio_ ones.)
>
> From other filesystems it seems that these are simple drop-in replacements
> (however, well, I have zero familiarity with VFS). So here is a question:
> is there any intentional reason that generic_file_aio_write() is not used
> in reiser4?
Currently reiser4 is a set of two filesystems which differ in methods
of handling regular files. For VFS we provide "dispatchers", which pass
management to appropriate plugin (UNIX_FILE or CRYPTCOMPRESS).
UNIX_FILE plugin doesn't use generic write for performance reasons
(I'll try to find the respective mailing thread). CRYPTCOMPRESS doesn't
use it for compatibility reasons: I don't know how how to rewrite it
gracefully using the generic write method.
Edward.
>
> What follows is a simple patch that I've currently applied to my own kernel
> (seems to be the only significant vfs change affecting filesystems), however,
> I fear that these code-paths are not generally used, so my "works for me"
> isn't really representative. Could you please clarify the situation here?
>
> From 81172835255a01718c2c256942d5887825a0cd7a Mon Sep 17 00:00:00 2001
> From: Ivan Shapovalov <intelfx100@gmail.com>
> Date: Tue, 19 Aug 2014 14:33:35 +0400
> Subject: [PATCH] Adjust reiser4 to 3.16: ->{read,write}_iter of struct
> file_operations.
>
> 1. ->aio_{read,write} of struct file_operations are being replaced with ->{read,write}_iter.
> 2. do_sync_{read,write} are being replaced with new_sync_{read,write}.
> 3. generic_file_splice_write is being replaced with iter_file_splice_write.
>
> Signed-off-by: Ivan Shapovalov <intelfx100@gmail.com>
> ---
> fs/reiser4/plugin/file/cryptcompress.c | 2 +-
> fs/reiser4/plugin/file/file.c | 2 +-
> fs/reiser4/plugin/object.c | 4 ++--
> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/fs/reiser4/plugin/file/cryptcompress.c b/fs/reiser4/plugin/file/cryptcompress.c
> index 8af388d..b0109fb 100644
> --- a/fs/reiser4/plugin/file/cryptcompress.c
> +++ b/fs/reiser4/plugin/file/cryptcompress.c
> @@ -2964,7 +2964,7 @@ ssize_t read_cryptcompress(struct file * file, char __user *buf, size_t size,
> reiser4_exit_context(ctx);
> return result;
> }
> - result = do_sync_read(file, buf, size, off);
> + result = new_sync_read(file, buf, size, off);
>
> context_set_commit_async(ctx);
> reiser4_exit_context(ctx);
> diff --git a/fs/reiser4/plugin/file/file.c b/fs/reiser4/plugin/file/file.c
> index 94029cd..e65c48d 100644
> --- a/fs/reiser4/plugin/file/file.c
> +++ b/fs/reiser4/plugin/file/file.c
> @@ -1752,7 +1752,7 @@ ssize_t read_unix_file(struct file *file, char __user *buf,
> switch (uf_info->container) {
> case UF_CONTAINER_EXTENTS:
> if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) {
> - result = do_sync_read(file, buf, read_amount, off);
> + result = new_sync_read(file, buf, read_amount, off);
> break;
> }
> case UF_CONTAINER_TAILS:
> diff --git a/fs/reiser4/plugin/object.c b/fs/reiser4/plugin/object.c
> index 553f1e2..e431e1f 100644
> --- a/fs/reiser4/plugin/object.c
> +++ b/fs/reiser4/plugin/object.c
> @@ -188,7 +188,7 @@ static struct file_operations regular_file_f_ops = {
> .llseek = generic_file_llseek,
> .read = reiser4_read_dispatch,
> .write = reiser4_write_dispatch,
> - .aio_read = generic_file_aio_read,
> + .read_iter = generic_file_read_iter,
> .unlocked_ioctl = reiser4_ioctl_dispatch,
> #ifdef CONFIG_COMPAT
> .compat_ioctl = reiser4_ioctl_dispatch,
> @@ -198,7 +198,7 @@ static struct file_operations regular_file_f_ops = {
> .release = reiser4_release_dispatch,
> .fsync = reiser4_sync_file_common,
> .splice_read = generic_file_splice_read,
> - .splice_write = generic_file_splice_write
> + .splice_write = iter_file_splice_write
> };
> static struct address_space_operations regular_file_a_ops = {
> .writepage = reiser4_writepage,
next prev parent reply other threads:[~2014-08-19 23:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 22:32 reiser4: porting to 3.16: any reason ->aio_read() of struct file_operations has been left out? Ivan Shapovalov
2014-08-19 23:39 ` Edward Shishkin [this message]
2014-08-20 20:34 ` Ivan Shapovalov
2014-08-20 22:30 ` Edward Shishkin
2014-08-21 15:05 ` Ivan Shapovalov
2014-08-21 15:27 ` Edward Shishkin
2014-08-30 16:07 ` Edward Shishkin
2014-08-30 16:22 ` Edward Shishkin
2014-10-09 18:55 ` Ivan Shapovalov
2014-10-12 9:37 ` Edward Shishkin
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=53F3E03E.7030805@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=intelfx100@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.