]> err.no Git - linux-2.6/blobdiff - fs/xfs/xfs_da_btree.c
[XFS] Account for the page we just wrote when we detect congestion during
[linux-2.6] / fs / xfs / xfs_da_btree.c
index c352d0633c310a4bc3096c0988a681a4be5bf0b6..473671fa5c13e1cff88cd4ad075ceecbf1a70ec6 100644 (file)
@@ -429,7 +429,8 @@ xfs_da_node_split(xfs_da_state_t *state, xfs_da_state_blk_t *oldblk,
        /*
         * With V2 the extra block is data or freespace.
         */
-       useextra = state->extravalid && XFS_DIR_IS_V1(state->mp);
+       useextra = state->extravalid && (XFS_DIR_IS_V1(state->mp) ||
+                       state->args->whichfork == XFS_ATTR_FORK);
        newcount = 1 + useextra;
        /*
         * Do we have to split the node?
@@ -1592,15 +1593,6 @@ xfs_da_hashname(const uchar_t *name, int namelen)
 {
        xfs_dahash_t hash;
 
-#ifdef SLOWVERSION
-       /*
-        * This is the old one-byte-at-a-time version.
-        */
-       for (hash = 0; namelen > 0; namelen--)
-               hash = *name++ ^ rol32(hash, 7);
-
-       return(hash);
-#else
        /*
         * Do four characters at a time as long as we can.
         */
@@ -1619,12 +1611,9 @@ xfs_da_hashname(const uchar_t *name, int namelen)
                return (name[0] << 7) ^ (name[1] << 0) ^ rol32(hash, 7 * 2);
        case 1:
                return (name[0] << 0) ^ rol32(hash, 7 * 1);
-       case 0:
+       default: /* case 0: */
                return hash;
        }
-       /* NOTREACHED */
-#endif
-       return 0; /* keep gcc happy */
 }
 
 /*