From 2b6e72ed747f68a038df616efd86744b3644d694 Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 17 Jan 2014 18:31:00 +0100 Subject: 9P: Add memory barriers to protect request fields over cb/rpc threads handoff We need barriers to guarantee this pattern works as intended: [w] req->rc, 1 [r] req->status, 1 wmb rmb [w] req->status, 1 [r] req->rc Where the wmb ensures that rc gets written before status, and the rmb ensures that if you observe status == 1, rc is the new value. Signed-off-by: Dominique Martinet Signed-off-by: Eric Van Hensbergen --- include/net/9p/client.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/net/9p') diff --git a/include/net/9p/client.h b/include/net/9p/client.h index c38a005bd0cf..115aeac401b1 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -261,7 +261,7 @@ int p9_client_mkdir_dotl(struct p9_fid *fid, char *name, int mode, 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); struct p9_req_t *p9_tag_lookup(struct p9_client *, u16); -void p9_client_cb(struct p9_client *c, struct p9_req_t *req); +void p9_client_cb(struct p9_client *c, struct p9_req_t *req, int status); int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int); int p9stat_read(struct p9_client *, char *, int, struct p9_wstat *); -- cgit v1.2.3