-
- Downloads
get rid of ...lookup...fdget_rcu() family
Once upon a time, predecessors of those used to do file lookup without bumping a refcount, provided that caller held rcu_read_lock() across the lookup and whatever it wanted to read from the struct file found. When struct file allocation switched to SLAB_TYPESAFE_BY_RCU, that stopped being feasible and these primitives started to bump the file refcount for lookup result, requiring the caller to call fput() afterwards. But that turned them pointless - e.g. rcu_read_lock(); file = lookup_fdget_rcu(fd); rcu_read_unlock(); is equivalent to file = fget_raw(fd); and all callers of lookup_fdget_rcu() are of that form. Similarly, task_lookup_fdget_rcu() calls can be replaced with calling fget_task(). task_lookup_next_fdget_rcu() doesn't have direct counterparts, but its callers would be happier if we replaced it with an analogue that deals with RCU internally. Reviewed-by:Christian Brauner <brauner@kernel.org> Signed-off-by:
Al Viro <viro@zeniv.linux.org.uk>
Showing
- arch/powerpc/platforms/cell/spufs/coredump.c 1 addition, 3 deletionsarch/powerpc/platforms/cell/spufs/coredump.c
- fs/file.c 4 additions, 24 deletionsfs/file.c
- fs/gfs2/glock.c 2 additions, 10 deletionsfs/gfs2/glock.c
- fs/notify/dnotify/dnotify.c 1 addition, 4 deletionsfs/notify/dnotify/dnotify.c
- fs/proc/fd.c 3 additions, 9 deletionsfs/proc/fd.c
- include/linux/fdtable.h 0 additions, 4 deletionsinclude/linux/fdtable.h
- include/linux/file.h 1 addition, 0 deletionsinclude/linux/file.h
- kernel/bpf/task_iter.c 1 addition, 5 deletionskernel/bpf/task_iter.c
- kernel/kcmp.c 1 addition, 3 deletionskernel/kcmp.c
Loading
Please register or sign in to comment