Skip to content

Commit

Permalink
ext4: use memcpy_to_page() in pagecache_write()
Browse files Browse the repository at this point in the history
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Link: https://lore.kernel.org/r/20210207190425.38107-7-chaitanya.kulkarni@wdc.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
Chaitanya Kulkarni authored and Theodore Ts'o committed Mar 25, 2021
1 parent 4d93874 commit bd256fd
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 @@ -77,17 +77,14 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
PAGE_SIZE - offset_in_page(pos));
struct page *page;
void *fsdata;
void *addr;
int res;

res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,
&page, &fsdata);
if (res)
return res;

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

res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n,
page, fsdata);
Expand Down

0 comments on commit bd256fd

Please sign in to comment.