| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* tests/cp/fiemap-2: New test.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
| |
* src/copy.c (extent_copy): Before this change, extent_copy would fail
to create holes, thus breaking --sparse=auto and --sparse=always.
I.e., copying a large enough file of all zeros, cp --sparse=always
should introduce a hole, but with extent_copy, it would not.
|
|
|
|
|
|
| |
* src/copy.c (sparse_copy): Remove now-obsolete comment about
how we used to work around lack of ftruncate. Combine nested
if conditions into one.
|
|
|
|
|
|
|
| |
we're going to have to use it from within extent_copy, too.
* src/copy.c (sparse_copy): New function, factored out of...
(copy_reg): ...here.
Remove now-unused locals.
|
|
|
|
|
| |
* src/copy.c (extent_copy): Don't leak an extent_scan buffer on
failed lseek, read, or write.
|
|
|
|
|
|
| |
* src/copy.c (extent_copy): Don't let what should have been a
temporary reduction of buf_size (to handle a short ext_len) become
permanent and thus impact the performance of all further iterations.
|
|
|
|
|
| |
* src/copy.c (extent_copy): Avoid duplication in post-loop
extend-to-desired-length code.
|
|
|
|
| |
(extent_copy): Rename locals: s/*ext_logical/*ext_start/
|
|
|
|
|
| |
* tests/cp/fiemap-perf: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
| |
* src/copy.c (copy_reg): Move use of extent_scan to just *after*
we allocate the main copying buffer, so we can...
(extent_scan): Take a new parameter, BUF, and use that rather
than allocating a private buffer. Update caller.
|
|
|
|
|
|
|
| |
* src/copy.c (copy_reg): Rename a variable to make more sense from
caller's perspective: s/require_normal_copy/normal_copy_required/.
This is an output-only variable, and the original name could make
it look like an input (or i&o) variable.
|
|
|
|
|
|
|
|
| |
so that we benefit from using extents also when reading a sparse
input file with --sparse=never.
* src/copy.c (copy_reg): Remove erroneous test of "make_holes"
so that we call extent_copy also when make_holes is false.
Otherwise, what's the point of that parameter?
|
| |
|
| |
|
|
|
|
| |
* src/extent-scan.c: Don't include error.h or quote.h. Neither is used.
|
| |
|
|
|
|
| |
* src/Makefile.am (copy_sources): Also distribute extent-scan.h.
|
| |
|
|
|
|
|
|
| |
* extent-scan.h [struct extent_scan]: Rename member:
s/hit_last_extent/hit_final_extent/. "final" is clearer,
since "last" can be interpreted as "preceding".
|
|
|
|
|
|
|
|
| |
* src/copy.c (write_zeros): Add comments.
(extent_copy): Move decls of "ok" and "i" down to scope where used.
Adjust comments.
Rename local: s/holes_len/hole_size/
Print a diagnostic upon failure to write zeros.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Jim Meyering wrote:
> jeff.liu wrote:
>> Sorry for the delay.
>>
>> This is the new patch to isolate the stuff regarding to extents reading to a new module. and teach
>> cp(1) to make use of it.
>
> Jeff,
>
> I applied your patch to my rebased fiemap-copy branch.
> My first step was to run the usual
>
> ./bootstrap && ./configure && make && make check
>
> "make check" failed on due to a double free in your new code:
> (x86_64, Fedora 13, ext4 working directory)
>
> To get details, I made this temporary modification:
Hi Jim,
I am sorry for the fault, it fixed at the patch below.
Would you please revie at your convenience?
Changes:
========
1. fix write_zeros() as Jim's comments, thanks for pointing this out.
2. remove char const *fname from struct extent_scan.
3. change the signature of open_extent_scan() from "void open_extent_scan(struct extent_scan
**scan)" to "void open_extent_scan(struct extent_scan *scan)"; the reason is I'd like to reduce once
memory allocation for the extent_scan variable, instead, using stack to save it.
4. remove close_extent_scan() from a function defined at extent-scan.c to extent-scan.h as a Macro
definination, but it does nothing for now, since initial extent scan defined at stack.
5. add a macro "free_extents_info()" defined at extent-scan.h to release the memory allocated to
extent info which should be called combine with get_extents_info(), it just one line, so IMHO,
define it as macro should be ok.
I have done the memory check via `valgrind`, no issue found.
make test against cp/sparse-fiemap failed at the extent compare stage, but the file content is
identical to each other by comparing those two files "j1/j2" manually.
Is it make sense if we verify them through diff(1) since the testing file is in small size?
or we have to merge the contig extents from the output of `filefrag', I admit I have not dig into
the filefrag-extent-compare at the moment, I need to recall the perl language syntax. :-P.
>From 50a3338db06442fa2d789fd65175172d140cc96e Mon Sep 17 00:00:00 2001
From: Jie Liu <jeff.liu@oracle.com>
Date: Wed, 29 Sep 2010 15:35:43 +0800
Subject: [PATCH 1/1] cp: add a new module for scanning extents
* src/extent-scan.c: Source code for scanning extents.
Call open_extent_scan() to initialize extent scan.
Call get_extents_info() to get a number of extents for each iteration.
* src/extent-scan.h: Header file of extent-scan.c.
Wrap free_extent_info() as macro define to release the space allocated extent_info per extent scan.
Wrap close_extent_scan() as macro define but do nothing at the moment.
* src/Makefile.am: Reference it and link it to copy_source.
* src/copy.c: Make use of the new module, replace fiemap_copy() with extent_copy().
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
|
|
|
|
| |
* tests/Makefile.am (EXTRA_DIST): Add filefrag-extent-compare.
|
|
|
|
| |
* src/Makefile.am (noinst_HEADERS): Add fiemap.h.
|
|
|
|
|
| |
* src/copy.c (fiemap_copy): Force kernel to sync the source
file before mapping.
|
|
|
|
|
| |
* tests/cp/sparse-fiemap: Accommodate values other than "eof"
in the "flags" column of filefrag -v output
|
|
|
|
|
| |
* src/fiemap.h: Include stdint.h, not linux/types.h,
now that this file uses only portable type names.
|
|
|
|
|
|
| |
* src/copy.c (fiemap_copy): Ensure that our fiemap buffer
is large enough and well-aligned.
Replace "0LL" with equivalent "0" as 3rd argument to lseek.
|
|
|
|
|
|
|
|
|
| |
* src/copy.c (fiemap_copy): Rename from fiemap_copy_ok.
Add/improve comments.
Remove local, "fail".
(fiemap_copy): Do not require caller to set
"normal_copy_required" before calling fiemap_copy.
Report ioctl failure if it's the 2nd or subsequent call.
|
|
|
|
|
| |
* tests/cp/sparse-fiemap: Improve.
* tests/filefrag-extent-compare: New file.
|
|
|
|
|
| |
* cfg.mk (sc_root_tests): Allow spaces before "require_root_",
now that tests/cp/sparse-fiemap has a conditional use.
|
|
|
|
| |
* tests/cp/sparse-fiemap: More tests.
|
|
|
|
|
|
| |
* tests/cp/sparse-fiemap: Don't require root access if current
partition is btrfs or xfs.
Use init.sh, not test-lib.sh.
|
|
|
|
|
| |
* tests/cp/sparse-fiemap: Ensure that a file with many extents (more
than fit in copy.c's internal 4KiB buffer) is copied properly.
|
|
|
|
| |
* tests/cp/sparse-fiemap: Cd into test directory sooner.
|
|
|
|
|
|
| |
* tests/cp/sparse-fiemap: Add a new test for FIEMAP-copy against a
loopbacked ext4 partition.
* tests/Makefile.am (sparse-fiemap): Reference the new test.
|
|
|
|
|
|
|
|
| |
* src/fiemap.h: Add fiemap.h for fiemap ioctl(2) support.
Copied from linux's include/linux/fiemap.h, with minor formatting changes.
* src/copy.c (copy_reg): Now, when `cp' invoked with --sparse=[WHEN] option, we
will try to do FIEMAP-copy if the underlaying file system support it, fall back
to a normal copy if it fails.
|
|
|
|
| |
* doc/coreutils.texi (mayConflictWithShellBuiltIn): Fix wording.
|
|
|
|
|
|
|
| |
* doc/coreutils.texi (Floating point): New section.
(od invocation, tail invocation, sort invocation, printf invocation):
(sleep invocation, seq invocation): Refer and defer to it. See
<http://lists.gnu.org/archive/html/bug-coreutils/2011-01/msg00031.html>.
|
|
|
|
|
|
|
| |
The previous gnulib submodule reference was *still* to a
non-public commit. My submodule had a stray commit, so
the reference was always to a local merge commit.
Reported by Rob Vermaas.
|
|
|
|
|
| |
The previous gnulib submodule reference was to a non-public commit.
Reported by Rob Vermaas.
|
|
|
|
|
| |
* README-release: Run cheaper root-only tests first.
Use half of processing units (not just 1) for the expensive tests.
|
|
|
|
|
|
| |
* tests/du/move-dir-while-traversing: Create a larger tree to
avoid a false-positive failure due to du terminating before
the rename is triggered.
|
| |
|
|
|
|
|
| |
* NEWS: Note when the uniq bug was introduced.
It was mine, commit 1d9b3de9, "uniq: remove redundant test".
|
|
|
|
|
|
| |
* doc/coreutils.texi (shred invocation): Give an example showing how
to invoke shred in single-pass mode, and warn that -n0 --zero may
be inadequate.
|
|
|
|
|
|
| |
* src/uniq.c (find_field): Remove the byte-skipping loop altogether.
Instead, perform the simple calculation. This results in a 10%
performance improvement for large byte offsets.
|
|
|
|
|
| |
* tests/misc/uniq-perf: New file.
* tests/Makefile.am (TESTS): Add it.
|
|
|
|
|
|
|
| |
* NEWS (Bug fixes): Mention it.
* src/uniq.c (find_field): Stop processing loop when end of line
is reached. Before this fix, 'uniq -f 10000000000 /etc/passwd'
would run for a very long time.
|
|
|
|
|
|
|
| |
* doc/coreutils.texi (tr's Character sets): Document how a 9-bit
octal value is interpreted. tr does not ignore the ninth bit.
(echo invocation, printf invocation): Document that any ninth
bit in \OOO is ignored. (http://debbugs.gnu.org/7574)
|
|
|
|
|
|
|
| |
* bootstrap.conf: Add the read-file module
* src/ptx.c: Replace the original code which would
needlessly read SIZE_MAX bytes of files larger than this.
* src/shuf.c: Replace the original code.
|