mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jasper Bryant-Greene <jasper@unix.geek.nz>
To: rzryyvzy <rzryyvzy@trashmail.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Is there a "blackhole" /dev/null directory?
Date: Thu, 14 Feb 2008 22:39:17 +1300	[thread overview]
Message-ID: <1202981957.10928.17.camel@phobos.jasper.bg> (raw)
In-Reply-To: <20080214093051.7240852AB0E31@trashmail.net>

[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]

On Thu, 2008-02-14 at 10:30 +0100, rzryyvzy wrote:
> /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?

This could be done fairly trivially with FUSE, and IMHO is a good use
for FUSE because since you're just throwing most data away, performance
is not a concern.

-j

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2008-02-14  9:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14  9:30 rzryyvzy
2008-02-14  9:39 ` Jasper Bryant-Greene [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1202981957.10928.17.camel@phobos.jasper.bg \
    --to=jasper@unix.geek.nz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rzryyvzy@trashmail.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome