]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Merge branch 'maint'
authorTheodore Ts'o <tytso@mit.edu>
Wed, 18 Jun 2008 03:54:51 +0000 (23:54 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 18 Jun 2008 03:54:51 +0000 (23:54 -0400)
Conflicts:

README
resize/online.c
version.h

1  2 
debugfs/debugfs.8.in
doc/libext2fs.texinfo
lib/blkid/probe.c
misc/mke2fs.c
misc/tune2fs.c
resize/online.c
resize/resize2fs.c
tests/r_move_itable/expect
tests/r_resize_inode/expect

Simple merge
Simple merge
Simple merge
diff --cc misc/mke2fs.c
index ff442043f90aea9f2cc3e0e12ab47f7a93711dd5,10ac78206ad885c5ee620aacee5b6341589af86a..7430d481f973d008ebd349fa75316b4596edff1c
@@@ -1694,106 -1562,10 +1694,106 @@@ static void PRS(int argc, char *argv[]
        /*
         * Calculate number of blocks to reserve
         */
-       fs_param.s_r_blocks_count = e2p_percent(reserved_ratio, 
-                                               fs_param.s_blocks_count);
+       fs_param.s_r_blocks_count = (unsigned int) (reserved_ratio *
+                                       fs_param.s_blocks_count / 100.0);
  }
  
 +static int should_do_undo(const char *name)
 +{
 +      errcode_t retval;
 +      io_channel channel;
 +      __u16   s_magic;
 +      struct ext2_super_block super;
 +      io_manager manager = unix_io_manager;
 +      int csum_flag, force_undo;
 +
 +      csum_flag = EXT2_HAS_RO_COMPAT_FEATURE(&fs_param,
 +                                             EXT4_FEATURE_RO_COMPAT_GDT_CSUM);
 +      force_undo = get_int_from_profile(fs_types, "force_undo", 0);
 +      if (!force_undo && (!csum_flag || !lazy_itable_init))
 +              return 0;
 +
 +      retval = manager->open(name, IO_FLAG_EXCLUSIVE,  &channel);
 +      if (retval) {
 +              /*
 +               * We don't handle error cases instead we
 +               * declare that the file system doesn't exist
 +               * and let the rest of mke2fs take care of
 +               * error
 +               */
 +              retval = 0;
 +              goto open_err_out;
 +      }
 +
 +      io_channel_set_blksize(channel, SUPERBLOCK_OFFSET);
 +      retval = io_channel_read_blk(channel, 1, -SUPERBLOCK_SIZE, &super);
 +      if (retval) {
 +              retval = 0;
 +              goto err_out;
 +      }
 +
 +#if defined(WORDS_BIGENDIAN)
 +      s_magic = ext2fs_swab16(super.s_magic);
 +#else
 +      s_magic = super.s_magic;
 +#endif
 +
 +      if (s_magic == EXT2_SUPER_MAGIC)
 +              retval = 1;
 +
 +err_out:
 +      io_channel_close(channel);
 +
 +open_err_out:
 +
 +      return retval;
 +}
 +
 +static int mke2fs_setup_tdb(const char *name, io_manager *io_ptr)
 +{
 +      errcode_t retval = 0;
 +      char *tdb_dir, tdb_file[PATH_MAX];
 +      char *device_name, *tmp_name;
 +
 +      /*
 +       * Configuration via a conf file would be
 +       * nice
 +       */
 +      tdb_dir = getenv("E2FSPROGS_UNDO_DIR");
 +      if (!tdb_dir)
 +              profile_get_string(profile, "defaults",
 +                                 "undo_dir", 0, "/var/lib/e2fsprogs",
 +                                 &tdb_dir);
 +
 +      if (!strcmp(tdb_dir, "none") || (tdb_dir[0] == 0) ||
 +          access(tdb_dir, W_OK))
 +              return 0;
 +
 +      tmp_name = strdup(name);
 +      device_name = basename(tmp_name);
 +      sprintf(tdb_file, "%s/mke2fs-%s.e2undo", tdb_dir, device_name);
 +
 +      if (!access(tdb_file, F_OK)) {
 +              if (unlink(tdb_file) < 0) {
 +                      retval = errno;
 +                      com_err(program_name, retval,
 +                              _("while trying to delete %s"),
 +                              tdb_file);
 +                      return retval;
 +              }
 +      }
 +
 +      set_undo_io_backing_manager(*io_ptr);
 +      *io_ptr = undo_io_manager;
 +      set_undo_io_backup_file(tdb_file);
 +      printf(_("Overwriting existing filesystem; this can be undone "
 +               "using the command:\n"
 +               "    e2undo %s %s\n\n"), tdb_file, name);
 +err_out:
 +      free(tmp_name);
 +      return retval;
 +}
 +
  int main (int argc, char *argv[])
  {
        errcode_t       retval = 0;
diff --cc misc/tune2fs.c
Simple merge
diff --cc resize/online.c
index d7dc857ca3b14dd6336d90b5b3e75186e8e5d5b0,419d489bd38397489177e39ed10784bc0b95f7e1..f96ac10f1a8dd536f8fbe342998a3b8746b6d39a
@@@ -28,10 -27,10 +28,11 @@@ errcode_t online_resize_fs(ext2_filsys 
        unsigned long           new_desc_blocks;
        ext2_filsys             new_fs;
        errcode_t               retval;
+       double                  percent;
        dgrp_t                  i;
        blk_t                   size;
-       int                     fd, r_frac, overhead;
+       int                     fd, overhead;
 +      int                     use_old_ioctl = 1;
  
        printf(_("Filesystem at %s is mounted on %s; "
                 "on-line resizing required\n"), fs->device_name, mtpt);
index 027315c6d769064f72cf5640c3631390a96bb3eb,c6cadb85b0766f506bc77a9b1e566ba6e78095ae..05650a814e5cebc547776b8085e576fac5c14d3b
@@@ -188,8 -186,9 +188,9 @@@ errcode_t adjust_fs_info(ext2_filsys fs
        int             adj, old_numblocks, numblocks, adjblocks;
        unsigned long   i, j, old_desc_blocks, max_group;
        unsigned int    meta_bg, meta_bg_size;
 -      int             has_super;
 +      int             has_super, csum_flag;
        unsigned long long new_inodes;  /* u64 to check for overflow */
+       double          percent;
  
        fs->super->s_blocks_count = new_size;
  
Simple merge
Simple merge