提交 0507ecf5 编写于 作者: N Nate Diller 提交者: Steven Whitehouse

[GFS2] use zero_user_page

Use zero_user_page() instead of open-coding it.
Signed-off-by: NNate Diller <nate.diller@gmail.com>
Cc: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
上级 6c53267f
......@@ -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);
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册