All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]  xen/blkback: use kmap_local_page()
@ 2024-03-06  5:15 flyingpenghao
  2024-03-06  8:41 ` Roger Pau Monné
  0 siblings, 1 reply; 3+ messages in thread
From: flyingpenghao @ 2024-03-06  5:15 UTC (permalink / raw)
  To: roger.pau; +Cc: xen-devel, Peng Hao

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);
 		}
 		i = n % SEGS_PER_INDIRECT_FRAME;
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH]  xen/blkback: use kmap_local_page()
  2024-03-06  5:15 [PATCH] xen/blkback: use kmap_local_page() flyingpenghao
@ 2024-03-06  8:41 ` Roger Pau Monné
  2024-03-14 13:28   ` Hao Peng
  0 siblings, 1 reply; 3+ messages in thread
From: Roger Pau Monné @ 2024-03-06  8:41 UTC (permalink / raw)
  To: flyingpenghao; +Cc: xen-devel, Peng Hao

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xen/blkback: use kmap_local_page()
  2024-03-06  8:41 ` Roger Pau Monné
@ 2024-03-14 13:28   ` Hao Peng
  0 siblings, 0 replies; 3+ messages in thread
From: Hao Peng @ 2024-03-14 13:28 UTC (permalink / raw)
  To: Roger Pau Monné; +Cc: xen-devel, Peng Hao

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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-14 13:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-06  5:15 [PATCH] xen/blkback: use kmap_local_page() flyingpenghao
2024-03-06  8:41 ` Roger Pau Monné
2024-03-14 13:28   ` Hao Peng

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.