Hi,
A while ago there was a discussion about supporting direct-io on tmpfs.
Here is a simple patch that does it.
1. A new fs flag FS_RAM_BASED is added and the O_DIRECT flag is ignored
if this flag is set (suggestions on a better name?)
2. Specify FS_RAM_BASED for tmpfs and ramfs.
3. When EINVAL is returned only a fput is done. I changed it to go
through cleanup_all. But there is still a cleanup problem:
If a new file is created and then EINVAL is returned due to O_DIRECT,
the file is still left on the disk. I am not exactly sure how to fix
it other than adding another fs flag so we could check O_DIRECT
support at a much earlier stage. Comments on how to fix it?