Whamcloud - gitweb
LU-15164 misc: fix chattr usage message for project ID
[tools/e2fsprogs.git] / debugfs / icheck.c
index 729ac93..ed6e950 100644 (file)
@@ -5,6 +5,7 @@
  * under the terms of the GNU Public License.
  */
 
+#include "config.h"
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
@@ -52,7 +53,8 @@ static int icheck_proc(ext2_filsys fs EXT2FS_ATTR((unused)),
        return 0;
 }
 
-void do_icheck(int argc, char **argv)
+void do_icheck(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
+              void *infop EXT2FS_ATTR((unused)))
 {
        struct block_walk_struct bw;
        struct block_info       *binfo;
@@ -85,7 +87,7 @@ void do_icheck(int argc, char **argv)
        }
 
        for (i=1; i < argc; i++) {
-               if (strtoblk(argv[0], argv[i], &bw.barray[i-1].blk))
+               if (strtoblk(argv[0], argv[i], NULL, &bw.barray[i-1].blk))
                        goto error_out;
        }
 
@@ -113,16 +115,16 @@ void do_icheck(int argc, char **argv)
 
                bw.inode = ino;
 
-               blk = ext2fs_file_acl_block(&inode);
+               blk = ext2fs_file_acl_block(current_fs, &inode);
                if (blk) {
                        icheck_proc(current_fs, &blk, 0,
                                    0, 0, &bw);
                        if (bw.blocks_left == 0)
                                break;
-                       ext2fs_file_acl_block_set(&inode, blk);
+                       ext2fs_file_acl_block_set(current_fs, &inode, blk);
                }
 
-               if (!ext2fs_inode_has_valid_blocks(&inode))
+               if (!ext2fs_inode_has_valid_blocks2(current_fs, &inode))
                        goto next;
                /*
                 * To handle filesystems touched by 0.3c extfs; can be
@@ -157,10 +159,12 @@ void do_icheck(int argc, char **argv)
        printf("Block\tInode number\n");
        for (i=0, binfo = bw.barray; i < bw.num_blocks; i++, binfo++) {
                if (binfo->ino == 0) {
-                       printf("%llu\t<block not found>\n", binfo->blk);
+                       printf("%llu\t<block not found>\n",
+                              (unsigned long long) binfo->blk);
                        continue;
                }
-               printf("%llu\t%u\n", binfo->blk, binfo->ino);
+               printf("%llu\t%u\n", (unsigned long long) binfo->blk,
+                      binfo->ino);
        }
 
 error_out: