diff options
author | Christian Schoenebeck <qemu_oss@crudebyte.com> | 2021-06-04 19:54:57 +0200 |
---|---|---|
committer | Christian Schoenebeck <qemu_oss@crudebyte.com> | 2021-07-05 13:03:16 +0200 |
commit | 1d0fc0d0eef057dc02055f531907188d19a83cb2 (patch) | |
tree | c53e27d2b2d6160647abb5a276599448747382f6 /hw | |
parent | 110243750dc4389fe8715c1db87a6ce6c2b9e645 (diff) |
9pfs: drop fid_to_qid()
There is only one user of fid_to_qid() which is v9fs_walk(). Let's
open-code fid_to_qid() directly within v9fs_walk(), because
fid_to_qid() hides the POSIX stat buffer which we are going to need
in the subsequent patch.
Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
Message-Id: <e9a4c9c7a0792ed4db6578d105a0823ea05bc324.1622821729.git.qemu_oss@crudebyte.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/9pfs/9p.c | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index eb15ec2082..0e3857798d 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -971,23 +971,6 @@ static int stat_to_qid(V9fsPDU *pdu, const struct stat *stbuf, V9fsQID *qidp) return 0; } -static int coroutine_fn fid_to_qid(V9fsPDU *pdu, V9fsFidState *fidp, - V9fsQID *qidp) -{ - struct stat stbuf; - int err; - - err = v9fs_co_lstat(pdu, &fidp->path, &stbuf); - if (err < 0) { - return err; - } - err = stat_to_qid(pdu, &stbuf, qidp); - if (err < 0) { - return err; - } - return 0; -} - V9fsPDU *pdu_alloc(V9fsState *s) { V9fsPDU *pdu = NULL; @@ -1772,7 +1755,11 @@ static void coroutine_fn v9fs_walk(void *opaque) v9fs_path_init(&dpath); v9fs_path_init(&path); - err = fid_to_qid(pdu, fidp, &qid); + err = v9fs_co_lstat(pdu, &fidp->path, &stbuf); + if (err < 0) { + goto out; + } + err = stat_to_qid(pdu, &stbuf, &qid); if (err < 0) { goto out; } |