]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_iget.c
[XFS] Revert recent quota Makefile change, not in a fit state for merging.
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_iget.c
index d3da00045f260074fca466319a23bfdc34ed14c3..0d9ae8fb41386c956bc43e07d383ffac7697d7fb 100644 (file)
@@ -30,6 +30,8 @@
  * http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
  */
 
+#include <linux/delay.h>
+
 #include "xfs.h"
 
 #include "xfs_macros.h"
@@ -505,17 +507,15 @@ xfs_iget(
        vnode_t         *vp = NULL;
        int             error;
 
-retry:
        XFS_STATS_INC(xs_ig_attempts);
 
+retry:
        if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) {
                bhv_desc_t      *bdp;
                xfs_inode_t     *ip;
-               int             newnode;
 
                vp = LINVFS_GET_VP(inode);
                if (inode->i_state & I_NEW) {
-inode_allocate:
                        vn_initialize(inode);
                        error = xfs_iget_core(vp, mp, tp, ino, flags,
                                        lock_flags, ipp, bno);
@@ -526,32 +526,25 @@ inode_allocate:
                                iput(inode);
                        }
                } else {
-                       /* These are true if the inode is in inactive or
-                        * reclaim. The linux inode is about to go away,
-                        * wait for that path to finish, and try again.
+                       /*
+                        * If the inode is not fully constructed due to
+                        * filehandle mistmatches wait for the inode to go
+                        * away and try again.
+                        *
+                        * iget_locked will call __wait_on_freeing_inode
+                        * to wait for the inode to go away.
                         */
-                       if (vp->v_flag & (VINACT | VRECLM)) {
-                               vn_wait(vp);
+                       if (is_bad_inode(inode) ||
+                           ((bdp = vn_bhv_lookup(VN_BHV_HEAD(vp),
+                                                 &xfs_vnodeops)) == NULL)) {
                                iput(inode);
+                               delay(1);
                                goto retry;
                        }
 
-                       if (is_bad_inode(inode)) {
-                               iput(inode);
-                               return EIO;
-                       }
-
-                       bdp = vn_bhv_lookup(VN_BHV_HEAD(vp), &xfs_vnodeops);
-                       if (bdp == NULL) {
-                               XFS_STATS_INC(xs_ig_dup);
-                               goto inode_allocate;
-                       }
                        ip = XFS_BHVTOI(bdp);
                        if (lock_flags != 0)
                                xfs_ilock(ip, lock_flags);
-                       newnode = (ip->i_d.di_mode == 0);
-                       if (newnode)
-                               xfs_iocore_inode_reinit(ip);
                        XFS_STATS_INC(xs_ig_found);
                        *ipp = ip;
                        error = 0;