Re: [PATCH v3] fallocate: Add "--dig-holes" option

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

 



On Fri, Feb 14, 2014 at 11:47:56AM +0100, Karel Zak wrote:
> On Sun, Jan 26, 2014 at 03:06:50PM +0000, Rodrigo Campos wrote:
> >  bash-completion/fallocate |   2 +-
> >  sys-utils/fallocate.1     |  19 +++++++-
> >  sys-utils/fallocate.c     | 114 ++++++++++++++++++++++++++++++++++++++++------
> >  3 files changed, 120 insertions(+), 15 deletions(-)
> 
>  Applied with some changes and I believe that the code still need some
>  improvements, see below


 OK, I did some changes to the code:

 The minimal hole size is based on filesystem blocksize (st_blksize) and 
 --length is no more used for this thing. I think it's better to use
 buffer size which "just works" than expect any input from users. It
 also dramatically simplify the code and the command semantic.

 The original 32K is too large, I guess that we prefer optimal sparse
 files rather than --dig-hole speed. (And it isn't so slow with 4KiB
 chunks.)

 Now the --offset and --length options are used as usually to specify
 an area with in the file.


$ ls -lash yyy
1.1G -rw-rw-r-- 1 kzak kzak 1.0G Feb 17 11:09 yyy
^^^^

$ time ./fallocate --dig-holes yyy
real    0m0.393s
user    0m0.045s
sys     0m0.345s

$ ls -lash yyy
28K -rw-rw-r-- 1 kzak kzak 1.0G Feb 17 11:10 yyy
^^^

  .. so from 1GiB to 28K in 0.4 second.


    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux