Messages in this thread | | | Date | Fri, 18 Dec 2009 10:59:00 -0800 (PST) | From | Davide Libenzi <> | Subject | Re: [PATCH v2] anonfd: Make file read-only if fops->write is not set |
| |
On Fri, 18 Dec 2009, Roland Dreier wrote:
> It seems a couple places such as arch/ia64/kernel/perfmon.c and > drivers/infiniband/core/uverbs_main.c could use anon_inode_getfile() > instead of a private pseudo-fs + alloc_file(), if only there were a way > to get a read-only file. So provide this by having anon_inode_getfile() > create a read-only file if the fops->write passed in is NULL. > > Signed-off-by: Roland Dreier <rolandd@cisco.com> > --- > > Good grief, what for? We are already passing O_NDELAY in flags argument, > > why not add O_RDWR/O_RDONLY to it? It's not as if we had that many > > callers, after all... > > fair enough, I wasn't sure if I really liked changing the meaning of the > flags argument without any indication of that in the function signature, > but definitely the code is nicer. > > so would something like this make sense? if so I'll send follow-ups > converting ia64 / perfmon and infiniband / uverbs to anon_inodes.
Looks OK to me.
- Davide
| |