}
}
-static void try_to_sync_unused_inodes(void * arg)
+static void try_to_sync_unused_inodes(unsigned long pexclusive)
{
struct super_block * sb;
int nr_inodes = inodes_stat.nr_unused;
}
spin_unlock(&sb_lock);
spin_unlock(&inode_lock);
+ clear_bit(0, (unsigned long *)pexclusive);
}
-static struct tq_struct unused_inodes_flush_task;
-
/**
* write_inode_now - write an inode to disk
* @inode: inode to write to disk
* from here or we're either synchronously dogslow
* or we deadlock with oom.
*/
- if (goal)
- schedule_task(&unused_inodes_flush_task);
+ if (goal) {
+ static unsigned long exclusive;
+
+ if (!test_and_set_bit(0, &exclusive)) {
+ if (pdflush_operation(try_to_sync_unused_inodes,
+ (unsigned long)&exclusive))
+ clear_bit(0, &exclusive);
+ }
+ }
}
/*
* This is called from kswapd when we think we need some
NULL);
if (!inode_cachep)
panic("cannot create inode slab cache");
-
- unused_inodes_flush_task.routine = try_to_sync_unused_inodes;
}
static inline void do_atime_update(struct inode *inode)