[RFC PATCH v2 18/21] ext4: add support for read_iter and write_iter

Subsystems: ext4 file system, filesystems (vfs and infrastructure), the rest

STALE5262d

Revision v2 of 6 in this series.

4 messages, 2 authors, 2012-04-03 · open the first message on its own page

[RFC PATCH v2 18/21] ext4: add support for read_iter and write_iter

From: Dave Kleikamp <hidden>
Date: 2012-03-30 15:43:45

use the generic .read_iter and .write_iter functions

Signed-off-by: Dave Kleikamp <redacted>
Cc: Zach Brown <redacted>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
 fs/ext4/file.c |    2 ++
 1 file changed, 2 insertions(+)
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index cb70f18..ce76745 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -234,6 +234,8 @@ const struct file_operations ext4_file_operations = {
 	.write		= do_sync_write,
 	.aio_read	= generic_file_aio_read,
 	.aio_write	= ext4_file_write,
+	.read_iter	= generic_file_read_iter,
+	.write_iter	= generic_file_write_iter,
 	.unlocked_ioctl = ext4_ioctl,
 #ifdef CONFIG_COMPAT
 	.compat_ioctl	= ext4_compat_ioctl,
-- 
1.7.9.5

Re: [RFC PATCH v2 18/21] ext4: add support for read_iter and write_iter

From: Ted Ts'o <tytso@mit.edu>
Date: 2012-04-02 18:42:04

On Fri, Mar 30, 2012 at 10:43:45AM -0500, Dave Kleikamp wrote:
use the generic .read_iter and .write_iter functions
Potentially silly question --- why not use NULL pointer to mean
generic_file_read_iter and generic_file_write_iter?  Then you won't
have to patch a bunch of file systems to add the generic .read_iter
and .write_iter?

						- Ted

Re: [RFC PATCH v2 18/21] ext4: add support for read_iter and write_iter

From: Dave Kleikamp <hidden>
Date: 2012-04-02 22:45:18

On 04/02/2012 01:42 PM, Ted Ts'o wrote:
On Fri, Mar 30, 2012 at 10:43:45AM -0500, Dave Kleikamp wrote:
quoted
use the generic .read_iter and .write_iter functions
Potentially silly question --- why not use NULL pointer to mean
generic_file_read_iter and generic_file_write_iter?  Then you won't
have to patch a bunch of file systems to add the generic .read_iter
and .write_iter?
I'm  not very confident that generic_file_read_iter and
generic_file_write_iter will work for every filesystem that I haven't
yet touched. It should work if they use generic_aio_read and _write, but
some have their own versions of those.

Shaggy

Re: [RFC PATCH v2 18/21] ext4: add support for read_iter and write_iter

From: Dave Kleikamp <hidden>
Date: 2012-04-03 00:11:28

On 04/02/2012 05:45 PM, Dave Kleikamp wrote:
On 04/02/2012 01:42 PM, Ted Ts'o wrote:
quoted
On Fri, Mar 30, 2012 at 10:43:45AM -0500, Dave Kleikamp wrote:
quoted
use the generic .read_iter and .write_iter functions
Potentially silly question --- why not use NULL pointer to mean
generic_file_read_iter and generic_file_write_iter?  Then you won't
have to patch a bunch of file systems to add the generic .read_iter
and .write_iter?
I'm  not very confident that generic_file_read_iter and
generic_file_write_iter will work for every filesystem that I haven't
yet touched. It should work if they use generic_aio_read and _write, but
some have their own versions of those.
In fact, I just realized a big oversight on my part in that I have ext4
calling generic_file_write_iter(), when in fact, it should be doing the
equivalent of ext4_file_write(). If been chasing a bug assuming that
ext4 called generic_aio_write(). Sometimes I miss the obvious.
Shaggy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help