diff options
Diffstat (limited to 'fs/ntfs')
-rw-r--r-- | fs/ntfs/aops.c | 20 | ||||
-rw-r--r-- | fs/ntfs/attrib.c | 20 | ||||
-rw-r--r-- | fs/ntfs/file.c | 16 | ||||
-rw-r--r-- | fs/ntfs/super.c | 8 |
4 files changed, 32 insertions, 32 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index 0b1e885b8cf8..fa9c05f97af4 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
@@ -94,11 +94,11 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
94 | if (file_ofs < init_size) | 94 | if (file_ofs < init_size) |
95 | ofs = init_size - file_ofs; | 95 | ofs = init_size - file_ofs; |
96 | local_irq_save(flags); | 96 | local_irq_save(flags); |
97 | kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); | 97 | kaddr = kmap_atomic(page); |
98 | memset(kaddr + bh_offset(bh) + ofs, 0, | 98 | memset(kaddr + bh_offset(bh) + ofs, 0, |
99 | bh->b_size - ofs); | 99 | bh->b_size - ofs); |
100 | flush_dcache_page(page); | 100 | flush_dcache_page(page); |
101 | kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); | 101 | kunmap_atomic(kaddr); |
102 | local_irq_restore(flags); | 102 | local_irq_restore(flags); |
103 | } | 103 | } |
104 | } else { | 104 | } else { |
@@ -147,11 +147,11 @@ static void ntfs_end_buffer_async_read(struct buffer_head *bh, int uptodate) | |||
147 | /* Should have been verified before we got here... */ | 147 | /* Should have been verified before we got here... */ |
148 | BUG_ON(!recs); | 148 | BUG_ON(!recs); |
149 | local_irq_save(flags); | 149 | local_irq_save(flags); |
150 | kaddr = kmap_atomic(page, KM_BIO_SRC_IRQ); | 150 | kaddr = kmap_atomic(page); |
151 | for (i = 0; i < recs; i++) | 151 | for (i = 0; i < recs; i++) |
152 | post_read_mst_fixup((NTFS_RECORD*)(kaddr + | 152 | post_read_mst_fixup((NTFS_RECORD*)(kaddr + |
153 | i * rec_size), rec_size); | 153 | i * rec_size), rec_size); |
154 | kunmap_atomic(kaddr, KM_BIO_SRC_IRQ); | 154 | kunmap_atomic(kaddr); |
155 | local_irq_restore(flags); | 155 | local_irq_restore(flags); |
156 | flush_dcache_page(page); | 156 | flush_dcache_page(page); |
157 | if (likely(page_uptodate && !PageError(page))) | 157 | if (likely(page_uptodate && !PageError(page))) |
@@ -504,7 +504,7 @@ retry_readpage: | |||
504 | /* Race with shrinking truncate. */ | 504 | /* Race with shrinking truncate. */ |
505 | attr_len = i_size; | 505 | attr_len = i_size; |
506 | } | 506 | } |
507 | addr = kmap_atomic(page, KM_USER0); | 507 | addr = kmap_atomic(page); |
508 | /* Copy the data to the page. */ | 508 | /* Copy the data to the page. */ |
509 | memcpy(addr, (u8*)ctx->attr + | 509 | memcpy(addr, (u8*)ctx->attr + |
510 | le16_to_cpu(ctx->attr->data.resident.value_offset), | 510 | le16_to_cpu(ctx->attr->data.resident.value_offset), |
@@ -512,7 +512,7 @@ retry_readpage: | |||
512 | /* Zero the remainder of the page. */ | 512 | /* Zero the remainder of the page. */ |
513 | memset(addr + attr_len, 0, PAGE_CACHE_SIZE - attr_len); | 513 | memset(addr + attr_len, 0, PAGE_CACHE_SIZE - attr_len); |
514 | flush_dcache_page(page); | 514 | flush_dcache_page(page); |
515 | kunmap_atomic(addr, KM_USER0); | 515 | kunmap_atomic(addr); |
516 | put_unm_err_out: | 516 | put_unm_err_out: |
517 | ntfs_attr_put_search_ctx(ctx); | 517 | ntfs_attr_put_search_ctx(ctx); |
518 | unm_err_out: | 518 | unm_err_out: |
@@ -746,14 +746,14 @@ lock_retry_remap: | |||
746 | unsigned long *bpos, *bend; | 746 | unsigned long *bpos, *bend; |
747 | 747 | ||
748 | /* Check if the buffer is zero. */ | 748 | /* Check if the buffer is zero. */ |
749 | kaddr = kmap_atomic(page, KM_USER0); | 749 | kaddr = kmap_atomic(page); |
750 | bpos = (unsigned long *)(kaddr + bh_offset(bh)); | 750 | bpos = (unsigned long *)(kaddr + bh_offset(bh)); |
751 | bend = (unsigned long *)((u8*)bpos + blocksize); | 751 | bend = (unsigned long *)((u8*)bpos + blocksize); |
752 | do { | 752 | do { |
753 | if (unlikely(*bpos)) | 753 | if (unlikely(*bpos)) |
754 | break; | 754 | break; |
755 | } while (likely(++bpos < bend)); | 755 | } while (likely(++bpos < bend)); |
756 | kunmap_atomic(kaddr, KM_USER0); | 756 | kunmap_atomic(kaddr); |
757 | if (bpos == bend) { | 757 | if (bpos == bend) { |
758 | /* | 758 | /* |
759 | * Buffer is zero and sparse, no need to write | 759 | * Buffer is zero and sparse, no need to write |
@@ -1495,14 +1495,14 @@ retry_writepage: | |||
1495 | /* Shrinking cannot fail. */ | 1495 | /* Shrinking cannot fail. */ |
1496 | BUG_ON(err); | 1496 | BUG_ON(err); |
1497 | } | 1497 | } |
1498 | addr = kmap_atomic(page, KM_USER0); | 1498 | addr = kmap_atomic(page); |
1499 | /* Copy the data from the page to the mft record. */ | 1499 | /* Copy the data from the page to the mft record. */ |
1500 | memcpy((u8*)ctx->attr + | 1500 | memcpy((u8*)ctx->attr + |
1501 | le16_to_cpu(ctx->attr->data.resident.value_offset), | 1501 | le16_to_cpu(ctx->attr->data.resident.value_offset), |
1502 | addr, attr_len); | 1502 | addr, attr_len); |
1503 | /* Zero out of bounds area in the page cache page. */ | 1503 | /* Zero out of bounds area in the page cache page. */ |
1504 | memset(addr + attr_len, 0, PAGE_CACHE_SIZE - attr_len); | 1504 | memset(addr + attr_len, 0, PAGE_CACHE_SIZE - attr_len); |
1505 | kunmap_atomic(addr, KM_USER0); | 1505 | kunmap_atomic(addr); |
1506 | flush_dcache_page(page); | 1506 | flush_dcache_page(page); |
1507 | flush_dcache_mft_record_page(ctx->ntfs_ino); | 1507 | flush_dcache_mft_record_page(ctx->ntfs_ino); |
1508 | /* We are done with the page. */ | 1508 | /* We are done with the page. */ |
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index e0281992ddc3..a27e3fecefaf 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
@@ -1656,12 +1656,12 @@ int ntfs_attr_make_non_resident(ntfs_inode *ni, const u32 data_size) | |||
1656 | attr_size = le32_to_cpu(a->data.resident.value_length); | 1656 | attr_size = le32_to_cpu(a->data.resident.value_length); |
1657 | BUG_ON(attr_size != data_size); | 1657 | BUG_ON(attr_size != data_size); |
1658 | if (page && !PageUptodate(page)) { | 1658 | if (page && !PageUptodate(page)) { |
1659 | kaddr = kmap_atomic(page, KM_USER0); | 1659 | kaddr = kmap_atomic(page); |
1660 | memcpy(kaddr, (u8*)a + | 1660 | memcpy(kaddr, (u8*)a + |
1661 | le16_to_cpu(a->data.resident.value_offset), | 1661 | le16_to_cpu(a->data.resident.value_offset), |
1662 | attr_size); | 1662 | attr_size); |
1663 | memset(kaddr + attr_size, 0, PAGE_CACHE_SIZE - attr_size); | 1663 | memset(kaddr + attr_size, 0, PAGE_CACHE_SIZE - attr_size); |
1664 | kunmap_atomic(kaddr, KM_USER0); | 1664 | kunmap_atomic(kaddr); |
1665 | flush_dcache_page(page); | 1665 | flush_dcache_page(page); |
1666 | SetPageUptodate(page); | 1666 | SetPageUptodate(page); |
1667 | } | 1667 | } |
@@ -1806,9 +1806,9 @@ undo_err_out: | |||
1806 | sizeof(a->data.resident.reserved)); | 1806 | sizeof(a->data.resident.reserved)); |
1807 | /* Copy the data from the page back to the attribute value. */ | 1807 | /* Copy the data from the page back to the attribute value. */ |
1808 | if (page) { | 1808 | if (page) { |
1809 | kaddr = kmap_atomic(page, KM_USER0); | 1809 | kaddr = kmap_atomic(page); |
1810 | memcpy((u8*)a + mp_ofs, kaddr, attr_size); | 1810 | memcpy((u8*)a + mp_ofs, kaddr, attr_size); |
1811 | kunmap_atomic(kaddr, KM_USER0); | 1811 | kunmap_atomic(kaddr); |
1812 | } | 1812 | } |
1813 | /* Setup the allocated size in the ntfs inode in case it changed. */ | 1813 | /* Setup the allocated size in the ntfs inode in case it changed. */ |
1814 | write_lock_irqsave(&ni->size_lock, flags); | 1814 | write_lock_irqsave(&ni->size_lock, flags); |
@@ -2540,10 +2540,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val) | |||
2540 | size = PAGE_CACHE_SIZE; | 2540 | size = PAGE_CACHE_SIZE; |
2541 | if (idx == end) | 2541 | if (idx == end) |
2542 | size = end_ofs; | 2542 | size = end_ofs; |
2543 | kaddr = kmap_atomic(page, KM_USER0); | 2543 | kaddr = kmap_atomic(page); |
2544 | memset(kaddr + start_ofs, val, size - start_ofs); | 2544 | memset(kaddr + start_ofs, val, size - start_ofs); |
2545 | flush_dcache_page(page); | 2545 | flush_dcache_page(page); |
2546 | kunmap_atomic(kaddr, KM_USER0); | 2546 | kunmap_atomic(kaddr); |
2547 | set_page_dirty(page); | 2547 | set_page_dirty(page); |
2548 | page_cache_release(page); | 2548 | page_cache_release(page); |
2549 | balance_dirty_pages_ratelimited(mapping); | 2549 | balance_dirty_pages_ratelimited(mapping); |
@@ -2561,10 +2561,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val) | |||
2561 | "page (index 0x%lx).", idx); | 2561 | "page (index 0x%lx).", idx); |
2562 | return -ENOMEM; | 2562 | return -ENOMEM; |
2563 | } | 2563 | } |
2564 | kaddr = kmap_atomic(page, KM_USER0); | 2564 | kaddr = kmap_atomic(page); |
2565 | memset(kaddr, val, PAGE_CACHE_SIZE); | 2565 | memset(kaddr, val, PAGE_CACHE_SIZE); |
2566 | flush_dcache_page(page); | 2566 | flush_dcache_page(page); |
2567 | kunmap_atomic(kaddr, KM_USER0); | 2567 | kunmap_atomic(kaddr); |
2568 | /* | 2568 | /* |
2569 | * If the page has buffers, mark them uptodate since buffer | 2569 | * If the page has buffers, mark them uptodate since buffer |
2570 | * state and not page state is definitive in 2.6 kernels. | 2570 | * state and not page state is definitive in 2.6 kernels. |
@@ -2598,10 +2598,10 @@ int ntfs_attr_set(ntfs_inode *ni, const s64 ofs, const s64 cnt, const u8 val) | |||
2598 | "(error, index 0x%lx).", idx); | 2598 | "(error, index 0x%lx).", idx); |
2599 | return PTR_ERR(page); | 2599 | return PTR_ERR(page); |
2600 | } | 2600 | } |
2601 | kaddr = kmap_atomic(page, KM_USER0); | 2601 | kaddr = kmap_atomic(page); |
2602 | memset(kaddr, val, end_ofs); | 2602 | memset(kaddr, val, end_ofs); |
2603 | flush_dcache_page(page); | 2603 | flush_dcache_page(page); |
2604 | kunmap_atomic(kaddr, KM_USER0); | 2604 | kunmap_atomic(kaddr); |
2605 | set_page_dirty(page); | 2605 | set_page_dirty(page); |
2606 | page_cache_release(page); | 2606 | page_cache_release(page); |
2607 | balance_dirty_pages_ratelimited(mapping); | 2607 | balance_dirty_pages_ratelimited(mapping); |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index c587e2d27183..8639169221c7 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
@@ -704,7 +704,7 @@ map_buffer_cached: | |||
704 | u8 *kaddr; | 704 | u8 *kaddr; |
705 | unsigned pofs; | 705 | unsigned pofs; |
706 | 706 | ||
707 | kaddr = kmap_atomic(page, KM_USER0); | 707 | kaddr = kmap_atomic(page); |
708 | if (bh_pos < pos) { | 708 | if (bh_pos < pos) { |
709 | pofs = bh_pos & ~PAGE_CACHE_MASK; | 709 | pofs = bh_pos & ~PAGE_CACHE_MASK; |
710 | memset(kaddr + pofs, 0, pos - bh_pos); | 710 | memset(kaddr + pofs, 0, pos - bh_pos); |
@@ -713,7 +713,7 @@ map_buffer_cached: | |||
713 | pofs = end & ~PAGE_CACHE_MASK; | 713 | pofs = end & ~PAGE_CACHE_MASK; |
714 | memset(kaddr + pofs, 0, bh_end - end); | 714 | memset(kaddr + pofs, 0, bh_end - end); |
715 | } | 715 | } |
716 | kunmap_atomic(kaddr, KM_USER0); | 716 | kunmap_atomic(kaddr); |
717 | flush_dcache_page(page); | 717 | flush_dcache_page(page); |
718 | } | 718 | } |
719 | continue; | 719 | continue; |
@@ -1287,9 +1287,9 @@ static inline size_t ntfs_copy_from_user(struct page **pages, | |||
1287 | len = PAGE_CACHE_SIZE - ofs; | 1287 | len = PAGE_CACHE_SIZE - ofs; |
1288 | if (len > bytes) | 1288 | if (len > bytes) |
1289 | len = bytes; | 1289 | len = bytes; |
1290 | addr = kmap_atomic(*pages, KM_USER0); | 1290 | addr = kmap_atomic(*pages); |
1291 | left = __copy_from_user_inatomic(addr + ofs, buf, len); | 1291 | left = __copy_from_user_inatomic(addr + ofs, buf, len); |
1292 | kunmap_atomic(addr, KM_USER0); | 1292 | kunmap_atomic(addr); |
1293 | if (unlikely(left)) { | 1293 | if (unlikely(left)) { |
1294 | /* Do it the slow way. */ | 1294 | /* Do it the slow way. */ |
1295 | addr = kmap(*pages); | 1295 | addr = kmap(*pages); |
@@ -1401,10 +1401,10 @@ static inline size_t ntfs_copy_from_user_iovec(struct page **pages, | |||
1401 | len = PAGE_CACHE_SIZE - ofs; | 1401 | len = PAGE_CACHE_SIZE - ofs; |
1402 | if (len > bytes) | 1402 | if (len > bytes) |
1403 | len = bytes; | 1403 | len = bytes; |
1404 | addr = kmap_atomic(*pages, KM_USER0); | 1404 | addr = kmap_atomic(*pages); |
1405 | copied = __ntfs_copy_from_user_iovec_inatomic(addr + ofs, | 1405 | copied = __ntfs_copy_from_user_iovec_inatomic(addr + ofs, |
1406 | *iov, *iov_ofs, len); | 1406 | *iov, *iov_ofs, len); |
1407 | kunmap_atomic(addr, KM_USER0); | 1407 | kunmap_atomic(addr); |
1408 | if (unlikely(copied != len)) { | 1408 | if (unlikely(copied != len)) { |
1409 | /* Do it the slow way. */ | 1409 | /* Do it the slow way. */ |
1410 | addr = kmap(*pages); | 1410 | addr = kmap(*pages); |
@@ -1691,7 +1691,7 @@ static int ntfs_commit_pages_after_write(struct page **pages, | |||
1691 | BUG_ON(end > le32_to_cpu(a->length) - | 1691 | BUG_ON(end > le32_to_cpu(a->length) - |
1692 | le16_to_cpu(a->data.resident.value_offset)); | 1692 | le16_to_cpu(a->data.resident.value_offset)); |
1693 | kattr = (u8*)a + le16_to_cpu(a->data.resident.value_offset); | 1693 | kattr = (u8*)a + le16_to_cpu(a->data.resident.value_offset); |
1694 | kaddr = kmap_atomic(page, KM_USER0); | 1694 | kaddr = kmap_atomic(page); |
1695 | /* Copy the received data from the page to the mft record. */ | 1695 | /* Copy the received data from the page to the mft record. */ |
1696 | memcpy(kattr + pos, kaddr + pos, bytes); | 1696 | memcpy(kattr + pos, kaddr + pos, bytes); |
1697 | /* Update the attribute length if necessary. */ | 1697 | /* Update the attribute length if necessary. */ |
@@ -1713,7 +1713,7 @@ static int ntfs_commit_pages_after_write(struct page **pages, | |||
1713 | flush_dcache_page(page); | 1713 | flush_dcache_page(page); |
1714 | SetPageUptodate(page); | 1714 | SetPageUptodate(page); |
1715 | } | 1715 | } |
1716 | kunmap_atomic(kaddr, KM_USER0); | 1716 | kunmap_atomic(kaddr); |
1717 | /* Update initialized_size/i_size if necessary. */ | 1717 | /* Update initialized_size/i_size if necessary. */ |
1718 | read_lock_irqsave(&ni->size_lock, flags); | 1718 | read_lock_irqsave(&ni->size_lock, flags); |
1719 | initialized_size = ni->initialized_size; | 1719 | initialized_size = ni->initialized_size; |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index f907611cca73..28d4e6ab6634 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -2473,7 +2473,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol) | |||
2473 | nr_free -= PAGE_CACHE_SIZE * 8; | 2473 | nr_free -= PAGE_CACHE_SIZE * 8; |
2474 | continue; | 2474 | continue; |
2475 | } | 2475 | } |
2476 | kaddr = kmap_atomic(page, KM_USER0); | 2476 | kaddr = kmap_atomic(page); |
2477 | /* | 2477 | /* |
2478 | * Subtract the number of set bits. If this | 2478 | * Subtract the number of set bits. If this |
2479 | * is the last page and it is partial we don't really care as | 2479 | * is the last page and it is partial we don't really care as |
@@ -2483,7 +2483,7 @@ static s64 get_nr_free_clusters(ntfs_volume *vol) | |||
2483 | */ | 2483 | */ |
2484 | nr_free -= bitmap_weight(kaddr, | 2484 | nr_free -= bitmap_weight(kaddr, |
2485 | PAGE_CACHE_SIZE * BITS_PER_BYTE); | 2485 | PAGE_CACHE_SIZE * BITS_PER_BYTE); |
2486 | kunmap_atomic(kaddr, KM_USER0); | 2486 | kunmap_atomic(kaddr); |
2487 | page_cache_release(page); | 2487 | page_cache_release(page); |
2488 | } | 2488 | } |
2489 | ntfs_debug("Finished reading $Bitmap, last index = 0x%lx.", index - 1); | 2489 | ntfs_debug("Finished reading $Bitmap, last index = 0x%lx.", index - 1); |
@@ -2544,7 +2544,7 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, | |||
2544 | nr_free -= PAGE_CACHE_SIZE * 8; | 2544 | nr_free -= PAGE_CACHE_SIZE * 8; |
2545 | continue; | 2545 | continue; |
2546 | } | 2546 | } |
2547 | kaddr = kmap_atomic(page, KM_USER0); | 2547 | kaddr = kmap_atomic(page); |
2548 | /* | 2548 | /* |
2549 | * Subtract the number of set bits. If this | 2549 | * Subtract the number of set bits. If this |
2550 | * is the last page and it is partial we don't really care as | 2550 | * is the last page and it is partial we don't really care as |
@@ -2554,7 +2554,7 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, | |||
2554 | */ | 2554 | */ |
2555 | nr_free -= bitmap_weight(kaddr, | 2555 | nr_free -= bitmap_weight(kaddr, |
2556 | PAGE_CACHE_SIZE * BITS_PER_BYTE); | 2556 | PAGE_CACHE_SIZE * BITS_PER_BYTE); |
2557 | kunmap_atomic(kaddr, KM_USER0); | 2557 | kunmap_atomic(kaddr); |
2558 | page_cache_release(page); | 2558 | page_cache_release(page); |
2559 | } | 2559 | } |
2560 | ntfs_debug("Finished reading $MFT/$BITMAP, last index = 0x%lx.", | 2560 | ntfs_debug("Finished reading $MFT/$BITMAP, last index = 0x%lx.", |