From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Qo2-000579-9F for qemu-devel@nongnu.org; Fri, 16 Sep 2011 01:17:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4Qo1-0001Sk-Ed for qemu-devel@nongnu.org; Fri, 16 Sep 2011 01:17:42 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:38194) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4Qo0-0001SY-TO for qemu-devel@nongnu.org; Fri, 16 Sep 2011 01:17:41 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp05.au.ibm.com (8.14.4/8.13.1) with ESMTP id p8G5Asui005741 for ; Fri, 16 Sep 2011 15:10:54 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p8G5FqQw1560602 for ; Fri, 16 Sep 2011 15:15:52 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p8G5HdJh020580 for ; Fri, 16 Sep 2011 15:17:39 +1000 Received: from explorer.in.ibm.com ([9.79.191.131]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p8G5HbFn020550 for ; Fri, 16 Sep 2011 15:17:37 +1000 From: "M. Mohan Kumar" Date: Fri, 16 Sep 2011 10:47:37 +0530 Message-Id: <1316150257-25613-1-git-send-email-mohan@in.ibm.com> Subject: [Qemu-devel] [PATCH] virtio-9p: Use 9P specific Lock constants List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Use 9P specific lock constants instead of arch specific lock constants. Signed-off-by: M. Mohan Kumar --- hw/9pfs/virtio-9p.c | 2 +- hw/9pfs/virtio-9p.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 668ea24..181c6c2 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -2943,7 +2943,7 @@ static void v9fs_getlock(void *opaque) if (err < 0) { goto out; } - glock->type = F_UNLCK; + glock->type = P9_LOCK_TYPE_UNLCK; offset += pdu_marshal(pdu, offset, "bqqds", glock->type, glock->start, glock->length, glock->proc_id, &glock->client_id); diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 72dcbac..0f2a55e 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -111,6 +111,7 @@ enum p9_proto_version { #define FID_REFERENCED 0x1 #define FID_NON_RECLAIMABLE 0x2 + static inline const char *rpath(FsContext *ctx, const char *path, char *buffer) { snprintf(buffer, PATH_MAX, "%s/%s", ctx->fs_root, path); @@ -361,6 +362,11 @@ typedef struct V9fsMkState { V9fsString fullname; } V9fsMkState; +/* 9P2000.L lock type */ +#define P9_LOCK_TYPE_RDLCK 0 +#define P9_LOCK_TYPE_WRLCK 1 +#define P9_LOCK_TYPE_UNLCK 2 + #define P9_LOCK_SUCCESS 0 #define P9_LOCK_BLOCKED 1 #define P9_LOCK_ERROR 2 -- 1.7.6