summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-04 04:02:49 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-17 16:15:53 +0300
commit2b38ea66703f230b5dbf884696907ac0b9509b24 (patch)
tree5f2c1b03b94de7befd6320c5d17e8ff7df52bb55 /include
parent59cb621ace216d4daa47fb63c366ba635af667b3 (diff)
downloadlinux-2b38ea66703f230b5dbf884696907ac0b9509b24.tar.xz
9p: Drop kref usage
[ Upstream commit 6cda12864cb0f99810a5809e11e3ee5b102c9a47 ] An upcoming patch is going to require passing the client through p9_req_put() -> p9_req_free(), but that's awkward with the kref indirection - so this patch switches to using refcount_t directly. Link: https://lkml.kernel.org/r/20220704014243.153050-1-kent.overstreet@gmail.com Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Cc: Eric Van Hensbergen <ericvh@gmail.com> Cc: Latchesar Ionkov <lucho@ionkov.net> Signed-off-by: Dominique Martinet <asmadeus@codewreck.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/net/9p/client.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index ec1d1706f43c..c038c2d73dae 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -76,7 +76,7 @@ enum p9_req_status_t {
struct p9_req_t {
int status;
int t_err;
- struct kref refcount;
+ refcount_t refcount;
wait_queue_head_t wq;
struct p9_fcall tc;
struct p9_fcall rc;
@@ -227,12 +227,12 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag);
static inline void p9_req_get(struct p9_req_t *r)
{
- kref_get(&r->refcount);
+ refcount_inc(&r->refcount);
}
static inline int p9_req_try_get(struct p9_req_t *r)
{
- return kref_get_unless_zero(&r->refcount);
+ return refcount_inc_not_zero(&r->refcount);
}
int p9_req_put(struct p9_req_t *r);