aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2011-01-29tests: cp/fiemap: exercise previously-failing partsfiemap-copy-2Jim Meyering2-0/+55
* tests/cp/fiemap-2: New test. * tests/Makefile.am (TESTS): Add it.
2011-01-29copy: make extent_copy use sparse_copy, rather than its own codeJim Meyering1-60/+49
* 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.
2011-01-29copy: remove obsolete commentJim Meyering1-12/+9
* 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.
2011-01-29copy: factor sparse-copying code into its own function, becauseJim Meyering1-98/+114
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.
2011-01-29fiemap copy: avoid leak-on-errorJim Meyering1-4/+6
* src/copy.c (extent_copy): Don't leak an extent_scan buffer on failed lseek, read, or write.
2011-01-29fiemap copy: avoid a performance hit due to very small bufferJim Meyering1-3/+2
* 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.
2011-01-29fiemap copy: simplify post-loop logic; improve commentsJim Meyering1-30/+16
* src/copy.c (extent_copy): Avoid duplication in post-loop extend-to-desired-length code.
2011-01-29fiemap copy: rename some localsJim Meyering1-11/+11
(extent_copy): Rename locals: s/*ext_logical/*ext_start/
2011-01-29tests: ensure that FIEMAP-enabled cp copies a sparse file efficientlyJim Meyering2-0/+33
* tests/cp/fiemap-perf: New file. * tests/Makefile.am (TESTS): Add it.
2011-01-22copy: don't allocate a separate buffer just for extent-based copyJim Meyering1-19/+17
* 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.
2011-01-22copy: tweak variable name; improve a commentJim Meyering1-6/+6
* 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.
2011-01-22copy: call extent_copy also when make_holes is false, ...Jim Meyering1-16/+13
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?
2011-01-22* src/copy.c (copy_reg): Remove useless else-after-goto.Jim Meyering1-6/+4
2011-01-22copy.c: shorten a comment to fit in 80 columnsJim Meyering1-1/+1
2011-01-22extent-scan.c: don't include error.h or quote.hJim Meyering1-2/+0
* src/extent-scan.c: Don't include error.h or quote.h. Neither is used.
2011-01-22formattingJim Meyering2-5/+8
2011-01-22distribute extent-scan.h, tooJim Meyering1-1/+1
* src/Makefile.am (copy_sources): Also distribute extent-scan.h.
2011-01-22rename extent-scan functions to start with extent_scan_Jim Meyering3-22/+22
2011-01-22rename extent_scan memberJim Meyering3-6/+6
* 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".
2011-01-22fiemap copy: don't let write failure go unreported; adjust style, etc.Jim Meyering1-9/+19
* 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.
2011-01-22bug#6131: [PATCH]: fiemap support for efficient sparse file copyjeff.liu4-80/+296
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>
2011-01-22build: distribute new test script, filefrag-extent-compareJim Meyering1-0/+1
* tests/Makefile.am (EXTRA_DIST): Add filefrag-extent-compare.
2011-01-22build: distribute new file, fiemap.hJim Meyering1-0/+1
* src/Makefile.am (noinst_HEADERS): Add fiemap.h.
2011-01-22copy.c: add FIEMAP_FLAG_SYNC to fiemap ioctlJie Liu1-0/+1
* src/copy.c (fiemap_copy): Force kernel to sync the source file before mapping.
2011-01-22tests: accommodate varying filefrag -v "flags" outputJim Meyering1-1/+2
* tests/cp/sparse-fiemap: Accommodate values other than "eof" in the "flags" column of filefrag -v output
2011-01-22fiemap.h: include <stdint.h>, not <linux/types.h>Jim Meyering1-1/+1
* src/fiemap.h: Include stdint.h, not linux/types.h, now that this file uses only portable type names.
2011-01-22copy.c: ensure proper alignment of fiemap bufferPaul Eggert1-7/+8
* 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.
2011-01-22copy.c: adjust comments, tweak semanticsJim Meyering1-26/+36
* 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.
2011-01-22tests: improve fiemap test to work with 4 FS types; fall back on ext4Jim Meyering2-11/+95
* tests/cp/sparse-fiemap: Improve. * tests/filefrag-extent-compare: New file.
2011-01-22tests: relax the root-tests cross-checkJim Meyering1-1/+1
* cfg.mk (sc_root_tests): Allow spaces before "require_root_", now that tests/cp/sparse-fiemap has a conditional use.
2011-01-22tests: test fiemap-enabled cp more thoroughlyJim Meyering1-29/+32
* tests/cp/sparse-fiemap: More tests.
2011-01-22tests: require root only if current partition is neither btrfs nor xfsJim Meyering1-22/+27
* tests/cp/sparse-fiemap: Don't require root access if current partition is btrfs or xfs. Use init.sh, not test-lib.sh.
2011-01-22tests: exercise more of the new FIEMAP copying codeJim Meyering1-0/+38
* tests/cp/sparse-fiemap: Ensure that a file with many extents (more than fit in copy.c's internal 4KiB buffer) is copied properly.
2011-01-22tests: sparse-fiemap: factor out some set-upJim Meyering1-4/+4
* tests/cp/sparse-fiemap: Cd into test directory sooner.
2011-01-22tests: add a new test for FIEMAP-copyJie Liu2-0/+57
* 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.
2011-01-22cp: Add FIEMAP support for efficient sparse file copyJie Liu2-0/+261
* 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.
2011-01-21doc: fix wording in warning about potential conflict with built-inJim Meyering1-1/+1
* doc/coreutils.texi (mayConflictWithShellBuiltIn): Fix wording.
2011-01-21manual: document floating point betterPaul Eggert1-13/+39
* 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>.
2011-01-20build: update gnulib submodule to latestJim Meyering1-0/+0
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.
2011-01-20build: update gnulib submodule to latestJim Meyering1-0/+0
The previous gnulib submodule reference was to a non-public commit. Reported by Rob Vermaas.
2011-01-19maint: use slightly more efficient process in README-releaseJim Meyering1-7/+9
* README-release: Run cheaper root-only tests first. Use half of processing units (not just 1) for the expensive tests.
2011-01-18tests: avoid FP failure in new du testJim Meyering1-2/+9
* 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.
2011-01-18build: update gnulib submodule to latestJim Meyering1-0/+0
2011-01-18doc: update NEWSJim Meyering1-0/+1
* NEWS: Note when the uniq bug was introduced. It was mine, commit 1d9b3de9, "uniq: remove redundant test".
2011-01-17doc: show how to shred more efficientlyJim Meyering1-0/+14
* 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.
2011-01-17uniq: replace a wasteful loop with simple calculationJim Meyering1-2/+1
* 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.
2011-01-17tests: add a test for today's uniq bugJim Meyering2-0/+26
* tests/misc/uniq-perf: New file. * tests/Makefile.am (TESTS): Add it.
2011-01-17uniq: don't continue field processing after end of lineSami Kerola2-1/+3
* 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.
2011-01-15doc: specify how tr, echo, printf treat octal numbersOndřej Vašík1-6/+13
* 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)
2011-01-14maint: refactor to use read-file from gnulibPádraig Brady3-119/+12
* 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.