aboutsummaryrefslogtreecommitdiffstats
path: root/mm/madvise.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-01-14 04:42:31 -0500
committerJens Axboe <axboe@fb.com>2015-01-20 16:02:56 -0500
commit97b713ba3ebaa6c8d84c2c720f5468a7c6a6eb4e (patch)
treea2a430b22f8c220e719114786905b18aa605f9ec /mm/madvise.c
parenta7a2c680a2ad81b3181a335ee76e23d5195007ee (diff)
fs: kill BDI_CAP_SWAP_BACKED
This bdi flag isn't too useful - we can determine that a vma is backed by either swap or shmem trivially in the caller. This also allows removing the backing_dev_info instaces for swap and shmem in favor of noop_backing_dev_info. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Tejun Heo <tj@kernel.org> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'mm/madvise.c')
-rw-r--r--mm/madvise.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/mm/madvise.c b/mm/madvise.c
index a271adc93289..1383a8916bc3 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -222,19 +222,22 @@ static long madvise_willneed(struct vm_area_struct *vma,
222 struct file *file = vma->vm_file; 222 struct file *file = vma->vm_file;
223 223
224#ifdef CONFIG_SWAP 224#ifdef CONFIG_SWAP
225 if (!file || mapping_cap_swap_backed(file->f_mapping)) { 225 if (!file) {
226 *prev = vma; 226 *prev = vma;
227 if (!file) 227 force_swapin_readahead(vma, start, end);
228 force_swapin_readahead(vma, start, end);
229 else
230 force_shm_swapin_readahead(vma, start, end,
231 file->f_mapping);
232 return 0; 228 return 0;
233 } 229 }
234#endif
235 230
231 if (shmem_mapping(file->f_mapping)) {
232 *prev = vma;
233 force_shm_swapin_readahead(vma, start, end,
234 file->f_mapping);
235 return 0;
236 }
237#else
236 if (!file) 238 if (!file)
237 return -EBADF; 239 return -EBADF;
240#endif
238 241
239 if (file->f_mapping->a_ops->get_xip_mem) { 242 if (file->f_mapping->a_ops->get_xip_mem) {
240 /* no bad return value, but ignore advice */ 243 /* no bad return value, but ignore advice */