diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/backing-dev.c | 26 | ||||
-rw-r--r-- | mm/mmap.c | 4 | ||||
-rw-r--r-- | mm/page-writeback.c | 4 | ||||
-rw-r--r-- | mm/readahead.c | 25 | ||||
-rw-r--r-- | mm/shmem.c | 2 |
5 files changed, 33 insertions, 28 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 8e8587444132..be68c956a660 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -2,11 +2,24 @@ | |||
2 | #include <linux/wait.h> | 2 | #include <linux/wait.h> |
3 | #include <linux/backing-dev.h> | 3 | #include <linux/backing-dev.h> |
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | #include <linux/pagemap.h> | ||
5 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
6 | #include <linux/module.h> | 7 | #include <linux/module.h> |
7 | #include <linux/writeback.h> | 8 | #include <linux/writeback.h> |
8 | #include <linux/device.h> | 9 | #include <linux/device.h> |
9 | 10 | ||
11 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | ||
12 | { | ||
13 | } | ||
14 | EXPORT_SYMBOL(default_unplug_io_fn); | ||
15 | |||
16 | struct backing_dev_info default_backing_dev_info = { | ||
17 | .ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE, | ||
18 | .state = 0, | ||
19 | .capabilities = BDI_CAP_MAP_COPY, | ||
20 | .unplug_io_fn = default_unplug_io_fn, | ||
21 | }; | ||
22 | EXPORT_SYMBOL_GPL(default_backing_dev_info); | ||
10 | 23 | ||
11 | static struct class *bdi_class; | 24 | static struct class *bdi_class; |
12 | 25 | ||
@@ -166,9 +179,20 @@ static __init int bdi_class_init(void) | |||
166 | bdi_debug_init(); | 179 | bdi_debug_init(); |
167 | return 0; | 180 | return 0; |
168 | } | 181 | } |
169 | |||
170 | postcore_initcall(bdi_class_init); | 182 | postcore_initcall(bdi_class_init); |
171 | 183 | ||
184 | static int __init default_bdi_init(void) | ||
185 | { | ||
186 | int err; | ||
187 | |||
188 | err = bdi_init(&default_backing_dev_info); | ||
189 | if (!err) | ||
190 | bdi_register(&default_backing_dev_info, NULL, "default"); | ||
191 | |||
192 | return err; | ||
193 | } | ||
194 | subsys_initcall(default_bdi_init); | ||
195 | |||
172 | int bdi_register(struct backing_dev_info *bdi, struct device *parent, | 196 | int bdi_register(struct backing_dev_info *bdi, struct device *parent, |
173 | const char *fmt, ...) | 197 | const char *fmt, ...) |
174 | { | 198 | { |
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
21 | #include <linux/personality.h> | 21 | #include <linux/personality.h> |
22 | #include <linux/security.h> | 22 | #include <linux/security.h> |
23 | #include <linux/ima.h> | ||
23 | #include <linux/hugetlb.h> | 24 | #include <linux/hugetlb.h> |
24 | #include <linux/profile.h> | 25 | #include <linux/profile.h> |
25 | #include <linux/module.h> | 26 | #include <linux/module.h> |
@@ -1049,6 +1050,9 @@ unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, | |||
1049 | error = security_file_mmap(file, reqprot, prot, flags, addr, 0); | 1050 | error = security_file_mmap(file, reqprot, prot, flags, addr, 0); |
1050 | if (error) | 1051 | if (error) |
1051 | return error; | 1052 | return error; |
1053 | error = ima_file_mmap(file, prot); | ||
1054 | if (error) | ||
1055 | return error; | ||
1052 | 1056 | ||
1053 | return mmap_region(file, addr, len, flags, vm_flags, pgoff); | 1057 | return mmap_region(file, addr, len, flags, vm_flags, pgoff); |
1054 | } | 1058 | } |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 74dc57c74349..40ca7cdb653e 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -66,7 +66,7 @@ static inline long sync_writeback_pages(void) | |||
66 | /* | 66 | /* |
67 | * Start background writeback (via pdflush) at this percentage | 67 | * Start background writeback (via pdflush) at this percentage |
68 | */ | 68 | */ |
69 | int dirty_background_ratio = 5; | 69 | int dirty_background_ratio = 10; |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * dirty_background_bytes starts at 0 (disabled) so that it is a function of | 72 | * dirty_background_bytes starts at 0 (disabled) so that it is a function of |
@@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable; | |||
83 | /* | 83 | /* |
84 | * The generator of dirty data starts writeback at this percentage | 84 | * The generator of dirty data starts writeback at this percentage |
85 | */ | 85 | */ |
86 | int vm_dirty_ratio = 10; | 86 | int vm_dirty_ratio = 20; |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * vm_dirty_bytes starts at 0 (disabled) so that it is a function of | 89 | * vm_dirty_bytes starts at 0 (disabled) so that it is a function of |
diff --git a/mm/readahead.c b/mm/readahead.c index bec83c15a78f..9ce303d4b810 100644 --- a/mm/readahead.c +++ b/mm/readahead.c | |||
@@ -17,19 +17,6 @@ | |||
17 | #include <linux/pagevec.h> | 17 | #include <linux/pagevec.h> |
18 | #include <linux/pagemap.h> | 18 | #include <linux/pagemap.h> |
19 | 19 | ||
20 | void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page) | ||
21 | { | ||
22 | } | ||
23 | EXPORT_SYMBOL(default_unplug_io_fn); | ||
24 | |||
25 | struct backing_dev_info default_backing_dev_info = { | ||
26 | .ra_pages = VM_MAX_READAHEAD * 1024 / PAGE_CACHE_SIZE, | ||
27 | .state = 0, | ||
28 | .capabilities = BDI_CAP_MAP_COPY, | ||
29 | .unplug_io_fn = default_unplug_io_fn, | ||
30 | }; | ||
31 | EXPORT_SYMBOL_GPL(default_backing_dev_info); | ||
32 | |||
33 | /* | 20 | /* |
34 | * Initialise a struct file's readahead state. Assumes that the caller has | 21 | * Initialise a struct file's readahead state. Assumes that the caller has |
35 | * memset *ra to zero. | 22 | * memset *ra to zero. |
@@ -233,18 +220,6 @@ unsigned long max_sane_readahead(unsigned long nr) | |||
233 | + node_page_state(numa_node_id(), NR_FREE_PAGES)) / 2); | 220 | + node_page_state(numa_node_id(), NR_FREE_PAGES)) / 2); |
234 | } | 221 | } |
235 | 222 | ||
236 | static int __init readahead_init(void) | ||
237 | { | ||
238 | int err; | ||
239 | |||
240 | err = bdi_init(&default_backing_dev_info); | ||
241 | if (!err) | ||
242 | bdi_register(&default_backing_dev_info, NULL, "default"); | ||
243 | |||
244 | return err; | ||
245 | } | ||
246 | subsys_initcall(readahead_init); | ||
247 | |||
248 | /* | 223 | /* |
249 | * Submit IO for the read-ahead request in file_ra_state. | 224 | * Submit IO for the read-ahead request in file_ra_state. |
250 | */ | 225 | */ |
diff --git a/mm/shmem.c b/mm/shmem.c index 4103a239ce84..7ec78e24a30d 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/module.h> | 29 | #include <linux/module.h> |
30 | #include <linux/swap.h> | 30 | #include <linux/swap.h> |
31 | #include <linux/ima.h> | ||
31 | 32 | ||
32 | static struct vfsmount *shm_mnt; | 33 | static struct vfsmount *shm_mnt; |
33 | 34 | ||
@@ -2665,6 +2666,7 @@ int shmem_zero_setup(struct vm_area_struct *vma) | |||
2665 | if (IS_ERR(file)) | 2666 | if (IS_ERR(file)) |
2666 | return PTR_ERR(file); | 2667 | return PTR_ERR(file); |
2667 | 2668 | ||
2669 | ima_shm_check(file); | ||
2668 | if (vma->vm_file) | 2670 | if (vma->vm_file) |
2669 | fput(vma->vm_file); | 2671 | fput(vma->vm_file); |
2670 | vma->vm_file = file; | 2672 | vma->vm_file = file; |