aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext3/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext3/inode.c')
-rw-r--r--fs/ext3/inode.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
index e1bb03171986..a6cb6171c3af 100644
--- a/fs/ext3/inode.c
+++ b/fs/ext3/inode.c
@@ -1767,7 +1767,6 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
1767 struct inode *inode = mapping->host; 1767 struct inode *inode = mapping->host;
1768 struct buffer_head *bh; 1768 struct buffer_head *bh;
1769 int err = 0; 1769 int err = 0;
1770 void *kaddr;
1771 1770
1772 blocksize = inode->i_sb->s_blocksize; 1771 blocksize = inode->i_sb->s_blocksize;
1773 length = blocksize - (offset & (blocksize - 1)); 1772 length = blocksize - (offset & (blocksize - 1));
@@ -1779,10 +1778,7 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
1779 */ 1778 */
1780 if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) && 1779 if (!page_has_buffers(page) && test_opt(inode->i_sb, NOBH) &&
1781 ext3_should_writeback_data(inode) && PageUptodate(page)) { 1780 ext3_should_writeback_data(inode) && PageUptodate(page)) {
1782 kaddr = kmap_atomic(page, KM_USER0); 1781 zero_user_page(page, offset, length, KM_USER0);
1783 memset(kaddr + offset, 0, length);
1784 flush_dcache_page(page);
1785 kunmap_atomic(kaddr, KM_USER0);
1786 set_page_dirty(page); 1782 set_page_dirty(page);
1787 goto unlock; 1783 goto unlock;
1788 } 1784 }
@@ -1835,11 +1831,7 @@ static int ext3_block_truncate_page(handle_t *handle, struct page *page,
1835 goto unlock; 1831 goto unlock;
1836 } 1832 }
1837 1833
1838 kaddr = kmap_atomic(page, KM_USER0); 1834 zero_user_page(page, offset, length, KM_USER0);
1839 memset(kaddr + offset, 0, length);
1840 flush_dcache_page(page);
1841 kunmap_atomic(kaddr, KM_USER0);
1842
1843 BUFFER_TRACE(bh, "zeroed end of block"); 1835 BUFFER_TRACE(bh, "zeroed end of block");
1844 1836
1845 err = 0; 1837 err = 0;