open(O_DIRECT) on a tmpfs?
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · Michael Tokarev
I wonder why
open()withO_DIRECT(for example) bit set is disallowed on a tmpfs (again, for example) filesystem, returning EINVAL.
Quoted 8 lines
Yes, the question may seems strange a bit, because of two somewhat conflicting reasons. First, there's no reason to use
O_DIRECTwith 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 allowO_DIRECTopen 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.
Signature · 4 lines
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