diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-05-24 15:10:56 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-09-22 21:38:52 +0530 |
commit | 02cb7f3a256517cbf3136caff2863fbafc57b540 (patch) | |
tree | 1d741e85dfe584b35a4a5e69a086d7b19fafd0ad /hw/9pfs/virtio-9p.h | |
parent | 70c18fc08bcc9e9bbd8c00ca5e694e07890687e5 (diff) |
hw/9pfs: Use read-write lock for protecting fid path.
On rename we take the write lock and this ensure path
doesn't change as we operate on them.
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 | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/9pfs/virtio-9p.h b/hw/9pfs/virtio-9p.h index 8aeee4ee9c..4238a76136 100644 --- a/hw/9pfs/virtio-9p.h +++ b/hw/9pfs/virtio-9p.h @@ -8,6 +8,8 @@ #include <sys/resource.h> #include "hw/virtio.h" #include "fsdev/file-op-9p.h" +#include "qemu-thread.h" +#include "qemu-coroutine.h" /* The feature bitmap for virtio 9P */ /* The mount point is specified in a config variable */ @@ -237,6 +239,11 @@ typedef struct V9fsState size_t config_size; enum p9_proto_version proto_version; int32_t msize; + /* + * lock ensuring atomic path update + * on rename. + */ + CoRwlock rename_lock; } V9fsState; typedef struct V9fsStatState { |