diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-10-25 12:10:40 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2011-10-31 12:34:17 +0530 |
commit | cc720ddb5435ceaa4cda397ca3e74b099752b763 (patch) | |
tree | d23fdd287d712eaf5465cb3a8a73963234e15c09 /hw/9pfs/codir.c | |
parent | 2c74c2cb4bedddbfa67628fbd5f9273b4e0e9903 (diff) |
hw/9pfs: Abstract open state of fid to V9fsFidOpenState
To implement synthetic file system in Qemu we may not really
require file descriptor and Dir *. Make generic code use
V9fsFidOpenState instead.
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Diffstat (limited to 'hw/9pfs/codir.c')
-rw-r--r-- | hw/9pfs/codir.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hw/9pfs/codir.c b/hw/9pfs/codir.c index 72732e7c53..9b6d47d91d 100644 --- a/hw/9pfs/codir.c +++ b/hw/9pfs/codir.c @@ -29,7 +29,7 @@ int v9fs_co_readdir_r(V9fsPDU *pdu, V9fsFidState *fidp, struct dirent *dent, v9fs_co_run_in_worker( { errno = 0; - err = s->ops->readdir_r(&s->ctx, fidp->fs.dir, dent, result); + err = s->ops->readdir_r(&s->ctx, &fidp->fs, dent, result); if (!*result && errno) { err = -errno; } else { @@ -49,7 +49,7 @@ off_t v9fs_co_telldir(V9fsPDU *pdu, V9fsFidState *fidp) } v9fs_co_run_in_worker( { - err = s->ops->telldir(&s->ctx, fidp->fs.dir); + err = s->ops->telldir(&s->ctx, &fidp->fs); if (err < 0) { err = -errno; } @@ -65,7 +65,7 @@ void v9fs_co_seekdir(V9fsPDU *pdu, V9fsFidState *fidp, off_t offset) } v9fs_co_run_in_worker( { - s->ops->seekdir(&s->ctx, fidp->fs.dir, offset); + s->ops->seekdir(&s->ctx, &fidp->fs, offset); }); } @@ -77,7 +77,7 @@ void v9fs_co_rewinddir(V9fsPDU *pdu, V9fsFidState *fidp) } v9fs_co_run_in_worker( { - s->ops->rewinddir(&s->ctx, fidp->fs.dir); + s->ops->rewinddir(&s->ctx, &fidp->fs); }); } @@ -129,8 +129,8 @@ int v9fs_co_opendir(V9fsPDU *pdu, V9fsFidState *fidp) v9fs_path_read_lock(s); v9fs_co_run_in_worker( { - fidp->fs.dir = s->ops->opendir(&s->ctx, &fidp->path); - if (!fidp->fs.dir) { + err = s->ops->opendir(&s->ctx, &fidp->path, &fidp->fs); + if (err < 0) { err = -errno; } else { err = 0; @@ -146,7 +146,7 @@ int v9fs_co_opendir(V9fsPDU *pdu, V9fsFidState *fidp) return err; } -int v9fs_co_closedir(V9fsPDU *pdu, DIR *dir) +int v9fs_co_closedir(V9fsPDU *pdu, V9fsFidOpenState *fs) { int err; V9fsState *s = pdu->s; @@ -156,7 +156,7 @@ int v9fs_co_closedir(V9fsPDU *pdu, DIR *dir) } v9fs_co_run_in_worker( { - err = s->ops->closedir(&s->ctx, dir); + err = s->ops->closedir(&s->ctx, fs); if (err < 0) { err = -errno; } |