mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
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>
This commit is contained in:
parent
70c18fc08b
commit
02cb7f3a25
8 changed files with 155 additions and 87 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue