]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/xfs/xfs_iget.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild
[linux-2.6-omap-h63xx.git] / fs / xfs / xfs_iget.c
index 8e380a1fb79b691f03efa0e0aa126ce9c0e78727..b53854325266efb6e55f46cc26f0f6de0d481ce2 100644 (file)
@@ -258,7 +258,7 @@ again:
                                goto finish_inode;
 
                        } else if (vp != inode_vp) {
-                               struct inode *inode = LINVFS_GET_IP(inode_vp);
+                               struct inode *inode = vn_to_inode(inode_vp);
 
                                /* The inode is being torn down, pause and
                                 * try again.
@@ -421,7 +421,10 @@ finish_inode:
                        ip->i_chash = chlnew;
                        chlnew->chl_ip = ip;
                        chlnew->chl_blkno = ip->i_blkno;
+                       if (ch->ch_list)
+                               ch->ch_list->chl_prev = chlnew;
                        chlnew->chl_next = ch->ch_list;
+                       chlnew->chl_prev = NULL;
                        ch->ch_list = chlnew;
                        chlnew = NULL;
                }
@@ -495,7 +498,7 @@ retry:
        if ((inode = iget_locked(XFS_MTOVFS(mp)->vfs_super, ino))) {
                xfs_inode_t     *ip;
 
-               vp = LINVFS_GET_VP(inode);
+               vp = vn_from_inode(inode);
                if (inode->i_state & I_NEW) {
                        vn_initialize(inode);
                        error = xfs_iget_core(vp, mp, tp, ino, flags,
@@ -509,7 +512,7 @@ retry:
                } else {
                        /*
                         * If the inode is not fully constructed due to
-                        * filehandle mistmatches wait for the inode to go
+                        * filehandle mismatches wait for the inode to go
                         * away and try again.
                         *
                         * iget_locked will call __wait_on_freeing_inode
@@ -617,7 +620,7 @@ xfs_iput_new(xfs_inode_t    *ip,
             uint               lock_flags)
 {
        vnode_t         *vp = XFS_ITOV(ip);
-       struct inode    *inode = LINVFS_GET_IP(vp);
+       struct inode    *inode = vn_to_inode(vp);
 
        vn_trace_entry(vp, "xfs_iput_new", (inst_t *)__return_address);
 
@@ -723,23 +726,15 @@ xfs_iextract(
                ASSERT(ip->i_cnext == ip && ip->i_cprev == ip);
                ASSERT(ip->i_chash != NULL);
                chm=NULL;
-               for (chl = ch->ch_list; chl != NULL; chl = chl->chl_next) {
-                       if (chl->chl_blkno == ip->i_blkno) {
-                               if (chm == NULL) {
-                                       /* first item on the list */
-                                       ch->ch_list = chl->chl_next;
-                               } else {
-                                       chm->chl_next = chl->chl_next;
-                               }
-                               kmem_zone_free(xfs_chashlist_zone, chl);
-                               break;
-                       } else {
-                               ASSERT(chl->chl_ip != ip);
-                               chm = chl;
-                       }
-               }
-               ASSERT_ALWAYS(chl != NULL);
-       } else {
+               chl = ip->i_chash;
+               if (chl->chl_prev)
+                       chl->chl_prev->chl_next = chl->chl_next;
+               else
+                       ch->ch_list = chl->chl_next;
+               if (chl->chl_next)
+                       chl->chl_next->chl_prev = chl->chl_prev;
+               kmem_zone_free(xfs_chashlist_zone, chl);
+       } else {
                /* delete one inode from a non-empty list */
                iq = ip->i_cnext;
                iq->i_cprev = ip->i_cprev;