aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 9a012cc5b6cd..29f5068f819b 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -145,7 +145,7 @@ static struct inode *alloc_inode(struct super_block *sb)
145 mapping->a_ops = &empty_aops; 145 mapping->a_ops = &empty_aops;
146 mapping->host = inode; 146 mapping->host = inode;
147 mapping->flags = 0; 147 mapping->flags = 0;
148 mapping_set_gfp_mask(mapping, GFP_HIGHUSER); 148 mapping_set_gfp_mask(mapping, GFP_HIGHUSER_PAGECACHE);
149 mapping->assoc_mapping = NULL; 149 mapping->assoc_mapping = NULL;
150 mapping->backing_dev_info = &default_backing_dev_info; 150 mapping->backing_dev_info = &default_backing_dev_info;
151 151
@@ -462,6 +462,11 @@ static int shrink_icache_memory(int nr, gfp_t gfp_mask)
462 return (inodes_stat.nr_unused / 100) * sysctl_vfs_cache_pressure; 462 return (inodes_stat.nr_unused / 100) * sysctl_vfs_cache_pressure;
463} 463}
464 464
465static struct shrinker icache_shrinker = {
466 .shrink = shrink_icache_memory,
467 .seeks = DEFAULT_SEEKS,
468};
469
465static void __wait_on_freeing_inode(struct inode *inode); 470static void __wait_on_freeing_inode(struct inode *inode);
466/* 471/*
467 * Called with the inode lock held. 472 * Called with the inode lock held.
@@ -519,7 +524,13 @@ repeat:
519 * new_inode - obtain an inode 524 * new_inode - obtain an inode
520 * @sb: superblock 525 * @sb: superblock
521 * 526 *
522 * Allocates a new inode for given superblock. 527 * Allocates a new inode for given superblock. The default gfp_mask
528 * for allocations related to inode->i_mapping is GFP_HIGHUSER_PAGECACHE.
529 * If HIGHMEM pages are unsuitable or it is known that pages allocated
530 * for the page cache are not reclaimable or migratable,
531 * mapping_set_gfp_mask() must be called with suitable flags on the
532 * newly created inode's mapping
533 *
523 */ 534 */
524struct inode *new_inode(struct super_block *sb) 535struct inode *new_inode(struct super_block *sb)
525{ 536{
@@ -1377,9 +1388,8 @@ void __init inode_init(unsigned long mempages)
1377 0, 1388 0,
1378 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC| 1389 (SLAB_RECLAIM_ACCOUNT|SLAB_PANIC|
1379 SLAB_MEM_SPREAD), 1390 SLAB_MEM_SPREAD),
1380 init_once, 1391 init_once);
1381 NULL); 1392 register_shrinker(&icache_shrinker);
1382 set_shrinker(DEFAULT_SEEKS, shrink_icache_memory);
1383 1393
1384 /* Hash may have been set up in inode_init_early */ 1394 /* Hash may have been set up in inode_init_early */
1385 if (!hashdist) 1395 if (!hashdist)