Beispiel #1
0
static void shrink_dentry_inodes(int goal)
{
	int found;

	spin_unlock(&inode_lock);
	found = select_dcache(goal, 0);
	if (found < goal)
		found = goal;
	prune_dcache(found);
	spin_lock(&inode_lock);
}
Beispiel #2
0
/*
 * 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();
	}
}