diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-03 21:29:22 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2022-07-03 23:04:26 -0400 |
commit | 56440899dc06c69f05b59b1e76150de6547a125c (patch) | |
tree | 4f7ef4b4360867db3a01c99023c7180ff7672a36 /include/net/9p/client.h | |
parent | 0ac0401f035bb278179176bc1d30b048230b453f (diff) |
9p: Add mempools for RPCs9p_mempool
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'include/net/9p/client.h')
-rw-r--r-- | include/net/9p/client.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index cb78e0e33332..832dcc866a20 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -9,6 +9,7 @@ #ifndef NET_9P_CLIENT_H #define NET_9P_CLIENT_H +#include <linux/mempool.h> #include <linux/utsname.h> #include <linux/idr.h> @@ -107,6 +108,14 @@ struct p9_client { void *trans; struct kmem_cache *fcall_cache; + /* + * We need two identical mempools because it's not safe to allocate + * multiple elements from the same pool (without freeing the first); + * that will deadlock if multiple threads need the last element at the + * same time. + */ + mempool_t pools[2]; + union { struct { int rfd; @@ -222,7 +231,8 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, const char *name, int mode, kgid_t gid, struct p9_qid *qid); int p9_client_lock_dotl(struct p9_fid *fid, struct p9_flock *flock, u8 *status); int p9_client_getlock_dotl(struct p9_fid *fid, struct p9_getlock *fl); -void p9_fcall_fini(struct p9_fcall *fc); +void p9_fcall_fini(struct p9_client *c, struct p9_fcall *fc, + int fc_idx); struct p9_req_t *p9_tag_lookup(struct p9_client *c, u16 tag); static inline void p9_req_get(struct p9_req_t *r) |