diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/9p/9p.h | 2 | ||||
-rw-r--r-- | include/net/9p/client.h | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h index 24a509f559ee..0b20ee6854d6 100644 --- a/include/net/9p/9p.h +++ b/include/net/9p/9p.h @@ -539,12 +539,12 @@ struct p9_rstatfs { struct p9_fcall { u32 size; u8 id; + bool used_mempool; u16 tag; size_t offset; size_t capacity; - struct kmem_cache *cache; u8 *sdata; }; 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) |