]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Merge back kernel fixes/code updates in xfs.
authorNathan Scott <nathans@sgi.com>
Tue, 8 Nov 2005 14:07:59 +0000 (14:07 +0000)
committerNathan Scott <nathans@sgi.com>
Tue, 8 Nov 2005 14:07:59 +0000 (14:07 +0000)
Merge of master-melb:xfs-cmds:24318a by kenmcd.

libxfs/xfs.h
libxfs/xfs_da_btree.c
libxfs/xfs_dir2_sf.c
libxfs/xfs_dir_leaf.c
libxfs/xfs_mount.c

index 80ed1d036ef6b55a65beb2fd8fe6e9b603a7e066..63d69e2c03531bb2634faca8d04cc8169bc9cd9f 100644 (file)
@@ -342,6 +342,7 @@ typedef struct { dev_t dev; } xfs_buftarg_t;
 # define printk(...)                   ( fprintf(stderr, __VA_ARGS__) )
 #endif
 
+#define rol32(x,y)     (((x) << (y)) | ((x) >> (32 - (y))))
 #define do_mod(a, b)   ((a) % (b))
 #define do_div(n,base) ({ \
        int __res; \
index 4585cf12f99117268a759b9e8c19dd8f3810d7cc..30a90993d9ec66ed57a7aac4f077295005fa1183 100644 (file)
@@ -367,7 +367,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?
@@ -1530,41 +1531,27 @@ xfs_da_hashname(const uchar_t *name, int namelen)
 {
        xfs_dahash_t hash;
 
-#define        ROTL(x,y)       (((x) << (y)) | ((x) >> (32 - (y))))
-#ifdef SLOWVERSION
-       /*
-        * This is the old one-byte-at-a-time version.
-        */
-       for (hash = 0; namelen > 0; namelen--) {
-               hash = *name++ ^ ROTL(hash, 7);
-       }
-       return(hash);
-#else
        /*
         * Do four characters at a time as long as we can.
         */
-       for (hash = 0; namelen >= 4; namelen -= 4, name += 4) {
+       for (hash = 0; namelen >= 4; namelen -= 4, name += 4)
                hash = (name[0] << 21) ^ (name[1] << 14) ^ (name[2] << 7) ^
-                      (name[3] << 0) ^ ROTL(hash, 7 * 4);
-       }
+                      (name[3] << 0) ^ rol32(hash, 7 * 4);
+
        /*
         * Now do the rest of the characters.
         */
        switch (namelen) {
        case 3:
                return (name[0] << 14) ^ (name[1] << 7) ^ (name[2] << 0) ^
-                      ROTL(hash, 7 * 3);
+                      rol32(hash, 7 * 3);
        case 2:
-               return (name[0] << 7) ^ (name[1] << 0) ^ ROTL(hash, 7 * 2);
+               return (name[0] << 7) ^ (name[1] << 0) ^ rol32(hash, 7 * 2);
        case 1:
-               return (name[0] << 0) ^ ROTL(hash, 7 * 1);
-       case 0:
+               return (name[0] << 0) ^ rol32(hash, 7 * 1);
+       default: /* case 0: */
                return hash;
        }
-       /* NOTREACHED */
-#endif
-#undef ROTL
-       return 0; /* keep gcc happy */
 }
 
 /*
index 220494756d653bf36469a23435ba24e2f8623355..df66d314d25f7b0ff2d1d05350e59382b6884e16 100644 (file)
@@ -61,7 +61,7 @@ xfs_dir2_block_sfsize(
        int                     isdotdot;       /* entry is ".." */
        xfs_mount_t             *mp;            /* mount structure pointer */
        int                     namelen;        /* total name bytes */
-       xfs_ino_t               parent;         /* parent inode number */
+       xfs_ino_t               parent = 0;     /* parent inode number */
        int                     size=0;         /* total computed size */
 
        mp = dp->i_mount;
@@ -252,11 +252,11 @@ xfs_dir2_sf_addname(
        int                     incr_isize;     /* total change in size */
        int                     new_isize;      /* di_size after adding name */
        int                     objchange;      /* changing to 8-byte inodes */
-       xfs_dir2_data_aoff_t    offset;         /* offset for new entry */
+       xfs_dir2_data_aoff_t    offset = 0;     /* offset for new entry */
        int                     old_isize;      /* di_size before adding name */
        int                     pick;           /* which algorithm to use */
        xfs_dir2_sf_t           *sfp;           /* shortform structure */
-       xfs_dir2_sf_entry_t     *sfep;          /* shortform entry */
+       xfs_dir2_sf_entry_t     *sfep = NULL;   /* shortform entry */
 
        xfs_dir2_trace_args("sf_addname", args);
        ASSERT(xfs_dir2_sf_lookup(args) == ENOENT);
index 94f6cf1128201570408fcace184eadec12204233..635578ebf10cebb0347cc980e47a0723bde04878 100644 (file)
@@ -405,7 +405,7 @@ xfs_dir_leaf_to_shortform(xfs_da_args_t *iargs)
        xfs_dir_leaf_name_t *namest;
        xfs_da_args_t args;
        xfs_inode_t *dp;
-       xfs_ino_t parent;
+       xfs_ino_t parent = 0;
        char *tmpbuffer;
        int retval, i;
        xfs_dabuf_t *bp;
index 2279aab9c48a16eaa02dac6a9218a6fbe7e84175..c9d8cc457e56db767c49dfdfd79262eb999bcdb6 100644 (file)
@@ -260,7 +260,7 @@ xfs_initialize_perag(xfs_mount_t *mp, xfs_agnumber_t agcount)
                        icount = sbp->sb_dblocks * sbp->sb_imax_pct;
                        do_div(icount, 100);
                        icount += sbp->sb_agblocks - 1;
-                       do_div(icount, mp->m_ialloc_blks);
+                       do_div(icount, sbp->sb_agblocks);
                        max_metadata = icount;
                } else {
                        max_metadata = agcount;