diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-08-02 11:35:54 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-09-22 21:38:52 +0530 |
commit | 532decb715acb2e03bbe373c9bd914a8499896ee (patch) | |
tree | 9a0592b04564b0d2d2f61b2ef9dd2600c218c6eb /hw/9pfs/virtio-9p.h | |
parent | 0174fe73e605311598d9e7f03e95be9705a3e0e7 (diff) |
hw/9pfs: Add fs driver specific details to fscontext
Add a new context flag PATHNAME_FSCONTEXT and indicate whether
the fs driver track fid using path names. Also add a private
pointer that help us to track fs driver specific values in there
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/virtio-9p.h')
-rw-r--r-- | hw/9pfs/virtio-9p.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 8c7c3f0571..80147d4131 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -388,6 +388,27 @@ static inline size_t do_pdu_unpack(void *dst, struct iovec *sg, int sg_count, return pdu_packunpack(dst, sg, sg_count, offset, size, 0); } +static inline void v9fs_path_write_lock(V9fsState *s) +{ + if (s->ctx.flags & PATHNAME_FSCONTEXT) { + qemu_co_rwlock_wrlock(&s->rename_lock); + } +} + +static inline void v9fs_path_read_lock(V9fsState *s) +{ + if (s->ctx.flags & PATHNAME_FSCONTEXT) { + qemu_co_rwlock_rdlock(&s->rename_lock); + } +} + +static inline void v9fs_path_unlock(V9fsState *s) +{ + if (s->ctx.flags & PATHNAME_FSCONTEXT) { + qemu_co_rwlock_unlock(&s->rename_lock); + } +} + extern void handle_9p_output(VirtIODevice *vdev, VirtQueue *vq); extern void virtio_9p_set_fd_limit(void); extern void v9fs_reclaim_fd(V9fsState *s); |