Whamcloud - gitweb
debugfs.8.in: Update manual page to document the set_super_value
[tools/e2fsprogs.git] / debugfs / debugfs.c
index d37599e..1f69a75 100644 (file)
@@ -322,11 +322,11 @@ void do_dirty_filesys(int argc, char **argv)
 }
 
 struct list_blocks_struct {
-       FILE    *f;
-       int     total;
-       blk_t   first_block, last_block;
-       int     first_bcnt, last_bcnt;
-       int     first;
+       FILE            *f;
+       e2_blkcnt_t     total;
+       blk_t           first_block, last_block;
+       e2_blkcnt_t     first_bcnt, last_bcnt;
+       e2_blkcnt_t     first;
 };
 
 static void finish_range(struct list_blocks_struct *lb)
@@ -345,8 +345,9 @@ static void finish_range(struct list_blocks_struct *lb)
        lb->first_block = 0;
 }
 
-static int list_blocks_proc(ext2_filsys fs, blk_t *blocknr, int blockcnt,
-                           void *private)
+static int list_blocks_proc(ext2_filsys fs, blk_t *blocknr,
+                           e2_blkcnt_t blockcnt, blk_t ref_block,
+                           int ref_offset, void *private)
 {
        struct list_blocks_struct *lb = (struct list_blocks_struct *) private;
 
@@ -397,7 +398,7 @@ static void dump_blocks(FILE *f, const char *prefix, ext2_ino_t inode)
        lb.first_block = 0;
        lb.f = f;
        lb.first = 1;
-       ext2fs_block_iterate(current_fs, inode, 0, NULL,
+       ext2fs_block_iterate2(current_fs, inode, 0, NULL,
                             list_blocks_proc, (void *)&lb);
        finish_range(&lb);
        if (lb.total)
@@ -428,14 +429,13 @@ void internal_dump_inode(FILE *out, const char *prefix,
                inode->i_mode & 0777, inode->i_flags, inode->i_generation);
        fprintf(out, "%sUser: %5d   Group: %5d   Size: ",
                prefix, inode->i_uid, inode->i_gid);
-       if (LINUX_S_ISDIR(inode->i_mode))
-               fprintf(out, "%d\n", inode->i_size);
-       else {
+       if (LINUX_S_ISREG(inode->i_mode)) {
                __u64 i_size = (inode->i_size |
                                ((unsigned long long)inode->i_size_high << 32));
-               
+
                fprintf(out, "%lld\n", i_size);
-       }
+       } else
+               fprintf(out, "%d\n", inode->i_size);
        if (current_fs->super->s_creator_os == EXT2_OS_HURD)
                fprintf(out,
                        "%sFile ACL: %d    Directory ACL: %d Translator: %d\n",
@@ -1098,7 +1098,8 @@ static errcode_t copy_file(int fd, ext2_ino_t newfile)
 {
        ext2_file_t     e2_file;
        errcode_t       retval;
-       unsigned int    got, written;
+       int             got;
+       unsigned int    written;
        char            buf[8192];
        char            *ptr;
 
@@ -1536,9 +1537,8 @@ int main(int argc, char **argv)
        char            *tmp;
        
        initialize_ext2_error_table();
-       fprintf (stderr, "debugfs %s, %s for EXT2 FS %s, %s\n",
-                E2FSPROGS_VERSION, E2FSPROGS_DATE,
-                EXT2FS_VERSION, EXT2FS_DATE);
+       fprintf (stderr, "debugfs %s (%s)\n", E2FSPROGS_VERSION,
+                E2FSPROGS_DATE);
 
        while ((c = getopt (argc, argv, "iwcR:f:b:s:V")) != EOF) {
                switch (c) {