diff options
Diffstat (limited to 'fs/ntfs/aops.c')
-rw-r--r-- | fs/ntfs/aops.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index ad87cb01299b..00e9ccde8e42 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -87,13 +87,17 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
87 | /* Check for the current buffer head overflowing. */ | 87 | /* Check for the current buffer head overflowing. */ |
88 | if (unlikely(file_ofs + bh->b_size > init_size)) { | 88 | if (unlikely(file_ofs + bh->b_size > init_size)) { |
89 | int ofs; | 89 | int ofs; |
90 | void *kaddr; | ||
90 | 91 | ||
91 | ofs = 0; | 92 | ofs = 0; |
92 | if (file_ofs < init_size) | 93 | if (file_ofs < init_size) |
93 | ofs = init_size - file_ofs; | 94 | ofs = init_size - file_ofs; |
94 | local_irq_save(flags); | 95 | local_irq_save(flags); |
95 | zero_user_page(page, bh_offset(bh) + ofs, | 96 | kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); |
96 | bh->b_size - ofs, KM_BIO_SRC_IRQ); | 97 | memset(kaddr + bh_offset(bh) + ofs, 0, |
98 | bh->b_size - ofs); | ||
99 | flush_dcache_page(page); | ||
100 | kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); | ||
97 | local_irq_restore(flags); | 101 | local_irq_restore(flags); |
98 | } | 102 | } |
99 | } else { | 103 | } else { |
@@ -334,7 +338,7 @@ handle_hole: | |||
334 | bh->b_blocknr = -1UL; | 338 | bh->b_blocknr = -1UL; |
335 | clear_buffer_mapped(bh); | 339 | clear_buffer_mapped(bh); |
336 | handle_zblock: | 340 | handle_zblock: |
337 | zero_user_page(page, i * blocksize, blocksize, KM_USER0); | 341 | zero_user(page, i * blocksize, blocksize); |
338 | if (likely(!err)) | 342 | if (likely(!err)) |
339 | set_buffer_uptodate(bh); | 343 | set_buffer_uptodate(bh); |
340 | } while (i++, iblock++, (bh = bh->b_this_page) != head); | 344 | } while (i++, iblock++, (bh = bh->b_this_page) != head); |
@@ -410,7 +414,7 @@ retry_readpage: | |||
410 | /* Is the page fully outside i_size? (truncate in progress) */ | 414 | /* Is the page fully outside i_size? (truncate in progress) */ |
411 | if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >> | 415 | if (unlikely(page->index >= (i_size + PAGE_CACHE_SIZE - 1) >> |
412 | PAGE_CACHE_SHIFT)) { | 416 | PAGE_CACHE_SHIFT)) { |
413 | zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0); | 417 | zero_user(page, 0, PAGE_CACHE_SIZE); |
414 | ntfs_debug("Read outside i_size - truncated?"); | 418 | ntfs_debug("Read outside i_size - truncated?"); |
415 | goto done; | 419 | goto done; |
416 | } | 420 | } |
@@ -459,7 +463,7 @@ retry_readpage: | |||
459 | * ok to ignore the compressed flag here. | 463 | * ok to ignore the compressed flag here. |
460 | */ | 464 | */ |
461 | if (unlikely(page->index > 0)) { | 465 | if (unlikely(page->index > 0)) { |
462 | zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0); | 466 | zero_user(page, 0, PAGE_CACHE_SIZE); |
463 | goto done; | 467 | goto done; |
464 | } | 468 | } |
465 | if (!NInoAttr(ni)) | 469 | if (!NInoAttr(ni)) |
@@ -788,8 +792,7 @@ lock_retry_remap: | |||
788 | if (err == -ENOENT || lcn == LCN_ENOENT) { | 792 | if (err == -ENOENT || lcn == LCN_ENOENT) { |
789 | bh->b_blocknr = -1; | 793 | bh->b_blocknr = -1; |
790 | clear_buffer_dirty(bh); | 794 | clear_buffer_dirty(bh); |
791 | zero_user_page(page, bh_offset(bh), blocksize, | 795 | zero_user(page, bh_offset(bh), blocksize); |
792 | KM_USER0); | ||
793 | set_buffer_uptodate(bh); | 796 | set_buffer_uptodate(bh); |
794 | err = 0; | 797 | err = 0; |
795 | continue; | 798 | continue; |
@@ -1414,8 +1417,7 @@ retry_writepage: | |||
1414 | if (page->index >= (i_size >> PAGE_CACHE_SHIFT)) { | 1417 | if (page->index >= (i_size >> PAGE_CACHE_SHIFT)) { |
1415 | /* The page straddles i_size. */ | 1418 | /* The page straddles i_size. */ |
1416 | unsigned int ofs = i_size & ~PAGE_CACHE_MASK; | 1419 | unsigned int ofs = i_size & ~PAGE_CACHE_MASK; |
1417 | zero_user_page(page, ofs, PAGE_CACHE_SIZE - ofs, | 1420 | zero_user_segment(page, ofs, PAGE_CACHE_SIZE); |
1418 | KM_USER0); | ||
1419 | } | 1421 | } |
1420 | /* Handle mst protected attributes. */ | 1422 | /* Handle mst protected attributes. */ |
1421 | if (NInoMstProtected(ni)) | 1423 | if (NInoMstProtected(ni)) |