/* * Searches the inodes list for freeable inodes, * shrinking the dcache before (and possible after, * if we're low) */ static void try_to_free_inodes(int goal) { /* * First stry to just get rid of unused inodes. * * If we can't reach our goal that way, we'll have * to try to shrink the dcache and sync existing * inodes.. */ free_inodes(); goal -= inodes_stat.nr_free_inodes; if (goal > 0) { spin_unlock(&inode_lock); select_dcache(goal, 0); prune_dcache(goal); spin_lock(&inode_lock); sync_all_inodes(); free_inodes(); } }
/* * This is the externally visible routine for * inode memory management. */ void free_inode_memory(int goal) { spin_lock(&inode_lock); free_inodes(goal); spin_unlock(&inode_lock); }
/* * Searches the inodes list for freeable inodes, * shrinking the dcache before (and possible after, * if we're low) */ static void try_to_free_inodes(int goal) { shrink_dentry_inodes(goal); if (!free_inodes(goal)) shrink_dentry_inodes(goal); }