lkml.org 
[lkml]   [2020]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] eventfd: convert to f_op->read_iter()
On Fri, May 01, 2020 at 05:54:09PM -0600, Jens Axboe wrote:
> On 5/1/20 5:12 PM, Al Viro wrote:
> > On Fri, May 01, 2020 at 01:11:09PM -0600, Jens Axboe wrote:
> >> + flags &= EFD_SHARED_FCNTL_FLAGS;
> >> + flags |= O_RDWR;
> >> + fd = get_unused_fd_flags(flags);
> >> if (fd < 0)
> >> - eventfd_free_ctx(ctx);
> >> + goto err;
> >> +
> >> + file = anon_inode_getfile("[eventfd]", &eventfd_fops, ctx, flags);
> >> + if (IS_ERR(file)) {
> >> + put_unused_fd(fd);
> >> + fd = PTR_ERR(file);
> >> + goto err;
> >> + }
> >>
> >> + file->f_mode |= FMODE_NOWAIT;
> >> + fd_install(fd, file);
> >> + return fd;
> >> +err:
> >> + eventfd_free_ctx(ctx);
> >> return fd;
> >> }
> >
> > Looks sane... I can take it via vfs.git, or leave it for you if you
> > have other stuff in the same area...
>
> Would be great if you can queue it up in vfs.git, thanks! Don't have
> anything else that'd conflict with this.

Applied; BTW, what happens if
ctx->id = ida_simple_get(&eventfd_ida, 0, 0, GFP_KERNEL);
fails? Quitely succeed with BS value (-ENOSPC/-ENOMEM) shown by
eventfd_show_fdinfo()?

\
 
 \ /
  Last update: 2020-05-03 15:47    [W:0.901 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site