X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fdrop_caches.c;h=31f4b0e6d72c333bf1633ef51118ad6ccfc31069;hb=9329d1beaeed1a94f030c784dcec5ff973f402c4;hp=50f9087635d81e3ddd040d27af494b52540a0506;hpb=eccb95cee4f0d56faa46ef22fb94dd4a3578d3eb;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/drop_caches.c b/fs/drop_caches.c index 50f9087..31f4b0e 100644 --- a/fs/drop_caches.c +++ b/fs/drop_caches.c @@ -18,11 +18,13 @@ static void drop_pagecache_sb(struct super_block *sb) spin_lock(&inode_lock); list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { - if (inode->i_state & (I_FREEING|I_WILL_FREE)) + if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) + continue; + if (inode->i_mapping->nrpages == 0) continue; __iget(inode); spin_unlock(&inode_lock); - __invalidate_mapping_pages(inode->i_mapping, 0, -1, true); + invalidate_mapping_pages(inode->i_mapping, 0, -1); iput(toput_inode); toput_inode = inode; spin_lock(&inode_lock); @@ -61,9 +63,9 @@ static void drop_slab(void) } int drop_caches_sysctl_handler(ctl_table *table, int write, - struct file *file, void __user *buffer, size_t *length, loff_t *ppos) + void __user *buffer, size_t *length, loff_t *ppos) { - proc_dointvec_minmax(table, write, file, buffer, length, ppos); + proc_dointvec_minmax(table, write, buffer, length, ppos); if (write) { if (sysctl_drop_caches & 1) drop_pagecache();