All of lore.kernel.org
 help / color / mirror / Atom feed
* File perforation.
@ 2003-01-08 22:06 David Woodhouse
  2003-01-08 22:28 ` Eli Carter
                   ` (3 more replies)
  0 siblings, 4 replies; 20+ messages in thread
From: David Woodhouse @ 2003-01-08 22:06 UTC (permalink / raw)
  To: linux-fsdevel

I keep receiving requests from users to allow space saving by making holes 
in files. For people using JFFS2, a compressed file system designed for use 
on fairly small solid state storage devices, this is a fairly reasonable 
request, and it's also fairly simple to implement. It's only the interface 
I'm concerned about.

I've been resisting these requests because I really don't want to do it 
with an ioctl on the file. Only if we can have a generic sys_perforate() 
would I really want to do it.

Apparently it's hard to implement on block-based file systems. I don't 
really care about that though -- just falling back to writing zeroes to the 
offending range (or indeed returning -EINVAL) would be perfectly sufficient 
until/unless it gets implemented for other file systems. All I want is an 
interface that doesn't make me feel dirty :)

Comments? 

--
dwmw2



^ permalink raw reply	[flat|nested] 20+ messages in thread
* File perforation.
@ 2003-01-10 22:24 Steven French
  2003-01-11  1:46 ` Bryan Henderson
  0 siblings, 1 reply; 20+ messages in thread
From: Steven French @ 2003-01-10 22:24 UTC (permalink / raw)
  To: linux-fsdevel





Steven Whitehouse said
>Also I thought of an interface like madvise() but for
>files: fadvise() and then discovered that it already exists :-)

The fadvise concept sounds somewhat promising.   In the particular case of
the cifs filesystem, as long as the posix_fadvise like info were available
before the open (perhaps in the file struct) then it is trivial to pass
equivalents to most of them to the server in the network file open (in the
NTCreateX SMB PDU) information that would presumbably be ignored by many
filesystems unfortunately since the posix specs fadvise to take an open
file descriptor it makes it trickier for my particular case.

The sparse concept is interesting for my particular vfs as well - Windows
has an attribute flag presumably to allow an application to supply a hint
to the filesystem (when creating a file) that a particular inode is going
to be written sparsely.   Not sure that such a concept matters at all for
my Linux vfs given that the open/create system call is so much simpler.
I now have something fun to do over the weekend - trying to figure out what
the flag really does   :)

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench@us.ibm.com


^ permalink raw reply	[flat|nested] 20+ messages in thread
* Re: File perforation.
@ 2003-01-13  3:52 Steven French
  0 siblings, 0 replies; 20+ messages in thread
From: Steven French @ 2003-01-13  3:52 UTC (permalink / raw)
  To: Bryan Henderson; +Cc: linux-fsdevel





I am not at all sure that it is a hint your theory is just as plausible.
Sounds like it is time for me to do some experimentation to prove if your
theory is correct.

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench@us.ibm.com


From:  Bryan Henderson on 01/10/2003 07:46 PM

To:    Steven French/Austin/IBM@IBMUS
cc:    linux-fsdevel@vger.kernel.org
From:  Bryan Henderson/San Jose/IBM@IBMUS
Subject:    Re: File perforation.  (Document link: Steven French)

>The sparse concept is interesting for my particular vfs as well - Windows
>has an attribute flag presumably to allow an application to supply a hint
>to the filesystem (when creating a file) that a particular inode is going
>to be written sparsely.

How sure are you that that's a hint about future access?  My understanding
(based on very little authority) is that it is actually a _request_ to
allocate the file sparsely.  I.e. if you don't turn on that flag and then
write a byte at 0 and a byte at Block 99, Windows allocates 100 blocks of
disk space.  If you do turn it on, Windows allocates two blocks.

The reason you'd want the 100 block case is to be sure that when you later
go to fill in the middle, you don't get told there's no space.  And it is
default for backward compatibility because the ancestral filesystem type
wasn't sophisticated enough to do sparse.

--
Bryan Henderson                         IBM Research
San Jose CA                             Filesystems




^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2003-01-13  3:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-08 22:06 File perforation David Woodhouse
2003-01-08 22:28 ` Eli Carter
2003-01-08 22:34   ` David Woodhouse
2003-01-08 22:56     ` Eli Carter
2003-01-08 23:14       ` David Woodhouse
2003-01-09  1:22         ` Andrew Morton
2003-01-09  3:23           ` Andreas Dilger
2003-01-08 23:17     ` Steven Whitehouse
2003-01-08 23:16       ` David Woodhouse
2003-01-08 23:36         ` Steven Whitehouse
2003-01-08 23:25           ` David Woodhouse
2003-01-10  1:39         ` Bryan Henderson
2003-01-08 22:45 ` Dave Kleikamp
2003-01-08 22:55 ` Matthew Wilcox
2003-01-08 23:02   ` David Woodhouse
2003-01-11  9:47   ` Christoph Hellwig
2003-01-10  1:34 ` Bryan Henderson
  -- strict thread matches above, loose matches on Subject: below --
2003-01-10 22:24 Steven French
2003-01-11  1:46 ` Bryan Henderson
2003-01-13  3:52 Steven French

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.