lkml.org 
[lkml]   [2020]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] io_uring: remove io_remove_personalities()
OK,I will adopt it and resubmit.

On Wed, Dec 23, 2020 at 8:45 PM Pavel Begunkov <asml.silence@gmail.com> wrote:
>
> On 23/12/2020 10:36, Stefano Garzarella wrote:
> > On Wed, Dec 23, 2020 at 11:27:05AM +0800, Yejune Deng wrote:
> >> The function io_remove_personalities() is very similar to
> >> io_unregister_personality(),but the latter has a more reasonable
> >> return value.
> >>
> >> Signed-off-by: Yejune Deng <yejune.deng@gmail.com>
> >> ---
> >> fs/io_uring.c | 25 ++++++-------------------
> >> 1 file changed, 6 insertions(+), 19 deletions(-)
> >
> > The patch LGTM, maybe as an alternative you can leave io_remove_personality() with the interface needed by idr_for_each() and implement io_unregister_personality() calling io_remove_personality() with the right parameters.
>
> Right, don't replace sane types with void * just because.
> Leave well-typed io_unregister_personality() and call it from
> io_remove_personalities().
>
>
> Also
> * idr_for_each() - Iterate through all stored pointers.
> ...
> * If @fn returns anything other than %0, the iteration stops and that
> * value is returned from this function.
>
> For io_remove_personality() iod==NULL should not happen because
> it's under for_each and synchronised, but leave the return value be
>
> io_remove_personality(void *, ...)
> {
> struct io_ring_ctx *ctx = data;
>
> io_unregister_personality(ctx, id);
> return 0;
> }
>
> --
> Pavel Begunkov

\
 
 \ /
  Last update: 2020-12-24 02:41    [W:0.060 / U:0.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site