Skip to content

Commit

Permalink
[GFS2] 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]>
Cc: Steven Whitehouse <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
typherno authored and swhiteho committed Jul 9, 2007
1 parent 6c53267 commit 0507ecf
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions fs/gfs2/bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
unsigned blocksize, iblock, length, pos;
struct buffer_head *bh;
struct page *page;
void *kaddr;
int err;

page = grab_cache_page(mapping, index);
Expand Down Expand Up @@ -933,10 +932,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip))
gfs2_trans_add_bh(ip->i_gl, bh, 0);

kaddr = kmap_atomic(page, KM_USER0);
memset(kaddr + offset, 0, length);
flush_dcache_page(page);
kunmap_atomic(kaddr, KM_USER0);
zero_user_page(page, offset, length, KM_USER0);

unlock:
unlock_page(page);
Expand Down

0 comments on commit 0507ecf

Please sign in to comment.