Subject: Re: bug#6131: [PATCH]: fiemap support for efficient sparse file copy

From: Joel Becker <[email-masked]>
Date: Fri, 16 Jul 2010 14:33:17 -0700

On Fri, Jul 16, 2010 at 08:53:27AM -0700, Paul Eggert wrote:
> I haven't had time to look at it carefully, but here's a very brief
> review.  The code you sent, like what's in the fiemap branch, has
> a separate version of a chunk of copy.c that does both reading
> and writing and optimizes both reading and writing by invoking the fiemap ioctls
> at strategic locations.  Instead, it would be better to have
> a module that separates out the efficient-read stuff by telling
> copy.c where the next significant input extent is, and then modify copy.c
> to use that module.  On hosts that do not support fiemap, the module
> would simply report the entire input file as that file's only extent.

	Precisely.  The sparse-core.c or whatever it is called shouldn't
be doing the copy, it should just provide:

handle = init_extent_scan(fd);
while (get_next_extent(handle, &extent_start, &extent_len)) {
    ...
}
close_extent_scan(handle);

	Then copy.c just implements this loop and the '...' part.

Joel

-- 

"A narcissist is someone better looking than you are."  
         - Gore Vidal

Joel Becker
Consulting Software Developer
Oracle
E-mail: [email-masked]
Phone: (650) 506-8127