Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4664
b: refs/heads/master
c: 168a9fd
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi authored and Linus Torvalds committed Jul 12, 2005
1 parent c1dbd6e commit 81ee3ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3b6bfcdb116f2cc2cab921fcac6d39d4022952d2
refs/heads/master: 168a9fd6a1bf91041adf9909f6c72cf747f0ca8c
26 changes: 9 additions & 17 deletions trunk/fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1244,29 +1244,21 @@ int inode_wait(void *word)
}

/*
* If we try to find an inode in the inode hash while it is being deleted, we
* have to wait until the filesystem completes its deletion before reporting
* that it isn't found. This is because iget will immediately call
* ->read_inode, and we want to be sure that evidence of the deletion is found
* by ->read_inode.
* If we try to find an inode in the inode hash while it is being
* deleted, we have to wait until the filesystem completes its
* deletion before reporting that it isn't found. This function waits
* until the deletion _might_ have completed. Callers are responsible
* to recheck inode state.
*
* It doesn't matter if I_LOCK is not set initially, a call to
* wake_up_inode() after removing from the hash list will DTRT.
*
* This is called with inode_lock held.
*/
static void __wait_on_freeing_inode(struct inode *inode)
{
wait_queue_head_t *wq;
DEFINE_WAIT_BIT(wait, &inode->i_state, __I_LOCK);

/*
* I_FREEING and I_CLEAR are cleared in process context under
* inode_lock, so we have to give the tasks who would clear them
* a chance to run and acquire inode_lock.
*/
if (!(inode->i_state & I_LOCK)) {
spin_unlock(&inode_lock);
yield();
spin_lock(&inode_lock);
return;
}
wq = bit_waitqueue(&inode->i_state, __I_LOCK);
prepare_to_wait(wq, &wait.wait, TASK_UNINTERRUPTIBLE);
spin_unlock(&inode_lock);
Expand Down

0 comments on commit 81ee3ed

Please sign in to comment.