summaryrefslogtreecommitdiffstats
path: root/hw/9pfs/9p-handle.c
diff options
context:
space:
mode:
authorPeter Maydell2016-06-06 16:17:52 +0200
committerPeter Maydell2016-06-06 16:17:52 +0200
commit280b2358cd1fc88003773bff3c4d4219f8bd3ae6 (patch)
tree2583b26a7d45862351ec7d9a1b4207bac20600af /hw/9pfs/9p-handle.c
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-vga-20160606-1' into s... (diff)
parent9p: switch back to readdir() (diff)
downloadqemu-280b2358cd1fc88003773bff3c4d4219f8bd3ae6.tar.gz
qemu-280b2358cd1fc88003773bff3c4d4219f8bd3ae6.tar.xz
qemu-280b2358cd1fc88003773bff3c4d4219f8bd3ae6.zip
Merge remote-tracking branch 'remotes/gkurz/tags/for-upstream' into staging
readdir_r() to readdir() conversion, various minor cleanups # gpg: Signature made Mon 06 Jun 2016 10:52:52 BST # gpg: using DSA key 0x02FC3AEB0101DBC2 # gpg: Good signature from "Greg Kurz <gkurz@fr.ibm.com>" # gpg: aka "Greg Kurz <groug@free.fr>" # gpg: aka "Greg Kurz <gkurz@linux.vnet.ibm.com>" # gpg: aka "Gregory Kurz (Groug) <groug@free.fr>" # gpg: aka "Gregory Kurz (Cimai Technology) <gkurz@cimai.com>" # gpg: aka "Gregory Kurz (Meiosys Technology) <gkurz@meiosys.com>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2BD4 3B44 535E C0A7 9894 DBA2 02FC 3AEB 0101 DBC2 * remotes/gkurz/tags/for-upstream: 9p: switch back to readdir() 9p: add locking to V9fsDir 9p: introduce the V9fsDir type 9p: drop useless out: label 9p: drop useless inclusion of hw/i386/pc.h 9p/fsdev: remove obsolete references to virtio 9p: some more cleanup in #include directives Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/9pfs/9p-handle.c')
-rw-r--r--hw/9pfs/9p-handle.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/hw/9pfs/9p-handle.c b/hw/9pfs/9p-handle.c
index 894041488a..3d77594f92 100644
--- a/hw/9pfs/9p-handle.c
+++ b/hw/9pfs/9p-handle.c
@@ -112,7 +112,7 @@ static int handle_close(FsContext *ctx, V9fsFidOpenState *fs)
static int handle_closedir(FsContext *ctx, V9fsFidOpenState *fs)
{
- return closedir(fs->dir);
+ return closedir(fs->dir.stream);
}
static int handle_open(FsContext *ctx, V9fsPath *fs_path,
@@ -132,8 +132,8 @@ static int handle_opendir(FsContext *ctx,
if (ret < 0) {
return -1;
}
- fs->dir = fdopendir(ret);
- if (!fs->dir) {
+ fs->dir.stream = fdopendir(ret);
+ if (!fs->dir.stream) {
return -1;
}
return 0;
@@ -141,24 +141,22 @@ static int handle_opendir(FsContext *ctx,
static void handle_rewinddir(FsContext *ctx, V9fsFidOpenState *fs)
{
- rewinddir(fs->dir);
+ rewinddir(fs->dir.stream);
}
static off_t handle_telldir(FsContext *ctx, V9fsFidOpenState *fs)
{
- return telldir(fs->dir);
+ return telldir(fs->dir.stream);
}
-static int handle_readdir_r(FsContext *ctx, V9fsFidOpenState *fs,
- struct dirent *entry,
- struct dirent **result)
+static struct dirent *handle_readdir(FsContext *ctx, V9fsFidOpenState *fs)
{
- return readdir_r(fs->dir, entry, result);
+ return readdir(fs->dir.stream);
}
static void handle_seekdir(FsContext *ctx, V9fsFidOpenState *fs, off_t off)
{
- seekdir(fs->dir, off);
+ seekdir(fs->dir.stream, off);
}
static ssize_t handle_preadv(FsContext *ctx, V9fsFidOpenState *fs,
@@ -262,7 +260,7 @@ static int handle_fstat(FsContext *fs_ctx, int fid_type,
int fd;
if (fid_type == P9_FID_DIR) {
- fd = dirfd(fs->dir);
+ fd = dirfd(fs->dir.stream);
} else {
fd = fs->fd;
}
@@ -409,7 +407,7 @@ static int handle_fsync(FsContext *ctx, int fid_type,
int fd;
if (fid_type == P9_FID_DIR) {
- fd = dirfd(fs->dir);
+ fd = dirfd(fs->dir.stream);
} else {
fd = fs->fd;
}
@@ -681,7 +679,7 @@ FileOperations handle_ops = {
.opendir = handle_opendir,
.rewinddir = handle_rewinddir,
.telldir = handle_telldir,
- .readdir_r = handle_readdir_r,
+ .readdir = handle_readdir,
.seekdir = handle_seekdir,
.preadv = handle_preadv,
.pwritev = handle_pwritev,