Skip to content

Commit

Permalink
ext4: use memcpy_from_page() in pagecache_read()
Browse files Browse the repository at this point in the history
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
  • Loading branch information
ChaitanayaKulkarni authored and intel-lab-lkp committed Feb 7, 2021
1 parent e13c882 commit f431d96
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/ext4/verity.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,13 @@ static int pagecache_read(struct inode *inode, void *buf, size_t count,
size_t n = min_t(size_t, count,
PAGE_SIZE - offset_in_page(pos));
struct page *page;
void *addr;

page = read_mapping_page(inode->i_mapping, pos >> PAGE_SHIFT,
NULL);
if (IS_ERR(page))
return PTR_ERR(page);

addr = kmap_atomic(page);
memcpy(buf, addr + offset_in_page(pos), n);
kunmap_atomic(addr);
memcpy_from_page(buf, page, offset_in_page(pos), n);

put_page(page);

Expand Down

0 comments on commit f431d96

Please sign in to comment.