Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140110
b: refs/heads/master
c: ed93ec3
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Hellwig authored and Felix Blyakher committed Mar 4, 2009
1 parent 8b73190 commit 3c7564d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: e8fa6b483feebd23ded5eb01afd7a6e82b6078c6
refs/heads/master: ed93ec3907f063268ced18728d0653f6199d100c
15 changes: 10 additions & 5 deletions trunk/fs/xfs/xfs_iget.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,17 +246,23 @@ xfs_iget_cache_miss(
goto out_destroy;
}

if (lock_flags)
xfs_ilock(ip, lock_flags);

/*
* Preload the radix tree so we can insert safely under the
* write spinlock. Note that we cannot sleep inside the preload
* region.
*/
if (radix_tree_preload(GFP_KERNEL)) {
error = EAGAIN;
goto out_unlock;
goto out_destroy;
}

/*
* Because the inode hasn't been added to the radix-tree yet it can't
* be found by another thread, so we can do the non-sleeping lock here.
*/
if (lock_flags) {
if (!xfs_ilock_nowait(ip, lock_flags))
BUG();
}

mask = ~(((XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog)) - 1);
Expand Down Expand Up @@ -284,7 +290,6 @@ xfs_iget_cache_miss(
out_preload_end:
write_unlock(&pag->pag_ici_lock);
radix_tree_preload_end();
out_unlock:
if (lock_flags)
xfs_iunlock(ip, lock_flags);
out_destroy:
Expand Down

0 comments on commit 3c7564d

Please sign in to comment.