diff options
Diffstat (limited to 'fs/ntfs')
| -rw-r--r-- | fs/ntfs/aops.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/attrib.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/compress.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/dir.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/file.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/index.c | 2 | ||||
| -rw-r--r-- | fs/ntfs/mft.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/namei.c | 1 | ||||
| -rw-r--r-- | fs/ntfs/super.c | 25 |
9 files changed, 22 insertions, 12 deletions
diff --git a/fs/ntfs/aops.c b/fs/ntfs/aops.c index cfce53cb65d7..c3c2c7ac9020 100644 --- a/fs/ntfs/aops.c +++ b/fs/ntfs/aops.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | 23 | ||
| 24 | #include <linux/errno.h> | 24 | #include <linux/errno.h> |
| 25 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
| 26 | #include <linux/gfp.h> | ||
| 26 | #include <linux/mm.h> | 27 | #include <linux/mm.h> |
| 27 | #include <linux/pagemap.h> | 28 | #include <linux/pagemap.h> |
| 28 | #include <linux/swap.h> | 29 | #include <linux/swap.h> |
diff --git a/fs/ntfs/attrib.c b/fs/ntfs/attrib.c index 50d3b0c258e3..f5094ee224c1 100644 --- a/fs/ntfs/attrib.c +++ b/fs/ntfs/attrib.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #include <linux/buffer_head.h> | 23 | #include <linux/buffer_head.h> |
| 24 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
| 25 | #include <linux/slab.h> | ||
| 25 | #include <linux/swap.h> | 26 | #include <linux/swap.h> |
| 26 | #include <linux/writeback.h> | 27 | #include <linux/writeback.h> |
| 27 | 28 | ||
diff --git a/fs/ntfs/compress.c b/fs/ntfs/compress.c index 08f7530e9341..6551c7cbad92 100644 --- a/fs/ntfs/compress.c +++ b/fs/ntfs/compress.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/buffer_head.h> | 25 | #include <linux/buffer_head.h> |
| 26 | #include <linux/blkdev.h> | 26 | #include <linux/blkdev.h> |
| 27 | #include <linux/vmalloc.h> | 27 | #include <linux/vmalloc.h> |
| 28 | #include <linux/slab.h> | ||
| 28 | 29 | ||
| 29 | #include "attrib.h" | 30 | #include "attrib.h" |
| 30 | #include "inode.h" | 31 | #include "inode.h" |
diff --git a/fs/ntfs/dir.c b/fs/ntfs/dir.c index 9173e82a45d1..fe44d3feee4a 100644 --- a/fs/ntfs/dir.c +++ b/fs/ntfs/dir.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/buffer_head.h> | 23 | #include <linux/buffer_head.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | 25 | ||
| 25 | #include "dir.h" | 26 | #include "dir.h" |
| 26 | #include "aops.h" | 27 | #include "aops.h" |
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c index b681c71d7069..8804f093ba75 100644 --- a/fs/ntfs/file.c +++ b/fs/ntfs/file.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <linux/buffer_head.h> | 22 | #include <linux/buffer_head.h> |
| 23 | #include <linux/gfp.h> | ||
| 23 | #include <linux/pagemap.h> | 24 | #include <linux/pagemap.h> |
| 24 | #include <linux/pagevec.h> | 25 | #include <linux/pagevec.h> |
| 25 | #include <linux/sched.h> | 26 | #include <linux/sched.h> |
diff --git a/fs/ntfs/index.c b/fs/ntfs/index.c index 2194eff49743..096c135691ae 100644 --- a/fs/ntfs/index.c +++ b/fs/ntfs/index.c | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | #include <linux/slab.h> | ||
| 23 | |||
| 22 | #include "aops.h" | 24 | #include "aops.h" |
| 23 | #include "collate.h" | 25 | #include "collate.h" |
| 24 | #include "debug.h" | 26 | #include "debug.h" |
diff --git a/fs/ntfs/mft.c b/fs/ntfs/mft.c index 1caa0ef0b2bb..b572b6727181 100644 --- a/fs/ntfs/mft.c +++ b/fs/ntfs/mft.c | |||
| @@ -21,6 +21,7 @@ | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include <linux/buffer_head.h> | 23 | #include <linux/buffer_head.h> |
| 24 | #include <linux/slab.h> | ||
| 24 | #include <linux/swap.h> | 25 | #include <linux/swap.h> |
| 25 | 26 | ||
| 26 | #include "attrib.h" | 27 | #include "attrib.h" |
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index 2ca00153b6ec..358273e59ade 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #include <linux/dcache.h> | 23 | #include <linux/dcache.h> |
| 24 | #include <linux/exportfs.h> | 24 | #include <linux/exportfs.h> |
| 25 | #include <linux/security.h> | 25 | #include <linux/security.h> |
| 26 | #include <linux/slab.h> | ||
| 26 | 27 | ||
| 27 | #include "attrib.h" | 28 | #include "attrib.h" |
| 28 | #include "debug.h" | 29 | #include "debug.h" |
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 1cf39dfaee7a..0de1db6cddbf 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/vfs.h> | 31 | #include <linux/vfs.h> |
| 32 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
| 33 | #include <linux/smp_lock.h> | 33 | #include <linux/smp_lock.h> |
| 34 | #include <linux/bitmap.h> | ||
| 34 | 35 | ||
| 35 | #include "sysctl.h" | 36 | #include "sysctl.h" |
| 36 | #include "logfile.h" | 37 | #include "logfile.h" |
| @@ -2458,7 +2459,6 @@ static void ntfs_put_super(struct super_block *sb) | |||
| 2458 | static s64 get_nr_free_clusters(ntfs_volume *vol) | 2459 | static s64 get_nr_free_clusters(ntfs_volume *vol) |
| 2459 | { | 2460 | { |
| 2460 | s64 nr_free = vol->nr_clusters; | 2461 | s64 nr_free = vol->nr_clusters; |
| 2461 | u32 *kaddr; | ||
| 2462 | struct address_space *mapping = vol->lcnbmp_ino->i_mapping; | 2462 | struct address_space *mapping = vol->lcnbmp_ino->i_mapping; |
| 2463 | struct page *page; | 2463 | struct page *page; |
| 2464 | pgoff_t index, max_index; | 2464 | pgoff_t index, max_index; |
| @@ -2477,7 +2477,8 @@ static s64 get_nr_free_clusters(ntfs_volume *vol) | |||
| 2477 | ntfs_debug("Reading $Bitmap, max_index = 0x%lx, max_size = 0x%lx.", | 2477 | ntfs_debug("Reading $Bitmap, max_index = 0x%lx, max_size = 0x%lx.", |
| 2478 | max_index, PAGE_CACHE_SIZE / 4); | 2478 | max_index, PAGE_CACHE_SIZE / 4); |
| 2479 | for (index = 0; index < max_index; index++) { | 2479 | for (index = 0; index < max_index; index++) { |
| 2480 | unsigned int i; | 2480 | unsigned long *kaddr; |
| 2481 | |||
| 2481 | /* | 2482 | /* |
| 2482 | * Read the page from page cache, getting it from backing store | 2483 | * Read the page from page cache, getting it from backing store |
| 2483 | * if necessary, and increment the use count. | 2484 | * if necessary, and increment the use count. |
| @@ -2490,16 +2491,16 @@ static s64 get_nr_free_clusters(ntfs_volume *vol) | |||
| 2490 | nr_free -= PAGE_CACHE_SIZE * 8; | 2491 | nr_free -= PAGE_CACHE_SIZE * 8; |
| 2491 | continue; | 2492 | continue; |
| 2492 | } | 2493 | } |
| 2493 | kaddr = (u32*)kmap_atomic(page, KM_USER0); | 2494 | kaddr = kmap_atomic(page, KM_USER0); |
| 2494 | /* | 2495 | /* |
| 2495 | * For each 4 bytes, subtract the number of set bits. If this | 2496 | * Subtract the number of set bits. If this |
| 2496 | * is the last page and it is partial we don't really care as | 2497 | * is the last page and it is partial we don't really care as |
| 2497 | * it just means we do a little extra work but it won't affect | 2498 | * it just means we do a little extra work but it won't affect |
| 2498 | * the result as all out of range bytes are set to zero by | 2499 | * the result as all out of range bytes are set to zero by |
| 2499 | * ntfs_readpage(). | 2500 | * ntfs_readpage(). |
| 2500 | */ | 2501 | */ |
| 2501 | for (i = 0; i < PAGE_CACHE_SIZE / 4; i++) | 2502 | nr_free -= bitmap_weight(kaddr, |
| 2502 | nr_free -= (s64)hweight32(kaddr[i]); | 2503 | PAGE_CACHE_SIZE * BITS_PER_BYTE); |
| 2503 | kunmap_atomic(kaddr, KM_USER0); | 2504 | kunmap_atomic(kaddr, KM_USER0); |
| 2504 | page_cache_release(page); | 2505 | page_cache_release(page); |
| 2505 | } | 2506 | } |
| @@ -2538,7 +2539,6 @@ static s64 get_nr_free_clusters(ntfs_volume *vol) | |||
| 2538 | static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, | 2539 | static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, |
| 2539 | s64 nr_free, const pgoff_t max_index) | 2540 | s64 nr_free, const pgoff_t max_index) |
| 2540 | { | 2541 | { |
| 2541 | u32 *kaddr; | ||
| 2542 | struct address_space *mapping = vol->mftbmp_ino->i_mapping; | 2542 | struct address_space *mapping = vol->mftbmp_ino->i_mapping; |
| 2543 | struct page *page; | 2543 | struct page *page; |
| 2544 | pgoff_t index; | 2544 | pgoff_t index; |
| @@ -2548,7 +2548,8 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, | |||
| 2548 | ntfs_debug("Reading $MFT/$BITMAP, max_index = 0x%lx, max_size = " | 2548 | ntfs_debug("Reading $MFT/$BITMAP, max_index = 0x%lx, max_size = " |
| 2549 | "0x%lx.", max_index, PAGE_CACHE_SIZE / 4); | 2549 | "0x%lx.", max_index, PAGE_CACHE_SIZE / 4); |
| 2550 | for (index = 0; index < max_index; index++) { | 2550 | for (index = 0; index < max_index; index++) { |
| 2551 | unsigned int i; | 2551 | unsigned long *kaddr; |
| 2552 | |||
| 2552 | /* | 2553 | /* |
| 2553 | * Read the page from page cache, getting it from backing store | 2554 | * Read the page from page cache, getting it from backing store |
| 2554 | * if necessary, and increment the use count. | 2555 | * if necessary, and increment the use count. |
| @@ -2561,16 +2562,16 @@ static unsigned long __get_nr_free_mft_records(ntfs_volume *vol, | |||
| 2561 | nr_free -= PAGE_CACHE_SIZE * 8; | 2562 | nr_free -= PAGE_CACHE_SIZE * 8; |
| 2562 | continue; | 2563 | continue; |
| 2563 | } | 2564 | } |
| 2564 | kaddr = (u32*)kmap_atomic(page, KM_USER0); | 2565 | kaddr = kmap_atomic(page, KM_USER0); |
| 2565 | /* | 2566 | /* |
| 2566 | * For each 4 bytes, subtract the number of set bits. If this | 2567 | * Subtract the number of set bits. If this |
| 2567 | * is the last page and it is partial we don't really care as | 2568 | * is the last page and it is partial we don't really care as |
| 2568 | * it just means we do a little extra work but it won't affect | 2569 | * it just means we do a little extra work but it won't affect |
| 2569 | * the result as all out of range bytes are set to zero by | 2570 | * the result as all out of range bytes are set to zero by |
| 2570 | * ntfs_readpage(). | 2571 | * ntfs_readpage(). |
| 2571 | */ | 2572 | */ |
| 2572 | for (i = 0; i < PAGE_CACHE_SIZE / 4; i++) | 2573 | nr_free -= bitmap_weight(kaddr, |
| 2573 | nr_free -= (s64)hweight32(kaddr[i]); | 2574 | PAGE_CACHE_SIZE * BITS_PER_BYTE); |
| 2574 | kunmap_atomic(kaddr, KM_USER0); | 2575 | kunmap_atomic(kaddr, KM_USER0); |
| 2575 | page_cache_release(page); | 2576 | page_cache_release(page); |
| 2576 | } | 2577 | } |
