diff options
Diffstat (limited to 'hw/virtio-9p.h')
-rw-r--r-- | hw/virtio-9p.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/hw/virtio-9p.h b/hw/virtio-9p.h index 0816ad66ec..4555f39752 100644 --- a/hw/virtio-9p.h +++ b/hw/virtio-9p.h @@ -37,6 +37,8 @@ enum { P9_RXATTRCREATE, P9_TREADDIR = 40, P9_RREADDIR, + P9_TLOCK = 52, + P9_RLOCK, P9_TLINK = 70, P9_RLINK, P9_TMKDIR = 72, @@ -434,6 +436,34 @@ typedef struct V9fsXattrState void *value; } V9fsXattrState; +#define P9_LOCK_SUCCESS 0 +#define P9_LOCK_BLOCKED 1 +#define P9_LOCK_ERROR 2 +#define P9_LOCK_GRACE 3 + +#define P9_LOCK_FLAGS_BLOCK 1 +#define P9_LOCK_FLAGS_RECLAIM 2 + +typedef struct V9fsFlock +{ + uint8_t type; + uint32_t flags; + uint64_t start; /* absolute offset */ + uint64_t length; + uint32_t proc_id; + V9fsString client_id; +} V9fsFlock; + +typedef struct V9fsLockState +{ + V9fsPDU *pdu; + size_t offset; + int8_t status; + struct stat stbuf; + V9fsFidState *fidp; + V9fsFlock *flock; +} V9fsLockState; + extern size_t pdu_packunpack(void *addr, struct iovec *sg, int sg_count, size_t offset, size_t size, int pack); |