Skip to content

Commit 5abbb7b

Browse files
committed
affs: use memcpy_to_page and remove replace kmap_atomic()
The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. For kmap around a memcpy there's a convenience helper memcpy_to_page that also makes the flush_dcache_page() redundant. CC: Fabio M. De Francesco <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 3234649 commit 5abbb7b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

fs/affs/file.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
526526
struct inode *inode = page->mapping->host;
527527
struct super_block *sb = inode->i_sb;
528528
struct buffer_head *bh;
529-
char *data;
530529
unsigned pos = 0;
531530
u32 bidx, boff, bsize;
532531
u32 tmp;
@@ -545,15 +544,12 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
545544
return PTR_ERR(bh);
546545
tmp = min(bsize - boff, to - pos);
547546
BUG_ON(pos + tmp > to || tmp > bsize);
548-
data = kmap_atomic(page);
549-
memcpy(data + pos, AFFS_DATA(bh) + boff, tmp);
550-
kunmap_atomic(data);
547+
memcpy_to_page(page, pos, AFFS_DATA(bh) + boff, tmp);
551548
affs_brelse(bh);
552549
bidx++;
553550
pos += tmp;
554551
boff = 0;
555552
}
556-
flush_dcache_page(page);
557553
return 0;
558554
}
559555

0 commit comments

Comments
 (0)