summaryrefslogtreecommitdiff
path: root/hw/9pfs/9p.h
diff options
context:
space:
mode:
Diffstat (limited to 'hw/9pfs/9p.h')
-rw-r--r--hw/9pfs/9p.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/hw/9pfs/9p.h b/hw/9pfs/9p.h
index db3a7530b1..ccd9b41c24 100644
--- a/hw/9pfs/9p.h
+++ b/hw/9pfs/9p.h
@@ -1,5 +1,5 @@
-#ifndef _QEMU_9P_H
-#define _QEMU_9P_H
+#ifndef QEMU_9P_H
+#define QEMU_9P_H
#include <dirent.h>
#include <utime.h>
@@ -8,9 +8,6 @@
#include <sys/resource.h>
#endif
-#include <glib.h>
-#include "standard-headers/linux/virtio_9p.h"
-#include "hw/virtio/virtio.h"
#include "fsdev/file-op-9p.h"
#include "fsdev/9p-iov-marshal.h"
#include "qemu/thread.h"
@@ -191,13 +188,33 @@ typedef struct V9fsXattr
int flags;
} V9fsXattr;
+typedef struct V9fsDir {
+ DIR *stream;
+ QemuMutex readdir_mutex;
+} V9fsDir;
+
+static inline void v9fs_readdir_lock(V9fsDir *dir)
+{
+ qemu_mutex_lock(&dir->readdir_mutex);
+}
+
+static inline void v9fs_readdir_unlock(V9fsDir *dir)
+{
+ qemu_mutex_unlock(&dir->readdir_mutex);
+}
+
+static inline void v9fs_readdir_init(V9fsDir *dir)
+{
+ qemu_mutex_init(&dir->readdir_mutex);
+}
+
/*
* Filled by fs driver on open and other
* calls.
*/
union V9fsFidOpenState {
int fd;
- DIR *dir;
+ V9fsDir dir;
V9fsXattr xattr;
/*
* private pointer for fs drivers, that
@@ -241,6 +258,7 @@ typedef struct V9fsState
int32_t root_fid;
Error *migration_blocker;
V9fsConf fsconf;
+ V9fsQID root_qid;
} V9fsState;
/* 9p2000.L open flags */