Message ID | 20240306051548.90954-1-flyingpeng@tencent.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | xen/blkback: use kmap_local_page() | expand |
On Wed, Mar 06, 2024 at 01:15:48PM +0800, flyingpenghao@gmail.com wrote: > From: Peng Hao <flyingpeng@tencent.com> > > From: Peng Hao <flyingpeng@tencent.com> > > Use kmap_local_page() instead of kmap_atomic() which has been > deprecated. > > Signed-off-by: Peng Hao <flyingpeng@tencent.com> > --- > drivers/block/xen-blkback/blkback.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c > index 4defd7f387c7..cce534f43292 100644 > --- a/drivers/block/xen-blkback/blkback.c > +++ b/drivers/block/xen-blkback/blkback.c > @@ -937,8 +937,8 @@ static int xen_blkbk_parse_indirect(struct blkif_request *req, > if ((n % SEGS_PER_INDIRECT_FRAME) == 0) { > /* Map indirect segments */ > if (segments) > - kunmap_atomic(segments); > - segments = kmap_atomic(pages[n/SEGS_PER_INDIRECT_FRAME]->page); > + kunmap_local(segments); > + segments = kmap_local_page(pages[n/SEGS_PER_INDIRECT_FRAME]->page); Don't you need to also switch to kunmap_local() then instead of kunmap_atomic()? Thanks, Roger.
On Wed, Mar 6, 2024 at 4:41 PM Roger Pau Monné <roger.pau@citrix.com> wrote: > > On Wed, Mar 06, 2024 at 01:15:48PM +0800, flyingpenghao@gmail.com wrote: > > From: Peng Hao <flyingpeng@tencent.com> > > > > From: Peng Hao <flyingpeng@tencent.com> > > > > Use kmap_local_page() instead of kmap_atomic() which has been > > deprecated. > > > > Signed-off-by: Peng Hao <flyingpeng@tencent.com> > > --- > > drivers/block/xen-blkback/blkback.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c > > index 4defd7f387c7..cce534f43292 100644 > > --- a/drivers/block/xen-blkback/blkback.c > > +++ b/drivers/block/xen-blkback/blkback.c > > @@ -937,8 +937,8 @@ static int xen_blkbk_parse_indirect(struct blkif_request *req, > > if ((n % SEGS_PER_INDIRECT_FRAME) == 0) { > > /* Map indirect segments */ > > if (segments) > > - kunmap_atomic(segments); > > - segments = kmap_atomic(pages[n/SEGS_PER_INDIRECT_FRAME]->page); > > + kunmap_local(segments); > > + segments = kmap_local_page(pages[n/SEGS_PER_INDIRECT_FRAME]->page); > > Don't you need to also switch to kunmap_local() then instead of > kunmap_atomic()? kmap_local() and kunmap_local() are paired. I found that I missed a modification, I will re-issue patch v2 Thanks. > > Thanks, Roger.
diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c index 4defd7f387c7..cce534f43292 100644 --- a/drivers/block/xen-blkback/blkback.c +++ b/drivers/block/xen-blkback/blkback.c @@ -937,8 +937,8 @@ static int xen_blkbk_parse_indirect(struct blkif_request *req, if ((n % SEGS_PER_INDIRECT_FRAME) == 0) { /* Map indirect segments */ if (segments) - kunmap_atomic(segments); - segments = kmap_atomic(pages[n/SEGS_PER_INDIRECT_FRAME]->page); + kunmap_local(segments); + segments = kmap_local_page(pages[n/SEGS_PER_INDIRECT_FRAME]->page); } i = n % SEGS_PER_INDIRECT_FRAME;