virtio-9p: Use 9P specific Lock constants
PATCH 1/1 virtio-9p: Use 9P specific Lock constants
Use 9P specific lock constants instead of arch specific lock constants.
Signed-off-by M. Mohan Kumar <[email protected]>
--- hw/9pfs/virtio-9p.c | 2 +- hw/9pfs/virtio-9p.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-)
hw/9pfs/virtio-9p.c +1 -1
@@ -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);
hw/9pfs/virtio-9p.h +6 -0
@@ -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
Signature · 1 line
1.7.6