From: "Durrant, Paul" <pdurrant@amazon.com>
To: "Durrant, Paul" <pdurrant@amazon.com>,
"Roger Pau Monné" <roger.pau@citrix.com>
Cc: Jens Axboe <axboe@kernel.dk>, Juergen Gross <jgross@suse.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: RE: [PATCH v2 4/4] xen-blkback: support dynamic unbind/bind
Date: Wed, 11 Dec 2019 14:46:11 +0000 [thread overview]
Message-ID: <c5a9cf1d080046b0b2d9e9a5579aeb75@EX13D32EUC003.ant.amazon.com> (raw)
In-Reply-To: <93f85e6b45eb4286b34ae12ea726038c@EX13D32EUC003.ant.amazon.com>
> -----Original Message-----
> > > diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-
> > blkback/xenbus.c
> > > index e8c5c54e1d26..13d09630b237 100644
> > > --- a/drivers/block/xen-blkback/xenbus.c
> > > +++ b/drivers/block/xen-blkback/xenbus.c
> > > @@ -181,6 +181,8 @@ static int xen_blkif_map(struct xen_blkif_ring
> > *ring, grant_ref_t *gref,
> > > {
> > > int err;
> > > struct xen_blkif *blkif = ring->blkif;
> > > + struct blkif_common_sring *sring_common;
> > > + RING_IDX rsp_prod, req_prod;
> > >
> > > /* Already connected through? */
> > > if (ring->irq)
> > > @@ -191,46 +193,66 @@ static int xen_blkif_map(struct xen_blkif_ring
> > *ring, grant_ref_t *gref,
> > > if (err < 0)
> > > return err;
> > >
> > > + sring_common = (struct blkif_common_sring *)ring->blk_ring;
> > > + rsp_prod = READ_ONCE(sring_common->rsp_prod);
> > > + req_prod = READ_ONCE(sring_common->req_prod);
> > > +
> > > switch (blkif->blk_protocol) {
> > > case BLKIF_PROTOCOL_NATIVE:
> > > {
> > > - struct blkif_sring *sring;
> > > - sring = (struct blkif_sring *)ring->blk_ring;
> > > - BACK_RING_INIT(&ring->blk_rings.native, sring,
> > > - XEN_PAGE_SIZE * nr_grefs);
> > > + struct blkif_sring *sring_native =
> > > + (struct blkif_sring *)ring->blk_ring;
> >
> > I think you can constify both sring_native and sring_common (and the
> > other instances below).
>
> Yes, I can do that. I don't think the macros would mind.
>
Spoke to soon. They do mind, of course, because the sring pointer in the front/back ring is not (and should not) be const. I can const sring_common but no others.
Paul
prev parent reply other threads:[~2019-12-11 14:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-10 11:33 [PATCH v2 0/4] xen-blkback: support live update Paul Durrant
2019-12-10 11:33 ` [PATCH v2 1/4] xenbus: move xenbus_dev_shutdown() into frontend code Paul Durrant
2019-12-10 11:33 ` [PATCH v2 2/4] xenbus: limit when state is forced to closed Paul Durrant
2019-12-11 10:06 ` [Xen-devel] " Roger Pau Monné
2019-12-11 10:14 ` Durrant, Paul
2019-12-11 10:21 ` Jürgen Groß
2019-12-11 13:29 ` Durrant, Paul
2019-12-10 11:33 ` [PATCH v2 3/4] xen/interface: re-define FRONT/BACK_RING_ATTACH() Paul Durrant
2019-12-10 11:33 ` [PATCH v2 4/4] xen-blkback: support dynamic unbind/bind Paul Durrant
2019-12-11 10:45 ` Roger Pau Monné
2019-12-11 10:52 ` Durrant, Paul
2019-12-11 14:46 ` Durrant, Paul [this message]
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=c5a9cf1d080046b0b2d9e9a5579aeb75@EX13D32EUC003.ant.amazon.com \
--to=pdurrant@amazon.com \
--cc=axboe@kernel.dk \
--cc=boris.ostrovsky@oracle.com \
--cc=jgross@suse.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®