diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-08-24 12:25:44 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-08-24 12:25:54 +0200 | 
| commit | 5f9ece02401116b29eb04396b99ea092acb75dd8 (patch) | |
| tree | e10386e2dc63c275646b4eb0bed857da7bf86c6a /fs/ocfs2/dcache.c | |
| parent | 9f51e24ee8b5a1595b6a5ac0c2be278a16488e75 (diff) | |
| parent | 422bef879e84104fee6dc68ded0e371dbeb5f88e (diff) | |
| download | olio-linux-3.10-5f9ece02401116b29eb04396b99ea092acb75dd8.tar.xz olio-linux-3.10-5f9ece02401116b29eb04396b99ea092acb75dd8.zip  | |
Merge commit 'v2.6.31-rc7' into x86/cleanups
Merge reason: we were on -rc1 before - go up to -rc7
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/ocfs2/dcache.c')
| -rw-r--r-- | fs/ocfs2/dcache.c | 35 | 
1 files changed, 27 insertions, 8 deletions
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index b574431a031..2f28b7de2c8 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -310,22 +310,19 @@ out_attach:  	return ret;  } -static DEFINE_SPINLOCK(dentry_list_lock); +DEFINE_SPINLOCK(dentry_list_lock);  /* We limit the number of dentry locks to drop in one go. We have   * this limit so that we don't starve other users of ocfs2_wq. */  #define DL_INODE_DROP_COUNT 64  /* Drop inode references from dentry locks */ -void ocfs2_drop_dl_inodes(struct work_struct *work) +static void __ocfs2_drop_dl_inodes(struct ocfs2_super *osb, int drop_count)  { -	struct ocfs2_super *osb = container_of(work, struct ocfs2_super, -					       dentry_lock_work);  	struct ocfs2_dentry_lock *dl; -	int drop_count = DL_INODE_DROP_COUNT;  	spin_lock(&dentry_list_lock); -	while (osb->dentry_lock_list && drop_count--) { +	while (osb->dentry_lock_list && (drop_count < 0 || drop_count--)) {  		dl = osb->dentry_lock_list;  		osb->dentry_lock_list = dl->dl_next;  		spin_unlock(&dentry_list_lock); @@ -333,11 +330,32 @@ void ocfs2_drop_dl_inodes(struct work_struct *work)  		kfree(dl);  		spin_lock(&dentry_list_lock);  	} -	if (osb->dentry_lock_list) +	spin_unlock(&dentry_list_lock); +} + +void ocfs2_drop_dl_inodes(struct work_struct *work) +{ +	struct ocfs2_super *osb = container_of(work, struct ocfs2_super, +					       dentry_lock_work); + +	__ocfs2_drop_dl_inodes(osb, DL_INODE_DROP_COUNT); +	/* +	 * Don't queue dropping if umount is in progress. We flush the +	 * list in ocfs2_dismount_volume +	 */ +	spin_lock(&dentry_list_lock); +	if (osb->dentry_lock_list && +	    !ocfs2_test_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED))  		queue_work(ocfs2_wq, &osb->dentry_lock_work);  	spin_unlock(&dentry_list_lock);  } +/* Flush the whole work queue */ +void ocfs2_drop_all_dl_inodes(struct ocfs2_super *osb) +{ +	__ocfs2_drop_dl_inodes(osb, -1); +} +  /*   * ocfs2_dentry_iput() and friends.   * @@ -368,7 +386,8 @@ static void ocfs2_drop_dentry_lock(struct ocfs2_super *osb,  	/* We leave dropping of inode reference to ocfs2_wq as that can  	 * possibly lead to inode deletion which gets tricky */  	spin_lock(&dentry_list_lock); -	if (!osb->dentry_lock_list) +	if (!osb->dentry_lock_list && +	    !ocfs2_test_osb_flag(osb, OCFS2_OSB_DROP_DENTRY_LOCK_IMMED))  		queue_work(ocfs2_wq, &osb->dentry_lock_work);  	dl->dl_next = osb->dentry_lock_list;  	osb->dentry_lock_list = dl;  |