public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is there a "blackhole" /dev/null directory?
@ 2008-02-14  9:30 rzryyvzy
  2008-02-14  9:39 ` Jasper Bryant-Greene
  0 siblings, 1 reply; 12+ messages in thread
From: rzryyvzy @ 2008-02-14  9:30 UTC (permalink / raw)
  To: linux-kernel

Hello Linux Kernel Hackers,

/dev/null is often very useful, specially if programs force to save data in some file. But some programs like to creates different temporary file names, so /dev/null could no more work.

What is with a "/dev/null"-directory?
I mean a "blackhole pseudo directory" which eats every write to null.

Here is how it could work:
mount -t nulldir nulldir /dev/nulldir

Now if a program does a create(2),
it creates in the memory the file with its fd.
Then if a program does a write(2) to the fd, it eats the writes and give out fakely it has written the number of bytes.
When the program calls does a close(2) of the fd, then the complete inode is deleted in the memory.

The directory should  be permanently empty except for the inodes with open file descriptors. So only inode information would be temporary saved in this "nulldir tmpfs" directory.

Is there already existing a possibility to create a null directory?
-- 
Best regards,
Mika Lawando

-- 
E-Mail sent with anti-spam site TrashMail.net!
Free disposable email addresses: http://www.trashmail.net/

^ permalink raw reply	[flat|nested] 12+ messages in thread
[parent not found: <9WIJE-1Nr-11@gated-at.bofh.it>]

end of thread, other threads:[~2008-02-15 19:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14  9:30 Is there a "blackhole" /dev/null directory? rzryyvzy
2008-02-14  9:39 ` Jasper Bryant-Greene
2008-02-14  9:46   ` Andi Kleen
2008-02-14 15:00     ` Jan Engelhardt
2008-02-14 15:19       ` Hans-Jürgen Koch
2008-02-14 15:23         ` Jan Engelhardt
2008-02-14 15:30           ` Hans-Jürgen Koch
2008-02-15 19:25       ` Bill Davidsen
2008-02-14 12:16   ` Mika Lawando
2008-02-14 15:06     ` linux-os (Dick Johnson)
     [not found] <9WIJE-1Nr-11@gated-at.bofh.it>
2008-02-14 17:16 ` Bodo Eggert
     [not found] ` <9WIJO-1Nr-19@gated-at.bofh.it>
     [not found]   ` <9WITv-286-21@gated-at.bofh.it>
     [not found]     ` <9WNTa-2x3-17@gated-at.bofh.it>
     [not found]       ` <9WOch-2Wk-3@gated-at.bofh.it>
2008-02-15  1:15         ` Bodo Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox