]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
shred: increase I/O block size for periodic pattern case
authorPádraig Brady <P@draigBrady.com>
Thu, 7 Nov 2013 11:57:09 +0000 (11:57 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 8 Nov 2013 13:39:35 +0000 (13:39 +0000)
* src/shred.c (dopass): In the periodic pattern case increase the
I/O block size from 12KiB to 60KiB (also a multiple of 3 and 4096).
* NEWS: Adjust accordingly.

NEWS
src/shred.c

diff --git a/NEWS b/NEWS
index 79665ac8b38efd385ad1053f19161d7fdd7de3e0..7028c0d69a8680f4274aedd26fa37bbc8c929f48 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -97,7 +97,7 @@ GNU coreutils NEWS                                    -*- outline -*-
   Reservoir sampling is used to limit memory usage based on the number of
   outputs, rather than the number of inputs.
 
-  shred increases write block size from 12KiB to 64KiB when possible,
+  shred increases the default write block size from 12KiB to 64KiB
   to align with other utilities and reduce the system call overhead.
 
   split --line-bytes=SIZE, now only allocates memory as needed rather
index 98dd8726ce4b25596d29b737441421853d92afd0..6ff8322c9c06fd88923b0c7430a0f7ff05531725 100644 (file)
@@ -380,7 +380,7 @@ dopass (int fd, char const *qname, off_t *sizep, int type,
 
   /* Fill pattern buffer.  Aligning it to a page so we can do direct I/O.  */
   size_t page_size = getpagesize ();
-#define PERIODIC_OUTPUT_SIZE (12 * 1024)
+#define PERIODIC_OUTPUT_SIZE (60 * 1024)
 #define NONPERIODIC_OUTPUT_SIZE (64 * 1024)
   verify (PERIODIC_OUTPUT_SIZE % 3 == 0);
   size_t output_size = periodic_pattern (type)