diff options
| author | Greg Kurz <gkurz@linux.vnet.ibm.com> | 2016-06-06 11:52:34 +0200 |
|---|---|---|
| committer | Greg Kurz <gkurz@linux.vnet.ibm.com> | 2016-06-06 11:52:34 +0200 |
| commit | f314ea4e30a1ef87bf8845da952c6dd0bac20b95 (patch) | |
| tree | 16ceafb7280c2061bd8de7026a52b60f897bda71 /hw/9pfs/9p.c | |
| parent | 8762a46d3637f388fd9d2463dd966814522d5689 (diff) | |
| download | focaccia-qemu-f314ea4e30a1ef87bf8845da952c6dd0bac20b95.tar.gz focaccia-qemu-f314ea4e30a1ef87bf8845da952c6dd0bac20b95.zip | |
9p: introduce the V9fsDir type
If we are to switch back to readdir(), we need a more complex type than DIR * to be able to serialize concurrent accesses to the directory stream. This patch introduces a placeholder type and fixes all users. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/9p.c')
| -rw-r--r-- | hw/9pfs/9p.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 42ac4d79fb..803f525a2a 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -231,7 +231,7 @@ static int v9fs_reopen_fid(V9fsPDU *pdu, V9fsFidState *f) } while (err == -EINTR && !pdu->cancelled); } } else if (f->fid_type == P9_FID_DIR) { - if (f->fs.dir == NULL) { + if (f->fs.dir.stream == NULL) { do { err = v9fs_co_opendir(pdu, f); } while (err == -EINTR && !pdu->cancelled); @@ -345,7 +345,7 @@ static int free_fid(V9fsPDU *pdu, V9fsFidState *fidp) retval = v9fs_co_close(pdu, &fidp->fs); } } else if (fidp->fid_type == P9_FID_DIR) { - if (fidp->fs.dir != NULL) { + if (fidp->fs.dir.stream != NULL) { retval = v9fs_co_closedir(pdu, &fidp->fs); } } else if (fidp->fid_type == P9_FID_XATTR) { @@ -443,7 +443,7 @@ void v9fs_reclaim_fd(V9fsPDU *pdu) reclaim_count++; } } else if (f->fid_type == P9_FID_DIR) { - if (f->fs.dir != NULL) { + if (f->fs.dir.stream != NULL) { /* * Up the reference count so that * a clunk request won't free this fid @@ -451,8 +451,8 @@ void v9fs_reclaim_fd(V9fsPDU *pdu) f->ref++; f->rclm_lst = reclaim_list; reclaim_list = f; - f->fs_reclaim.dir = f->fs.dir; - f->fs.dir = NULL; + f->fs_reclaim.dir.stream = f->fs.dir.stream; + f->fs.dir.stream = NULL; reclaim_count++; } } @@ -1883,7 +1883,7 @@ static void v9fs_readdir(void *opaque) retval = -EINVAL; goto out_nofid; } - if (!fidp->fs.dir) { + if (!fidp->fs.dir.stream) { retval = -EINVAL; goto out; } |