auto merging extents

2011-03-07 Thread Pádraig Brady
I was wondering about adding fallocate() to cp, to efficiently allocate the destination before writing. With that in mind, I think it would be beneficial to auto merge extents, so that fragments in the source were not propagated to the dest? This should also be more efficient even without fallocat

Re: auto merging extents

2011-03-09 Thread Jim Meyering
Pádraig Brady wrote: > I was wondering about adding fallocate() to cp, > to efficiently allocate the destination before writing. > With that in mind, I think it would be beneficial > to auto merge extents, so that fragments in the > source were not propagated to the dest? > > This should also be mo

Re: auto merging extents

2011-03-10 Thread Pádraig Brady
On 09/03/11 18:23, Jim Meyering wrote: > Pádraig Brady wrote: >> - i--; >> - if (scan->ext_info[i].ext_flags & FIEMAP_EXTENT_LAST) >> + scan->ei_count = si; >> + >> + si--; >> + if (scan->ext_info[si].ext_flags & FIEMAP_EXTENT_LAST) >> { >>scan->hit_final_extent = true; >>

Re: auto merging extents

2011-03-10 Thread Jim Meyering
Pádraig Brady wrote: > On 09/03/11 18:23, Jim Meyering wrote: >> Pádraig Brady wrote: >>> - i--; >>> - if (scan->ext_info[i].ext_flags & FIEMAP_EXTENT_LAST) >>> + scan->ei_count = si; >>> + >>> + si--; >>> + if (scan->ext_info[si].ext_flags & FIEMAP_EXTENT_LAST) >>> { >>>scan->hi

Re: auto merging extents

2011-03-10 Thread Pádraig Brady
On 10/03/11 14:13, Jim Meyering wrote: > Have you thought of adding a test that would check for > the merged extents in the result, say using filefrag? That's a bit tricky, at least until I merge fallocate() support, and even then we're at the behest of the file system as to what actually happens

Re: auto merging extents

2011-04-05 Thread Pádraig Brady
This improves upon http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=3ed0384c by handling mergeable extents that span fiemap scan boundaries. The diff, ignoring whitespace changes, is below. The full patch is attached. cheers, Pádraig. diff --git a/src/extent-scan.c b/src/extent-scan

Re: auto merging extents

2011-04-05 Thread Pádraig Brady
On 05/04/11 11:33, Pádraig Brady wrote: > This improves upon > http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=3ed0384c > by handling mergeable extents that span fiemap scan boundaries. > > The diff, ignoring whitespace changes, is below. > The full patch is attached. Oops I also ne

Re: auto merging extents

2011-04-06 Thread Pádraig Brady
The last version had a nasty data corruption inducing off by one issue. I'll apply the attached this evening. cheers, Pádraig. From 40d1676c087cc79a059b9b0a7207f9eb9f66f074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Tue, 5 Apr 2011 11:04:13 +0100 Subject: [PATCH] copy: