lkml.org 
[lkml]   [2009]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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




\
 
 \ /
  Last update: 2009-12-18 20:01    [W:0.085 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site