ext4: use memcpy_to_page() in pagecache_write()
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>
This commit is contained in:
committed by
Theodore Ts'o
parent
4d93874b9e
commit
bd256fda92
@@ -77,7 +77,6 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
|
|||||||
PAGE_SIZE - offset_in_page(pos));
|
PAGE_SIZE - offset_in_page(pos));
|
||||||
struct page *page;
|
struct page *page;
|
||||||
void *fsdata;
|
void *fsdata;
|
||||||
void *addr;
|
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,
|
res = pagecache_write_begin(NULL, inode->i_mapping, pos, n, 0,
|
||||||
@@ -85,9 +84,7 @@ static int pagecache_write(struct inode *inode, const void *buf, size_t count,
|
|||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
addr = kmap_atomic(page);
|
memcpy_to_page(page, offset_in_page(pos), buf, n);
|
||||||
memcpy(addr + offset_in_page(pos), buf, n);
|
|
||||||
kunmap_atomic(addr);
|
|
||||||
|
|
||||||
res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n,
|
res = pagecache_write_end(NULL, inode->i_mapping, pos, n, n,
|
||||||
page, fsdata);
|
page, fsdata);
|
||||||
|
Reference in New Issue
Block a user