public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] jfs: Add splice support
@ 2006-10-30 16:31 Daniel Drake
  2006-10-30 16:56 ` Dave Kleikamp
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Drake @ 2006-10-30 16:31 UTC (permalink / raw)
  To: shaggy; +Cc: axboe, linux-kernel

This allows the splice() and tee() syscalls to be used with JFS.

Signed-off-by: Daniel Drake <ddrake@brontes3d.com>

Index: linux-2.6.19-rc3/fs/jfs/file.c
===================================================================
--- linux-2.6.19-rc3.orig/fs/jfs/file.c
+++ linux-2.6.19-rc3/fs/jfs/file.c
@@ -109,6 +109,8 @@ const struct file_operations jfs_file_op
 	.aio_write	= generic_file_aio_write,
 	.mmap		= generic_file_mmap,
 	.sendfile	= generic_file_sendfile,
+	.splice_read	= generic_file_splice_read,
+	.splice_write	= generic_file_splice_write,
 	.fsync		= jfs_fsync,
 	.release	= jfs_release,
 	.ioctl		= jfs_ioctl,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] jfs: Add splice support
  2006-10-30 16:31 [PATCH] jfs: Add splice support Daniel Drake
@ 2006-10-30 16:56 ` Dave Kleikamp
  2006-10-30 17:29   ` Daniel Drake
  2006-10-31  8:32   ` Jan Engelhardt
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Kleikamp @ 2006-10-30 16:56 UTC (permalink / raw)
  To: Daniel Drake; +Cc: axboe, linux-kernel

On Mon, 2006-10-30 at 16:31 +0000, Daniel Drake wrote:
> This allows the splice() and tee() syscalls to be used with JFS.

Gosh, that was easy.  Why couldn't I do that?  :-)

Answer: I would have had to test it.

I'm assuming you did?

Thanks,
Shaggy

> Signed-off-by: Daniel Drake <ddrake@brontes3d.com>
> 
> Index: linux-2.6.19-rc3/fs/jfs/file.c
> ===================================================================
> --- linux-2.6.19-rc3.orig/fs/jfs/file.c
> +++ linux-2.6.19-rc3/fs/jfs/file.c
> @@ -109,6 +109,8 @@ const struct file_operations jfs_file_op
>  	.aio_write	= generic_file_aio_write,
>  	.mmap		= generic_file_mmap,
>  	.sendfile	= generic_file_sendfile,
> +	.splice_read	= generic_file_splice_read,
> +	.splice_write	= generic_file_splice_write,
>  	.fsync		= jfs_fsync,
>  	.release	= jfs_release,
>  	.ioctl		= jfs_ioctl,
-- 
David Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] jfs: Add splice support
  2006-10-30 16:56 ` Dave Kleikamp
@ 2006-10-30 17:29   ` Daniel Drake
  2006-10-30 17:49     ` Dave Kleikamp
  2006-10-31  8:32   ` Jan Engelhardt
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Drake @ 2006-10-30 17:29 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: axboe, linux-kernel

On Mon, 2006-10-30 at 10:56 -0600, Dave Kleikamp wrote:
> On Mon, 2006-10-30 at 16:31 +0000, Daniel Drake wrote:
> > This allows the splice() and tee() syscalls to be used with JFS.
> 
> Gosh, that was easy.  Why couldn't I do that?  :-)
> 
> Answer: I would have had to test it.
> 
> I'm assuming you did?

Yep:

Created a 100mb file from /dev/urandom on an ext3 partition
Used splice-cp to copy it onto a JFS partition
Used splice-cp to copy it from that JFS partition onto another JFS
partition

I checked md5sums at all stages, seems to work fine.

Thanks!
Daniel



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] jfs: Add splice support
  2006-10-30 17:29   ` Daniel Drake
@ 2006-10-30 17:49     ` Dave Kleikamp
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Kleikamp @ 2006-10-30 17:49 UTC (permalink / raw)
  To: Daniel Drake; +Cc: axboe, linux-kernel

On Mon, 2006-10-30 at 12:29 -0500, Daniel Drake wrote:
> > Answer: I would have had to test it.
> > 
> > I'm assuming you did?
> 
> Yep:
> 
> Created a 100mb file from /dev/urandom on an ext3 partition
> Used splice-cp to copy it onto a JFS partition
> Used splice-cp to copy it from that JFS partition onto another JFS
> partition
> 
> I checked md5sums at all stages, seems to work fine.

Great.  I added it to the jfs git tree.

Shaggy

> 
> Thanks!
> Daniel
> 
> 
-- 
David Kleikamp
IBM Linux Technology Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] jfs: Add splice support
  2006-10-30 16:56 ` Dave Kleikamp
  2006-10-30 17:29   ` Daniel Drake
@ 2006-10-31  8:32   ` Jan Engelhardt
  2006-10-31  8:46     ` Jens Axboe
  1 sibling, 1 reply; 6+ messages in thread
From: Jan Engelhardt @ 2006-10-31  8:32 UTC (permalink / raw)
  To: Dave Kleikamp; +Cc: Daniel Drake, axboe, linux-kernel


>> This allows the splice() and tee() syscalls to be used with JFS.
>
>Gosh, that was easy.  Why couldn't I do that?  :-)

You could add it to all the other filesystems that lack it. (Cautionary 
question: Does that work at an instant like it did with jfs?)

Seems like only ext[234] gfs2 reiserfs and xfs have splice_read 
currently.


	-`J'
-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] jfs: Add splice support
  2006-10-31  8:32   ` Jan Engelhardt
@ 2006-10-31  8:46     ` Jens Axboe
  0 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2006-10-31  8:46 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Dave Kleikamp, Daniel Drake, axboe, linux-kernel

On Tue, Oct 31 2006, Jan Engelhardt wrote:
> 
> >> This allows the splice() and tee() syscalls to be used with JFS.
> >
> >Gosh, that was easy.  Why couldn't I do that?  :-)
> 
> You could add it to all the other filesystems that lack it. (Cautionary 
> question: Does that work at an instant like it did with jfs?)
> 
> Seems like only ext[234] gfs2 reiserfs and xfs have splice_read 
> currently.

If the file system uses the generic page cache functions for reading and
writing, it should be able to use the generic splice read/write
functions as well. If it doesn't, then more work is likely involved. In
short, check the .read/.write and .aio_read/.aio_write parts of the
file_operations[] structure. jfs uses the generic handlers, hence splice
support should just be the two-liner posted.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-31  8:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-30 16:31 [PATCH] jfs: Add splice support Daniel Drake
2006-10-30 16:56 ` Dave Kleikamp
2006-10-30 17:29   ` Daniel Drake
2006-10-30 17:49     ` Dave Kleikamp
2006-10-31  8:32   ` Jan Engelhardt
2006-10-31  8:46     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox