From: Theodore Ts'o Date: Sat, 25 Sep 2010 02:40:21 +0000 (-0400) Subject: Merge branch 'maint' into next X-Git-Tag: v1.41.90.wc1~39 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=9d92a201deec7bbb1911e6e5ee98abf3c83882d4;p=tools%2Fe2fsprogs.git Merge branch 'maint' into next Conflicts: configure configure.in lib/ext2fs/ext2fs.h misc/mke2fs.c --- 9d92a201deec7bbb1911e6e5ee98abf3c83882d4 diff --cc configure index 5fcbe55,aaeb177..14d9652 --- a/configure +++ b/configure @@@ -10647,7 -10699,7 +10699,7 @@@ if test "$ac_res" != no; then fi fi - for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate blkid_probe_get_topology -for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit blkid_probe_get_topology mbstowcs ++for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate blkid_probe_get_topology mbstowcs do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --cc configure.in index 4ea7bcd,5c6b801..5e67688 --- a/configure.in +++ b/configure.in @@@ -853,7 -853,7 +853,7 @@@ if test -n "$BLKID_CMT"; the AC_SEARCH_LIBS([blkid_probe_all], [blkid]) fi dnl - AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate blkid_probe_get_topology) -AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit blkid_probe_get_topology mbstowcs) ++AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate blkid_probe_get_topology mbstowcs) dnl dnl Check to see if -lsocket is required (solaris) to make something dnl that uses socket() to compile; this is needed for the UUID library diff --cc lib/ext2fs/closefs.c index 82f1f7b,99430d7..7a23e46 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@@ -193,8 -145,9 +193,9 @@@ static errcode_t write_primary_superblo errcode_t retval; if (!fs->io->manager->write_byte || !fs->orig_super) { + fallback: io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET); - retval = io_channel_write_blk(fs->io, 1, -SUPERBLOCK_SIZE, + retval = io_channel_write_blk64(fs->io, 1, -SUPERBLOCK_SIZE, super); io_channel_set_blksize(fs->io, fs->blocksize); return retval; diff --cc lib/ext2fs/ext2fs.h index f2f9ac8,cf76562..a204eb7 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@@ -180,8 -173,7 +181,9 @@@ typedef struct ext2_file *ext2_file_t #define EXT2_FLAG_EXCLUSIVE 0x4000 #define EXT2_FLAG_SOFTSUPP_FEATURES 0x8000 #define EXT2_FLAG_NOFREE_ON_ERROR 0x10000 +#define EXT2_FLAG_64BITS 0x20000 +#define EXT2_FLAG_PRINT_PROGRESS 0x40000 + #define EXT2_FLAG_DIRECT_IO 0x80000 /* * Special flag in the ext2 inode i_flag field that means that this is diff --cc misc/mke2fs.c index add7c0c,08fab41..0980045 --- a/misc/mke2fs.c +++ b/misc/mke2fs.c @@@ -300,22 -297,77 +300,22 @@@ _("Warning: the backup superblock/grou ext2fs_badblocks_list_iterate_end(bb_iter); } - static void write_inode_tables(ext2_filsys fs, int lazy_flag) -/* - * These functions implement a generalized progress meter. - */ -struct progress_struct { - char format[20]; - char backup[80]; - __u32 max; - int skip_progress; -}; - -static void progress_init(struct progress_struct *progress, - const char *label,__u32 max) -{ - int i; - - memset(progress, 0, sizeof(struct progress_struct)); - if (quiet) - return; - - /* - * Figure out how many digits we need - */ - i = int_log10(max); - sprintf(progress->format, "%%%dd/%%%dld", i, i); - memset(progress->backup, '\b', sizeof(progress->backup)-1); - progress->backup[sizeof(progress->backup)-1] = 0; - if ((2*i)+1 < (int) sizeof(progress->backup)) - progress->backup[(2*i)+1] = 0; - progress->max = max; - - progress->skip_progress = 0; - if (getenv("MKE2FS_SKIP_PROGRESS")) - progress->skip_progress++; - - fputs(label, stdout); - fflush(stdout); -} - -static void progress_update(struct progress_struct *progress, __u32 val) -{ - if ((progress->format[0] == 0) || progress->skip_progress) - return; - printf(progress->format, val, progress->max); - fputs(progress->backup, stdout); -} - -static void progress_close(struct progress_struct *progress) -{ - if (progress->format[0] == 0) - return; - fputs(_("done \n"), stdout); -} - + static void write_inode_tables(ext2_filsys fs, int lazy_flag, int itable_zeroed) { errcode_t retval; - blk_t blk; + blk64_t blk; dgrp_t i; int num, ipb; - struct progress_struct progress; + struct ext2fs_numeric_progress_struct progress; - if (quiet) - memset(&progress, 0, sizeof(progress)); - else - progress_init(&progress, _("Writing inode tables: "), - fs->group_desc_count); + ext2fs_numeric_progress_init(fs, &progress, + _("Writing inode tables: "), + fs->group_desc_count); for (i = 0; i < fs->group_desc_count; i++) { - progress_update(&progress, i); + ext2fs_numeric_progress_update(fs, &progress, i); - blk = fs->group_desc[i].bg_inode_table; + blk = ext2fs_inode_table_loc(fs, i); num = fs->inode_blocks_per_group; if (lazy_flag) { @@@ -325,15 -377,16 +325,16 @@@ EXT2_INODE_SIZE(fs->super)) + EXT2_BLOCK_SIZE(fs->super) - 1) / EXT2_BLOCK_SIZE(fs->super)); - } else { + } + if (!lazy_flag || itable_zeroed) { /* The kernel doesn't need to zero the itable blocks */ - fs->group_desc[i].bg_flags |= EXT2_BG_INODE_ZEROED; + ext2fs_bg_flags_set(fs, i, EXT2_BG_INODE_ZEROED); ext2fs_group_desc_csum_set(fs, i); } - retval = ext2fs_zero_blocks(fs, blk, num, &blk, &num); + retval = ext2fs_zero_blocks2(fs, blk, num, &blk, &num); if (retval) { fprintf(stderr, _("\nCould not write %d " - "blocks in inode table starting at %u: %s\n"), + "blocks in inode table starting at %llu: %s\n"), num, blk, error_message(retval)); exit(1); } @@@ -1412,11 -1459,12 +1413,12 @@@ static void PRS(int argc, char *argv[] blocksize, sys_page_size); } if (optind < argc) { - fs_param.s_blocks_count = parse_num_blocks(argv[optind++], - fs_param.s_log_block_size); - if (!fs_param.s_blocks_count) { + fs_blocks_count = parse_num_blocks2(argv[optind++], + fs_param.s_log_block_size); + if (!fs_blocks_count) { - com_err(program_name, 0, _("invalid blocks count - %s"), - argv[optind - 1]); + com_err(program_name, 0, - _("invalid blocks count '%s' on device '%s'"), ++ _("invalid blocks '%s' on device '%s'"), + argv[optind - 1], device_name); exit(1); } } @@@ -2144,10 -2201,10 +2176,10 @@@ int main (int argc, char *argv[] if (retval) { com_err(program_name, retval, - _("while zeroing block %u at end of filesystem"), + _("while zeroing block %llu at end of filesystem"), ret_blk); } - write_inode_tables(fs, lazy_itable_init); + write_inode_tables(fs, lazy_itable_init, itable_zeroed); create_root_dir(fs); create_lost_and_found(fs); reserve_inodes(fs);