Whamcloud - gitweb
Minor correction to e2fsck.conf man page
[tools/e2fsprogs.git] / e2fsck / rehash.c
index fbb206f..727e08c 100644 (file)
@@ -45,6 +45,8 @@
  * require that e2fsck use VM first.
  */
 
+#include <string.h>
+#include <ctype.h>
 #include <errno.h>
 #include "e2fsck.h"
 #include "problem.h"
@@ -77,15 +79,15 @@ struct out_dir {
 static int fill_dir_block(ext2_filsys fs,
                          blk_t *block_nr,
                          e2_blkcnt_t blockcnt,
-                         blk_t ref_block,
-                         int ref_offset
+                         blk_t ref_block EXT2FS_ATTR((unused)),
+                         int ref_offset EXT2FS_ATTR((unused)),
                          void *priv_data)
 {
        struct fill_dir_struct  *fd = (struct fill_dir_struct *) priv_data;
        struct hash_entry       *new_array, *ent;
        struct ext2_dir_entry   *dirent;
        char                    *dir;
-       int                     offset, dir_offset;
+       unsigned int            offset, dir_offset;
        
        if (blockcnt < 0)
                return 0;
@@ -175,7 +177,7 @@ static EXT2_QSORT_TYPE name_cmp(const void *a, const void *b)
                else if (he_a->dir->name_len < he_b->dir->name_len)
                        ret = -1;
                else
-                       ret = 0;
+                       ret = he_b->dir->inode - he_a->dir->inode;
        }
        return ret;
 }
@@ -587,8 +589,8 @@ struct write_dir_struct {
 static int write_dir_block(ext2_filsys fs,
                           blk_t        *block_nr,
                           e2_blkcnt_t blockcnt,
-                          blk_t ref_block,
-                          int ref_offset, 
+                          blk_t ref_block EXT2FS_ATTR((unused)),
+                          int ref_offset EXT2FS_ATTR((unused))
                           void *priv_data)
 {
        struct write_dir_struct *wd = (struct write_dir_struct *) priv_data;