summaryrefslogtreecommitdiffstats
path: root/hw/9pfs/coth.h
diff options
context:
space:
mode:
authorGreg Kurz2016-06-06 11:52:34 +0200
committerGreg Kurz2016-06-06 11:52:34 +0200
commit7cde47d4a89d5efefcc805788bc29133f4f3c5c7 (patch)
tree56025012a1648ccced4c5d1ea5f06b5536e245c6 /hw/9pfs/coth.h
parent9p: introduce the V9fsDir type (diff)
downloadqemu-7cde47d4a89d5efefcc805788bc29133f4f3c5c7.tar.gz
qemu-7cde47d4a89d5efefcc805788bc29133f4f3c5c7.tar.xz
qemu-7cde47d4a89d5efefcc805788bc29133f4f3c5c7.zip
9p: add locking to V9fsDir
If several threads concurrently call readdir() with the same directory stream pointer, it is possible that they all get a pointer to the same dirent structure, whose content is overwritten each time readdir() is called. We must thus serialize accesses to the dirent structure. This may be achieved with a mutex like below: lock_mutex(); readdir(); // work with the dirent unlock_mutex(); This patch adds all the locking, to prepare the switch to readdir(). Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/coth.h')
0 files changed, 0 insertions, 0 deletions