diff options
Diffstat (limited to 'fs/ramfs')
-rw-r--r-- | fs/ramfs/file-mmu.c | 13 | ||||
-rw-r--r-- | fs/ramfs/file-nommu.c | 5 | ||||
-rw-r--r-- | fs/ramfs/internal.h | 2 |
3 files changed, 4 insertions, 16 deletions
diff --git a/fs/ramfs/file-mmu.c b/fs/ramfs/file-mmu.c index 2115383dcc8d..00a933eb820c 100644 --- a/fs/ramfs/file-mmu.c +++ b/fs/ramfs/file-mmu.c | |||
@@ -24,18 +24,7 @@ | |||
24 | * caches is sufficient. | 24 | * caches is sufficient. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include <linux/module.h> | ||
28 | #include <linux/fs.h> | 27 | #include <linux/fs.h> |
29 | #include <linux/pagemap.h> | ||
30 | #include <linux/highmem.h> | ||
31 | #include <linux/init.h> | ||
32 | #include <linux/string.h> | ||
33 | #include <linux/smp_lock.h> | ||
34 | #include <linux/backing-dev.h> | ||
35 | #include <linux/ramfs.h> | ||
36 | |||
37 | #include <asm/uaccess.h> | ||
38 | #include "internal.h" | ||
39 | 28 | ||
40 | struct address_space_operations ramfs_aops = { | 29 | struct address_space_operations ramfs_aops = { |
41 | .readpage = simple_readpage, | 30 | .readpage = simple_readpage, |
@@ -43,7 +32,7 @@ struct address_space_operations ramfs_aops = { | |||
43 | .commit_write = simple_commit_write | 32 | .commit_write = simple_commit_write |
44 | }; | 33 | }; |
45 | 34 | ||
46 | struct file_operations ramfs_file_operations = { | 35 | const struct file_operations ramfs_file_operations = { |
47 | .read = generic_file_read, | 36 | .read = generic_file_read, |
48 | .write = generic_file_write, | 37 | .write = generic_file_write, |
49 | .mmap = generic_file_mmap, | 38 | .mmap = generic_file_mmap, |
diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c index 3f810acd0bfa..f443a84b98a5 100644 --- a/fs/ramfs/file-nommu.c +++ b/fs/ramfs/file-nommu.c | |||
@@ -33,7 +33,7 @@ struct address_space_operations ramfs_aops = { | |||
33 | .commit_write = simple_commit_write | 33 | .commit_write = simple_commit_write |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct file_operations ramfs_file_operations = { | 36 | const struct file_operations ramfs_file_operations = { |
37 | .mmap = ramfs_nommu_mmap, | 37 | .mmap = ramfs_nommu_mmap, |
38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, | 38 | .get_unmapped_area = ramfs_nommu_get_unmapped_area, |
39 | .read = generic_file_read, | 39 | .read = generic_file_read, |
@@ -87,8 +87,7 @@ static int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize) | |||
87 | xpages = 1UL << order; | 87 | xpages = 1UL << order; |
88 | npages = (newsize + PAGE_SIZE - 1) >> PAGE_SHIFT; | 88 | npages = (newsize + PAGE_SIZE - 1) >> PAGE_SHIFT; |
89 | 89 | ||
90 | for (loop = 0; loop < npages; loop++) | 90 | split_page(pages, order); |
91 | set_page_count(pages + loop, 1); | ||
92 | 91 | ||
93 | /* trim off any pages we don't actually require */ | 92 | /* trim off any pages we don't actually require */ |
94 | for (loop = npages; loop < xpages; loop++) | 93 | for (loop = npages; loop < xpages; loop++) |
diff --git a/fs/ramfs/internal.h b/fs/ramfs/internal.h index 272c8a7120b0..313237631b49 100644 --- a/fs/ramfs/internal.h +++ b/fs/ramfs/internal.h | |||
@@ -11,5 +11,5 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | extern struct address_space_operations ramfs_aops; | 13 | extern struct address_space_operations ramfs_aops; |
14 | extern struct file_operations ramfs_file_operations; | 14 | extern const struct file_operations ramfs_file_operations; |
15 | extern struct inode_operations ramfs_file_inode_operations; | 15 | extern struct inode_operations ramfs_file_inode_operations; |