diff options
author | Eric Sandeen <sandeen@redhat.com> | 2007-06-20 20:15:10 -0400 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2007-07-10 20:32:10 -0400 |
commit | 54c57dc3b6578356c0a428c767d4bf080254a2ee (patch) | |
tree | 009484927ae335d7a6312aa5a53c0bcd90d92a9e /fs/ocfs2/aops.c | |
parent | b25801038da5823bba1b5440a57ca68afc51b6bd (diff) |
[PATCH] ocfs2: zero_user_page conversion
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index ec8b606b30e1..84bf6e79de23 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -740,18 +740,13 @@ int ocfs2_map_page_blocks(struct page *page, u64 *p_blkno, | |||
740 | bh = head; | 740 | bh = head; |
741 | block_start = 0; | 741 | block_start = 0; |
742 | do { | 742 | do { |
743 | void *kaddr; | ||
744 | |||
745 | block_end = block_start + bsize; | 743 | block_end = block_start + bsize; |
746 | if (block_end <= from) | 744 | if (block_end <= from) |
747 | goto next_bh; | 745 | goto next_bh; |
748 | if (block_start >= to) | 746 | if (block_start >= to) |
749 | break; | 747 | break; |
750 | 748 | ||
751 | kaddr = kmap_atomic(page, KM_USER0); | 749 | zero_user_page(page, block_start, bh->b_size, KM_USER0); |
752 | memset(kaddr+block_start, 0, bh->b_size); | ||
753 | flush_dcache_page(page); | ||
754 | kunmap_atomic(kaddr, KM_USER0); | ||
755 | set_buffer_uptodate(bh); | 750 | set_buffer_uptodate(bh); |
756 | mark_buffer_dirty(bh); | 751 | mark_buffer_dirty(bh); |
757 | 752 | ||
@@ -906,15 +901,11 @@ static void ocfs2_zero_new_buffers(struct page *page, unsigned from, unsigned to | |||
906 | if (block_end > from && block_start < to) { | 901 | if (block_end > from && block_start < to) { |
907 | if (!PageUptodate(page)) { | 902 | if (!PageUptodate(page)) { |
908 | unsigned start, end; | 903 | unsigned start, end; |
909 | void *kaddr; | ||
910 | 904 | ||
911 | start = max(from, block_start); | 905 | start = max(from, block_start); |
912 | end = min(to, block_end); | 906 | end = min(to, block_end); |
913 | 907 | ||
914 | kaddr = kmap_atomic(page, KM_USER0); | 908 | zero_user_page(page, start, end - start, KM_USER0); |
915 | memset(kaddr+start, 0, end - start); | ||
916 | flush_dcache_page(page); | ||
917 | kunmap_atomic(kaddr, KM_USER0); | ||
918 | set_buffer_uptodate(bh); | 909 | set_buffer_uptodate(bh); |
919 | } | 910 | } |
920 | 911 | ||