Re: open(O_DIRECT) on a tmpfs?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Tokarev <[email protected]> wrote:

> I wonder why open() with O_DIRECT (for example) bit set is
> disallowed on a tmpfs (again, for example) filesystem,
> returning EINVAL.
> 
> Yes, the question may seems strange a bit, because of two
> somewhat conflicting reasons.  First, there's no reason to
> use O_DIRECT with tmpfs in a first place, because tmpfs does
> not have backing store at all, so there's no place to do
> direct writes to.  But on another hand, again due to the very
> nature of tmpfs, there's no reason not to allow O_DIRECT
> open and just ignore it, -- exactly because there's no
> backing store for this filesystem.

I'm using a tmpfs as a mostly-ramdisk, that is I've set up a large swap
partition in case I need the RAM instead of using it for a filesystem.
Therefore it will sometimes have a backing store.

OTOH, ramfs does not have this property (the cache is the backing store),
so it would make sense to allow it at least there.

BTW: Maybe you could use a ramdisk instead of the loop-on-tmpfs.
-- 
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.

http://david.woodhou.se/why-not-spf.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux