From: Christoph Hellwig <hch@lst.de>
To: "Vladimir V. Saveliev" <vs@namesys.com>
Cc: Christoph Hellwig <hch@lst.de>,
reiserfs-list@namesys.com, Andrew Morton <akpm@osdl.org>,
Badari Pulavarty <pbadari@us.ibm.com>
Subject: Re: [PATCH] reiser4: fix readv
Date: Mon, 18 Sep 2006 16:19:02 +0200 [thread overview]
Message-ID: <20060918141902.GA21430@lst.de> (raw)
In-Reply-To: <200609181734.42341.vs@namesys.com>
On Mon, Sep 18, 2006 at 05:34:42PM +0400, Vladimir V. Saveliev wrote:
> Can we put it that way: if a filesystem can use page_cache directly - it has to set f_op->aio_read to generic_file_aio_read
> and set f_op->read to NULL. If the filesystem wants to try to screw things up a bit -
> it implements f_op->read and its f_op->read is called by sys_read and sys_readv
> regardless to whether it has aio_read or not?
Not entirely. The idea I had in my mind was the following:
- real filesystems should always implement the aio_ methods and must
support async and vectored I/O
- drivers or simple synthetic filesystems can implement just ->read and
->write and stay out of all the complexity.
In the end I would like to enforce and invariant where a fileesystem or
driver implements either the aio_ or normal methods, but we can't do
that yet as there are far too many places calling thos directly. Thus
we have do_sync_read and do_sync_write that are used as read and write
methods for those more complex filesystems. (Anyone's got an idea how
to enforce that people never set ->read and ->write to anything else
when they implement the aio methods?)
> > why does this matter for reiser4?
> >
>
> reiser4 reads some files via generic page cache routines. In that case reiser4' read calls do_sync_read.
> Therefore, it has to define f_op->aio_read.
> OTOH, there are files for which reiser4' read does not call do_sync_read.
>
> In case of readv, f_op->aio_read is called directly (if it is defined), which may result in that reiser4' aio_read is called for files for which
> reiser4' read would never call do_sync_read.
> To avoid the problem we have to implement reiser4_aio_read which either calls generic_file_aio_read or does something very similar to do_loop_readv_writev.
In that case reiserfs should only implement aio_read and aio_write
methods and use do_loop_readv_writev which we should export for a
beginning. Longer term you should try to implement full blown aio and
vector support even for those odd files (or find a way to migrate the
pagecache). Do files change from odd to normal while they're
instanciated? Otherwise you could just declare to sets of
file_operations, once that uses the pagecache and one that doesn't
and decide at inode instanciation time which one to use.
prev parent reply other threads:[~2006-09-18 14:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-13 18:12 [PATCH] reiser4: fix readv Vladimir V. Saveliev
2006-09-14 9:28 ` Christian Trefzer
2006-09-14 10:35 ` Peter
2006-09-14 10:59 ` Christian Trefzer
2006-09-14 11:15 ` Vladimir V. Saveliev
2006-09-15 2:24 ` Andrew Morton
2006-09-17 18:39 ` Vladimir V. Saveliev
2006-09-17 19:44 ` Andrew Morton
2006-09-17 19:53 ` Andrew Morton
2006-09-18 12:30 ` Christoph Hellwig
2006-09-18 13:34 ` Vladimir V. Saveliev
2006-09-18 14:19 ` Christoph Hellwig [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=20060918141902.GA21430@lst.de \
--to=hch@lst.de \
--cc=akpm@osdl.org \
--cc=pbadari@us.ibm.com \
--cc=reiserfs-list@namesys.com \
--cc=vs@namesys.com \
/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.