Whamcloud - gitweb
Shorten compile commands run by the build system
[tools/e2fsprogs.git] / e2fsck / super.c
index 40cfc4f..36e7309 100644 (file)
@@ -9,6 +9,7 @@
  * %End-Header%
  */
 
+#include "config.h"
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
@@ -170,8 +171,7 @@ static int release_inode_blocks(e2fsck_t ctx, ext2_ino_t ino,
        if (inode->i_links_count) {
                pb.truncating = 1;
                pb.truncate_block = (e2_blkcnt_t)
-                       ((((long long)inode->i_size_high << 32) +
-                         inode->i_size + fs->blocksize - 1) /
+                       ((EXT2_I_SIZE(inode) + fs->blocksize - 1) /
                         fs->blocksize);
                pb.truncate_offset = inode->i_size % fs->blocksize;
        } else {
@@ -400,6 +400,8 @@ void check_resize_inode(e2fsck_t ctx)
 
        gdt_off = fs->desc_blocks;
        pblk = fs->super->s_first_data_block + 1 + fs->desc_blocks;
+       if (fs->blocksize == 1024 && fs->super->s_first_data_block == 0)
+               pblk++; /* Deal with 1024 blocksize bigalloc fs */
        for (i = 0; i < fs->super->s_reserved_gdt_blocks / 4;
             i++, gdt_off++, pblk++) {
                gdt_off %= fs->blocksize/4;
@@ -555,7 +557,8 @@ void check_super_block(e2fsck_t ctx)
                }
        }
 
-       should_be = (sb->s_log_block_size == 0) ? 1 : 0;
+       should_be = (sb->s_log_block_size == 0 &&
+                    EXT2FS_CLUSTER_RATIO(fs) == 1) ? 1 : 0;
        if (sb->s_first_data_block != should_be) {
                pctx.blk = sb->s_first_data_block;
                pctx.blk2 = should_be;
@@ -854,6 +857,11 @@ void check_super_block(e2fsck_t ctx)
         */
        e2fsck_fix_dirhash_hint(ctx);
 
+       /*
+        * Hide quota inodes if necessary.
+        */
+       e2fsck_hide_quota(ctx);
+
        return;
 }