Skip to content

Commit 58721bd

Browse files
hidrv4Andreas Gruenbacher
authored andcommitted
gfs2: Replace deprecated kmap_atomic with kmap_local_page
kmap_atomic() is deprecated in favor of kmap_local_{folio,page}(). Therefore, replace kmap_atomic() with kmap_local_page() in gfs2_internal_read() and stuffed_readpage(). kmap_atomic() disables page-faults and preemption (the latter only for !PREEMPT_RT kernels), However, the code within the mapping/un-mapping in gfs2_internal_read() and stuffed_readpage() does not depend on the above-mentioned side effects. Therefore, a mere replacement of the old API with the new one is all that is required (i.e., there is no need to explicitly add any calls to pagefault_disable() and/or preempt_disable()). Signed-off-by: Deepak R Varma <drv@mailo.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent f246dd4 commit 58721bd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/gfs2/aops.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,10 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
431431
if (error)
432432
return error;
433433

434-
kaddr = kmap_atomic(page);
434+
kaddr = kmap_local_page(page);
435435
memcpy(kaddr, dibh->b_data + sizeof(struct gfs2_dinode), dsize);
436436
memset(kaddr + dsize, 0, PAGE_SIZE - dsize);
437-
kunmap_atomic(kaddr);
437+
kunmap_local(kaddr);
438438
flush_dcache_page(page);
439439
brelse(dibh);
440440
SetPageUptodate(page);
@@ -497,12 +497,12 @@ int gfs2_internal_read(struct gfs2_inode *ip, char *buf, loff_t *pos,
497497
continue;
498498
return PTR_ERR(page);
499499
}
500-
p = kmap_atomic(page);
500+
p = kmap_local_page(page);
501501
amt = size - copied;
502502
if (offset + size > PAGE_SIZE)
503503
amt = PAGE_SIZE - offset;
504504
memcpy(buf + copied, p + offset, amt);
505-
kunmap_atomic(p);
505+
kunmap_local(p);
506506
put_page(page);
507507
copied += amt;
508508
index++;

0 commit comments

Comments
 (0)