diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-07-31 11:49:04 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2024-10-07 13:34:41 -0400 |
commit | 8fd3395ec9051a52828fcca2328cb50a69dea8ef (patch) | |
tree | d68b2a86f57af48fbece1070a3d3a09fc16a7521 /arch/powerpc/platforms | |
parent | 8cf0b93919e13d1e8d4466eb4080a4c4d9d66d7b (diff) | |
download | linux-8fd3395ec9051a52828fcca2328cb50a69dea8ef.tar.gz linux-8fd3395ec9051a52828fcca2328cb50a69dea8ef.tar.bz2 linux-8fd3395ec9051a52828fcca2328cb50a69dea8ef.zip |
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>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/coredump.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index 18daafbe2e65..301ee7d8b7df 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c @@ -73,9 +73,7 @@ static struct spu_context *coredump_next_context(int *fd) return NULL; *fd = n - 1; - rcu_read_lock(); - file = lookup_fdget_rcu(*fd); - rcu_read_unlock(); + file = fget_raw(*fd); if (file) { ctx = SPUFS_I(file_inode(file))->i_ctx; get_spu_context(ctx); |