[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] shred: increase I/O block size for periodic pattern case

From: Pádraig Brady
Subject: [PATCH] shred: increase I/O block size for periodic pattern case
Date: Thu, 07 Nov 2013 14:39:52 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

I should have bumped up the buffer size for the periodic pattern case too.
This should fix it up.


commit 115c8e620dde3349cb8edef6edaba40dd82395d3
Author: Pádraig Brady <address@hidden>
Date:   Thu Nov 7 11:57:09 2013 +0000

    shred: increase I/O block size for periodic pattern case

    * 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.

diff --git a/NEWS b/NEWS
index bb35583..276e8eb 100644
--- a/NEWS
+++ b/NEWS
@@ -88,7 +88,7 @@ GNU coreutils NEWS                                    -*- 
outline -*-
   outputs, rather than the number of inputs.

   shred once again uses direct I/O where available, and increases write block
-  size from 12KiB to 64KiB when possible.
+  sizes from 12KiB to, depending on the pattern being written, 60KiB or 64KiB.
   [Direct I/O regression introduced in coreutils-6.0]

   split --line-bytes=SIZE, now only allocates memory as needed rather
diff --git a/src/shred.c b/src/shred.c
index 9ff7238..8bee090 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]