virtio-9p: Use 9P specific Lock constants
authorM. Mohan Kumar <mohan@in.ibm.com>
Wed, 12 Oct 2011 13:41:24 +0000 (19:11 +0530)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Sat, 15 Oct 2011 10:00:26 +0000 (15:30 +0530)
Use 9P specific lock constants instead of arch specific lock constants.

Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/9pfs/virtio-9p.c
hw/9pfs/virtio-9p.h

index 3958788..d476485 100644 (file)
@@ -2930,7 +2930,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);
index 60b8a56..e5cf78c 100644 (file)
@@ -352,6 +352,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