From: Christian Schoenebeck via Qemu-devel <qemu-devel@nongnu.org>
To: qemu-devel@nongnu.org
Cc: "Christian Schoenebeck" <qemu_oss@crudebyte.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Greg Kurz" <groug@kaod.org>,
"Antonios Motakis" <antonios.motakis@huawei.com>
Subject: Re: [Qemu-devel] [PATCH v4 4/5] 9p: stat_to_qid: implement slow path
Date: Fri, 28 Jun 2019 16:03:02 +0200 [thread overview]
Message-ID: <4090006.s5PtGRB9R1@silver> (raw)
In-Reply-To: <20190628122120.60a1ec0b@bahia.lan>
On Freitag, 28. Juni 2019 12:21:20 CEST Greg Kurz wrote:
> > +static int qid_path_fullmap(V9fsPDU *pdu, const struct stat *stbuf,
> > + uint64_t *path)
> > +{
> > + QpfEntry lookup = {
> > + .dev = stbuf->st_dev,
> > + .ino = stbuf->st_ino
> > + }, *val;
> > + uint32_t hash = qpf_hash(lookup);
> > +
> > + /* most users won't need the fullmap, so init the table lazily */
> > + if (!pdu->s->qpf_table.map) {
> > + qht_init(&pdu->s->qpf_table, qpf_lookup_func, 1 << 16,
> > QHT_MODE_AUTO_RESIZE); + }
> > +
> > + val = qht_lookup(&pdu->s->qpf_table, &lookup, hash);
> > +
> > + if (!val) {
> > + if (pdu->s->qp_fullpath_next == 0) {
> > + /* no more files can be mapped :'( */
>
> This would be the place to put the error_report_once() suggested
> in the previous patch actually.
I will add the suggested error message to qid_path_prefixmap() in patch 3 and
then will move over that error message to qid_path_fullmap() in patch 4.
Or if you want I can also leave an error_report_once() in qid_path_prefixmap()
in patch 4 about potential degraded performance.
> > @@ -3779,7 +3831,8 @@ void v9fs_device_unrealize_common(V9fsState *s,
> > Error **errp)>
> > }
> > fsdev_throttle_cleanup(s->ctx.fst);
> > g_free(s->tag);
> >
> > - qpp_table_destroy(&s->qpp_table);
> > + qp_table_destroy(&s->qpp_table);
> > + qp_table_destroy(&s->qpf_table);
>
> I'm starting to think v9fs_device_unrealize_common() should be made
> idempotent, so that it can be used to handle rollback of a partially
> realized device, and thus avoid the code duplication. But this is
> out-of-scope for this series.
Well, I can also make that e.g.:
if (s->qpf_table.map)
qp_table_destroy(&s->qpf_table);
if you prefer the occurrence amount to be reduced.
Best regards,
Christian Schoenebeck
next prev parent reply other threads:[~2019-06-28 14:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 18:57 [Qemu-devel] [PATCH v4 0/5] 9p: Fix file ID collisions Christian Schoenebeck via Qemu-devel
2019-06-26 18:25 ` [Qemu-devel] [PATCH v4 1/5] 9p: unsigned type for type, version, path Christian Schoenebeck via Qemu-devel
2019-06-27 16:12 ` Greg Kurz
2019-06-28 11:42 ` Christian Schoenebeck via Qemu-devel
2019-06-28 12:06 ` Greg Kurz
2019-06-26 18:30 ` [Qemu-devel] [PATCH v4 2/5] 9p: Treat multiple devices on one export as an error Christian Schoenebeck via Qemu-devel
2019-06-27 17:26 ` Greg Kurz
2019-06-28 12:36 ` Christian Schoenebeck via Qemu-devel
2019-06-28 12:47 ` Greg Kurz
2019-06-26 18:42 ` [Qemu-devel] [PATCH v4 3/5] 9p: Added virtfs option "remap_inodes" Christian Schoenebeck via Qemu-devel
2019-06-28 10:09 ` Greg Kurz
2019-06-28 13:47 ` Christian Schoenebeck via Qemu-devel
2019-06-28 14:23 ` Greg Kurz
2019-06-29 10:20 ` Christian Schoenebeck via Qemu-devel
2019-07-02 8:01 ` Greg Kurz
2019-06-26 18:46 ` [Qemu-devel] [PATCH v4 4/5] 9p: stat_to_qid: implement slow path Christian Schoenebeck via Qemu-devel
2019-06-28 10:21 ` Greg Kurz
2019-06-28 14:03 ` Christian Schoenebeck via Qemu-devel [this message]
2019-06-26 18:52 ` [Qemu-devel] [PATCH v4 5/5] 9p: Use variable length suffixes for inode remapping Christian Schoenebeck via Qemu-devel
2019-06-28 11:50 ` Greg Kurz
2019-06-28 14:56 ` Christian Schoenebeck via Qemu-devel
2019-06-29 11:01 ` Christian Schoenebeck via Qemu-devel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4090006.s5PtGRB9R1@silver \
--to=qemu-devel@nongnu.org \
--cc=antonios.motakis@huawei.com \
--cc=berrange@redhat.com \
--cc=groug@kaod.org \
--cc=qemu_oss@crudebyte.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.