Skip to content

Commit

Permalink
affs: use zero_user_page
Browse files Browse the repository at this point in the history
Use zero_user_page() instead of open-coding it.

Signed-off-by: Nate Diller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
typherno authored and Linus Torvalds committed May 9, 2007
1 parent 01f2705 commit f36dca9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/affs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,7 @@ static int affs_prepare_write_ofs(struct file *file, struct page *page, unsigned
return err;
}
if (to < PAGE_CACHE_SIZE) {
char *kaddr = kmap_atomic(page, KM_USER0);

memset(kaddr + to, 0, PAGE_CACHE_SIZE - to);
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
zero_user_page(page, to, PAGE_CACHE_SIZE - to, KM_USER0);
if (size > offset + to) {
if (size < offset + PAGE_CACHE_SIZE)
tmp = size & ~PAGE_CACHE_MASK;
Expand Down

0 comments on commit f36dca9

Please sign in to comment.