lkml.org 
[lkml]   [2001]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Q: sparse file creation in existing data?
Date
Pavel writes:
> > It could be used as a replacement for the truncate code, because then
> > truncate is simply a special case of punch, namely punch(0, end).
>
> I do not think so. Truncate leaves you with filesize 0, while punch schould
> leave you with filesize of original file.

I can't recall the exact details (it's been a year since I looked at the
code), but I believe that the VFS sets the file size before the call to
truncate, so it didn't matter on the exact semantics of the punch call.
Truncate still existed, but it was just a wrapper calling the punch code
to punch out all of the existing blocks.

Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
-
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 12:56    [W:15.120 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site