lkml.org 
[lkml]   [2003]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Is there a "make hole" (truncate in middle) syscall?
Date
Szakacsits Szabolcs <szaka@sienet.hu> writes:

>> What are the downsides of holes? [...] is there a performance penalty to
>> having a file with 1000 4k holes in it, etc...)
>
> Depends what you do, what fs you use. Using XFS XFS_IOC_GETBMAPX you might
> get a huge improvement, see e.g. some numbers,
>
> http://marc.theaimsgroup.com/?l=reiserfs&m=105827549109079&w=2
>
> The problem is, 0 general purpose (like cp, tar, cat, etc) util supports
> it, you have to code your app accordingly.

I found this paragraph in the man page of GNU cp:

--sparse=WHEN
A `sparse file' contains `holes' - sequences of
zero bytes that do not occupy any physical disk
blocks; the `read' system call reads these as
zeroes. This can both save considerable disk space
and increase speed, since many binary files contain
lots of consecutive zero bytes. By default, cp
detects holes in input source files via a crude
heuristic and makes the corresponding output file
sparse as well.

The WHEN value can be one of the following:

auto The default behavior: the output file is
sparse if the input file is sparse.

always Always make the output file sparse. This is
useful when the input file resides on a
filesystem that does not support sparse
files, but the output file is on a filesys-
tem that does.

never Never make the output file sparse. If you
find an application for this option, let us
know.


--
Måns Rullgård
mru@kth.se

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:59    [W:0.095 / U:3.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site