OBS User unknown 2007-01-21 22:46:18 +00:00 committed by Git OBS Bridge
parent 5f64c73372
commit 4a30d8ed25
10 changed files with 57 additions and 551 deletions

View File

@ -1,40 +0,0 @@
--- misc/mke2fs.8.in
+++ misc/mke2fs.8.in
@@ -30,6 +30,10 @@
.I bytes-per-inode
]
[
+.B \-I
+.I inode-size
+]
+[
.B \-j
]
[
@@ -217,7 +221,14 @@
be smaller than the blocksize of the filesystem, since then too many
inodes will be made. Be warned that is not possible to expand the number
of inodes on a filesystem after it is created, so be careful deciding the
-correct value for this parameter.
+correct value for this parameter.
+.TP
+.BI \-I " inode-size"
+Specify the inode size. The default inode-size used by
+.B mke2fs
+is 128.
+.I inode-size
+can be 128, 256, 512 or 1024. This value generally shouldn't be changed!
.TP
.B \-j
Create the filesystem with an ext3 journal. If the
--- misc/mke2fs.c
+++ misc/mke2fs.c
@@ -94,7 +94,7 @@
static void usage(void)
{
fprintf(stderr, _("Usage: %s [-c|-t|-l filename] [-b block-size] "
- "[-f fragment-size]\n\t[-i bytes-per-inode] [-j] [-J journal-options]"
+ "[-f fragment-size]\n\t[-i bytes-per-inode] [-I inode-size] [-j] [-J journal-options]"
" [-N number-of-inodes]\n\t[-m reserved-blocks-percentage] "
"[-o creator-os] [-g blocks-per-group]\n\t[-L volume-label] "
"[-M last-mounted-directory] [-O feature[,...]]\n\t"

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aa644dbfdc6a9e6d05d780a1a8cc6f46ae605c7774b9f214fd7b3152cb0c3822
size 3596521

View File

@ -1,13 +0,0 @@
--- e2fsprogs-1.39/lib/blkid/probe.c
+++ e2fsprogs-1.39/lib/blkid/probe.c
@@ -348,8 +348,8 @@
}
if (vol_label && memcmp(vol_label, no_name, 11)) {
- label = vol_label;
- label_len = figure_label_len(vol_label, 11);
+ if ((label_len = figure_label_len(vol_label, 11)))
+ label = vol_label;
}
/* We can't just print them as %04X, because they are unaligned */

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf9f5259420233c25bf6752ba90966a2fb347eb46d53898196369292d2506294
size 3288868

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Jan 19 12:10:56 CET 2007 - mkoenig@suse.de
- update to version 1.40-WIP-1114 (FATE#301897)
* support for ext4
* several bugfixes
- remove ext2resize from package, because the online resizing
functionality has been merged into resize2fs since version 1.39
and ext2resize is unmaintained.
-------------------------------------------------------------------
Tue Dec 19 11:24:12 CET 2006 - meissner@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package e2fsprogs (Version 1.39)
# spec file for package e2fsprogs (Version 1.39+1.40_WIP_20061114)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
@ -18,43 +18,35 @@ Provides: e2fsbn ext2fs
Obsoletes: ext2fs
PreReq: %install_info_prereq
Autoreqprov: on
Version: 1.39
Release: 22
Version: 1.39+1.40_WIP_20061114
Release: 1
Summary: Utilities for the Second Extended File System
URL: http://e2fsprogs.sourceforge.net
Source: %{name}-%{version}.tar.bz2
Patch1: elf.diff
Patch3: %{name}-1.35-libdir.diff
Patch4: %{name}-1.33-fsckdevdisplay.diff
Patch5: %{name}-1.33-codecleanup.diff
Patch14: e2fsprogs-strncat.patch
Patch15: e2fsprogs-blkid.diff
Patch16: e2fsprogs-codecleanup.diff
Patch17: e2fsprogs-mdraid.patch
Patch18: e2fsprogs-probe_reiserfs-fpe.patch
Patch19: e2fsprogs-base_devt.patch
Patch20: e2fsprogs-libvolume_id-support.patch
Patch21: close.patch
Patch22: e2fsprogs-1.38-inode_size.patch
Patch23: fsck-ignore-mounted.patch
Patch24: e2fsprogs-mkinstalldirs.patch
Patch25: e2fsprogs-special_make_targets.patch
Patch26: e2fsprogs-1.39-cleanup.patch
Patch27: e2fsprogs-1.39-uuid_duplicates.patch
Patch28: e2fsprogs-1.39-blkid_zero_label.patch
Patch29: e2fsprogs-1.39-resize2fs_manpage.patch
Patch0: elf.diff
Patch1: %{name}-1.35-libdir.diff
Patch2: %{name}-1.33-fsckdevdisplay.diff
Patch3: %{name}-1.33-codecleanup.diff
Patch4: e2fsprogs-blkid.diff
Patch5: e2fsprogs-codecleanup.diff
Patch6: e2fsprogs-mdraid.patch
Patch7: e2fsprogs-probe_reiserfs-fpe.patch
Patch8: e2fsprogs-base_devt.patch
Patch9: e2fsprogs-libvolume_id-support.patch
Patch10: close.patch
Patch11: fsck-ignore-mounted.patch
Patch12: e2fsprogs-mkinstalldirs.patch
Patch13: e2fsprogs-special_make_targets.patch
Patch14: e2fsprogs-1.39-cleanup.patch
Patch15: e2fsprogs-1.39-uuid_duplicates.patch
Patch16: e2fsprogs-1.39-resize2fs_manpage.patch
Patch17: e2fsprogs-strncat.patch
# libcom_err patches
Patch30: libcom_err-no-static-buffer.patch
Patch31: libcom_err-no-init_error_table.patch
Patch32: libcom_err-no-e2fsck.static.patch
Patch33: libcom_err-mutex.patch
# ext2 resize patches
Patch45: ext2resize-byteorder.patch
Patch46: ext2resize-nofallback.patch
Patch47: ext2resize-nowrite.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define ext2resize_name ext2resize-1.1.19
Source1: %{ext2resize_name}.tar.bz2
%description
Utilities needed to create and maintain ext2 and ext3 file systems
@ -104,39 +96,30 @@ Authors:
Theodore Ts'o <tytso@mit.edu>
%prep
%setup -q -b1
%setup -q
# e2fsprogs patches
%patch0
%patch1
%patch2
%patch3
%patch4
%patch5
%patch14 -p1
%patch15
%patch6
%patch7
%patch8 -p1
%patch9 -p0
%patch10 -p1
%patch11
%patch12
%patch14
%patch15 -p1
%patch16
%patch17
%patch18
%patch19 -p1
%patch20 -p0
%patch21 -p1
%patch22
%patch23
%patch24
%patch26
%patch27 -p1
%patch28 -p1
%patch29
%patch17 -p1
# libcom_err patches
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
# ext2 resize patches
find . -type f|xargs chmod u+w
pushd ../%{ext2resize_name}
%patch45 -p2
%patch46 -p2
%patch47 -p2
popd
%build
%{?suse_update_config:%{suse_update_config -f}}
@ -145,7 +128,7 @@ rm -f po/Makefile.in
gettextize --copy --force --intl
autoreconf --force --install
%if %{suse_version} > 1010
patch -p0 -i %{P:25}
patch -p0 -i %{P:13}
%endif
./configure --enable-dynamic-e2fsck \
--prefix=%{_prefix} --with-root-prefix='' \
@ -157,51 +140,19 @@ patch -p0 -i %{P:25}
make
#make check
#make gcc-wall
export CFLAGS="$RPM_OPT_FLAGS"
pushd ../%{ext2resize_name}
# aclocal
# automake -a -f
# autoconf
autoreconf --force --install
./configure \
--prefix=%{_prefix} \
--mandir=%{_mandir} --infodir=%{_infodir} --libdir=%{_libdir}
make
popd
%install
rm -rf $RPM_BUILD_ROOT
make install install-libs DESTDIR=$RPM_BUILD_ROOT lib=%{_lib}
%{find_lang} %{name}
rm $RPM_BUILD_ROOT%{_libdir}/e2initrd_helper
pushd ../%{ext2resize_name}
make DESTDIR=$RPM_BUILD_ROOT install
# For now, we only want to package up the ext2online binary. Delete the
# others.
rm -f $RPM_BUILD_ROOT%{_sbindir}/ext2resize
rm -f $RPM_BUILD_ROOT%{_sbindir}/ext2prepare
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/ext2resize*
rm -f $RPM_BUILD_ROOT/%{_mandir}/man8/ext2prepare*
# We want some of the ext2resize doc files to be clearly identified as
# not being part of e2fsprogs!
mv AUTHORS AUTHORS.ext2resize
mv COPYING COPYING.ext2resize
mv NEWS NEWS.ext2resize
mv README README.ext2resize
mv doc/HOWTO doc/HOWTO.ext2resize
popd
%clean
rm -rf $RPM_BUILD_ROOT
%files -f %{name}.lang
%defattr(-, root, root)
%doc RELEASE-NOTES ChangeLog README doc/draft-leach-uuids-guids-01.txt doc/libblkid.txt
%doc ../%{ext2resize_name}/AUTHORS.ext2resize
%doc ../%{ext2resize_name}/COPYING.ext2resize
%doc ../%{ext2resize_name}/NEWS.ext2resize
%doc ../%{ext2resize_name}/README.ext2resize
%doc ../%{ext2resize_name}/doc/HOWTO.ext2resize
%doc RELEASE-NOTES ChangeLog README doc/libblkid.txt
%config /etc/mke2fs.conf
/sbin/badblocks
/sbin/debugfs
@ -236,9 +187,6 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man5/e2fsck.conf.5.gz
%{_mandir}/man5/mke2fs.conf.5.gz
%{_mandir}/man8/*.8.gz
# ext2resize files
%{_sbindir}/ext2online
%{_mandir}/man8/ext2online.8*
%post
/sbin/ldconfig
@ -292,6 +240,13 @@ rm -rf $RPM_BUILD_ROOT
%postun -n libcom_err -p /sbin/ldconfig
%changelog -n e2fsprogs
* Fri Jan 19 2007 - mkoenig@suse.de
- update to version 1.40-WIP-1114 (FATE#301897)
* support for ext4
* several bugfixes
- remove ext2resize from package, because the online resizing
functionality has been merged into resize2fs since version 1.39
and ext2resize is unmaintained.
* Tue Dec 19 2006 - meissner@suse.de
- fixed build
* Wed Nov 08 2006 - ro@suse.de

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:03e7cc71765b07138e612b46f8e1b3c148966e8bc166da0685fe0f59ca2265b4
size 164526

View File

@ -1,369 +0,0 @@
--- BUILD/ext2resize-1.1.19/configure.in
+++ BUILD/ext2resize-1.1.19/configure.in
@@ -26,6 +26,7 @@
AC_CHECK_TYPE(__s32, int32_t)
AC_CHECK_TYPE(__u32, u_int32_t)
AC_CHECK_TYPE(loff_t, unsigned)
+AC_C_BIGENDIAN
dnl Checks for library functions.
AC_CHECK_FUNCS(open64)
--- BUILD/ext2resize-1.1.19/src/Makefile.am
+++ BUILD/ext2resize-1.1.19/src/Makefile.am
@@ -6,8 +6,9 @@
noinst_LIBRARIES = libext2resize.a
-libext2resize_a_SOURCES = ext2.c ext2_block_relocator.c ext2_buffer.c llseek.c \
- ext2_inode_relocator.c ext2_meta.c ext2_resize.c ext2_unix_io.c tune.c
+libext2resize_a_SOURCES = ext2.c ext2_block_relocator.c ext2_buffer.c llseek.c\
+ ext2_inode_relocator.c ext2_meta.c ext2_resize.c ext2_unix_io.c tune.c\
+ swapfs.c
#libext2resize_a_SOURCES += ext2_journal.c ext2_mkfs.c
--- BUILD/ext2resize-1.1.19/src/ext2.c
+++ BUILD/ext2resize-1.1.19/src/ext2.c
@@ -1,6 +1,7 @@
/*
ext2.c -- generic ext2 stuff
Copyright (C) 1998, 1999, 2000 Lennert Buytenhek <buytenh@gnu.org>
+ Portions copyright (C) Red Hat, Inc., 2004
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,6 +16,8 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ Byte-ordering fixes: Stephen C. Tweedie <sct@redhat.com>
*/
static const char _ext2_c[] = "$Id: ext2.c,v 1.29 2004/09/30 14:01:40 sct Exp $";
@@ -254,6 +257,9 @@
bh = ext2_bread(fs, blk);
memcpy(inode, bh->data + off, sizeof(struct ext2_inode));
ext2_brelse(bh, 0);
+#ifdef WORDS_BIGENDIAN
+ ext2fs_swap_inode(fs, inode, inode, 0);
+#endif
}
void ext2_set_inode_state(struct ext2_fs *fs, ino_t ino, int state,
@@ -771,10 +777,10 @@
int ret = 1;
if (fs->flags & FL_DEBUG) {
- if (ioc == EXT2_IOC_GROUP_EXTEND)
+ if (ioc == (int) EXT2_IOC_GROUP_EXTEND)
printf("%s: EXTEND group to %u blocks\n",
__FUNCTION__, *(__u32 *)arg);
- else if (ioc == EXT2_IOC_GROUP_ADD)
+ else if (ioc == (int) EXT2_IOC_GROUP_ADD)
printf("%s: ADD group %u\n",
__FUNCTION__, *(__u32 *)arg);
else
@@ -890,6 +896,12 @@
handle->ops->set_blocksize(handle->cookie, 10);
ext2_read_blocks(fs, &fs->sb, 1, 1);
+ /* This will not work with "alien" byte-ordering (ie. bigendian
+ * on-disk), only ext2-standard little-endian on disk. We
+ * should deal OK with bigendian hosts, though. */
+#ifdef WORDS_BIGENDIAN
+ ext2fs_swap_super(&fs->sb);
+#endif
if (fs->sb.s_magic != EXT2_SUPER_MAGIC) {
fprintf(stderr, "%s: ext2_open: invalid superblock\n",fs->prog);
goto error_free_fs;
@@ -1012,6 +1024,14 @@
goto error_free_bcache;
}
ext2_read_blocks(fs, fs->gd, fs->sb.s_first_data_block+1, fs->gdblocks);
+#ifdef WORDS_BIGENDIAN
+ {
+ int i;
+
+ for (i=0; i<fs->numgroups; i++)
+ ext2fs_swap_group_desc(&fs->gd[i]);
+ }
+#endif
if (!ext2_determine_itoffset(fs))
goto error_free_gd;
--- BUILD/ext2resize-1.1.19/src/ext2.h
+++ BUILD/ext2resize-1.1.19/src/ext2.h
@@ -38,7 +38,7 @@
#define min(a,b) (((a)<(b))?(a):(b))
#endif
-#if __BYTE_ORDER__ == __BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
#define le16_to_cpu(a) ((((a) & 0x00ffU) << 8) | (((a) & 0xff00) >> 8))
#define le32_to_cpu(a) ((((a) & 0x000000ffU) << 24)|(((a) & 0x0000ff00U) << 8)\
|(((a) & 0xff000000U) >> 24)|(((a) & 0x00ff0000U) >> 8))
@@ -237,6 +237,13 @@
/* resize */
int ext2_resize_fs(struct ext2_fs *fs);
+/* fs byte-swap */
+void ext2fs_swap_super(struct ext2_super_block * sb);
+void ext2fs_swap_group_desc(struct ext2_group_desc *gdp);
+void ext2fs_swap_inode(struct ext2_fs *fs,
+ struct ext2_inode *t, struct ext2_inode *f,
+ int hostorder);
+
/* unix I/O */
loff_t ext2_llseek(unsigned int fd, loff_t offset, unsigned int whence);
struct ext2_dev_handle *ext2_make_dev_handle_from_file(char *dev, char *dir,
--- BUILD/ext2resize-1.1.19/src/ext2_fs.h
+++ BUILD/ext2resize-1.1.19/src/ext2_fs.h
@@ -459,8 +459,15 @@
__u32 s_journal_inum; /* inode number of journal file */
__u32 s_journal_dev; /* device number of journal file */
__u32 s_last_orphan; /* start of list of inodes to delete */
-
- __u32 s_reserved[197]; /* Padding to the end of the block */
+ __u32 s_hash_seed[4]; /* HTREE hash seed */
+ __u8 s_def_hash_version; /* Default hash version to use */
+ __u8 s_jnl_backup_type; /* Default type of journal backup */
+ __u16 s_reserved_word_pad;
+ __u32 s_default_mount_opts;
+ __u32 s_first_meta_bg; /* First metablock group */
+ __u32 s_mkfs_time; /* When the filesystem was created */
+ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */
+ __u32 s_reserved[172]; /* Padding to the end of the block */
};
/*
--- BUILD/ext2resize-1.1.19/src/ext2online.c
+++ BUILD/ext2resize-1.1.19/src/ext2online.c
@@ -238,10 +238,12 @@
unsigned int three = 1, five = 5, seven = 7;
unsigned int group;
int last = 0;
-
- if (dindir_buf[gdb_num % apb] != pri_blk) {
+ blk_t dblk;
+
+ dblk = le32_to_cpu(dindir_buf[gdb_num % apb]);
+ if (dblk != pri_blk) {
fprintf(stderr, "found %d not %d at %d[%d]\n",
- dindir_buf[gdb_num % apb], pri_blk,
+ dblk, pri_blk,
fs->resize.i_block[EXT2_DIND_BLOCK],
gdb_num % apb);
ret = 0;
@@ -253,16 +255,17 @@
while ((group = ext2_list_backups(fs, &three, &five, &seven)) <
fs->numgroups) {
__u32 *pri_buf = (__u32 *)(pri_bh->data);
- blk_t bku_blk;
+ blk_t bku_blk, pblk;
bku_blk = pri_blk + group * fs->sb.s_blocks_per_group;
if (fs->flags & FL_DEBUG)
printf("checking for group block %d in Bond\n",
bku_blk);
- if (pri_buf[last] != bku_blk) {
+ pblk = le32_to_cpu(pri_buf[last]);
+ if (pblk != bku_blk) {
fprintf(stderr, "found %d not %d at %d[%d]\n",
- pri_buf[last], bku_blk, pri_blk, last);
+ pblk, bku_blk, pri_blk, last);
ext2_brelse(pri_bh, 0);
ret = 0;
goto exit_dind;
@@ -340,7 +343,9 @@
}
gdp = (struct ext2_group_desc *)bh->data +
(group % (fs->blocksize/sizeof(struct ext2_group_desc)));
-
+#ifdef WORDS_BIGENDIAN
+ ext2fs_swap_group_desc(gdp);
+#endif
gdp->bg_block_bitmap = start + new_bb;
gdp->bg_inode_bitmap = start + new_ib;
gdp->bg_inode_table = start + fs->itoffset;
--- BUILD/ext2resize-1.1.19/src/swapfs.c
+++ BUILD/ext2resize-1.1.19/src/swapfs.c
@@ -0,0 +1,177 @@
+/*
+ * swapfs.c --- swap ext2 filesystem data structures
+ *
+ * Copyright (C) 1995, 1996, 2002 Theodore Ts'o.
+ *
+ * %Begin-Header%
+ * This file may be redistributed under the terms of the GNU Public
+ * License.
+ * %End-Header%
+ *
+ * Taken from e2fsprogs for ext2online by Stephen Tweedie <sct@redhat.com>
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+
+#include "config.h"
+#include "ext2.h"
+#include "ext2_fs.h"
+
+#define LINUX_S_IFMT 00170000
+#define LINUX_S_IFLNK 00120000
+#define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK)
+
+static inline __u16 ext2fs_swab16(__u16 val)
+{
+ return (val >> 8) | (val << 8);
+}
+
+static inline __u32 ext2fs_swab32(__u32 val)
+{
+ return ((val>>24) | ((val>>8)&0xFF00) |
+ ((val<<8)&0xFF0000) | (val<<24));
+}
+
+static inline blk_t ext2fs_inode_data_blocks(struct ext2_fs *fs,
+ struct ext2_inode *inode)
+{
+ return inode->i_blocks -
+ (inode->i_file_acl ? fs->blocksize >> 9 : 0);
+}
+
+void ext2fs_swap_super(struct ext2_super_block * sb)
+{
+ int i;
+ sb->s_inodes_count = ext2fs_swab32(sb->s_inodes_count);
+ sb->s_blocks_count = ext2fs_swab32(sb->s_blocks_count);
+ sb->s_r_blocks_count = ext2fs_swab32(sb->s_r_blocks_count);
+ sb->s_free_blocks_count = ext2fs_swab32(sb->s_free_blocks_count);
+ sb->s_free_inodes_count = ext2fs_swab32(sb->s_free_inodes_count);
+ sb->s_first_data_block = ext2fs_swab32(sb->s_first_data_block);
+ sb->s_log_block_size = ext2fs_swab32(sb->s_log_block_size);
+ sb->s_log_frag_size = ext2fs_swab32(sb->s_log_frag_size);
+ sb->s_blocks_per_group = ext2fs_swab32(sb->s_blocks_per_group);
+ sb->s_frags_per_group = ext2fs_swab32(sb->s_frags_per_group);
+ sb->s_inodes_per_group = ext2fs_swab32(sb->s_inodes_per_group);
+ sb->s_mtime = ext2fs_swab32(sb->s_mtime);
+ sb->s_wtime = ext2fs_swab32(sb->s_wtime);
+ sb->s_mnt_count = ext2fs_swab16(sb->s_mnt_count);
+ sb->s_max_mnt_count = ext2fs_swab16(sb->s_max_mnt_count);
+ sb->s_magic = ext2fs_swab16(sb->s_magic);
+ sb->s_state = ext2fs_swab16(sb->s_state);
+ sb->s_errors = ext2fs_swab16(sb->s_errors);
+ sb->s_minor_rev_level = ext2fs_swab16(sb->s_minor_rev_level);
+ sb->s_lastcheck = ext2fs_swab32(sb->s_lastcheck);
+ sb->s_checkinterval = ext2fs_swab32(sb->s_checkinterval);
+ sb->s_creator_os = ext2fs_swab32(sb->s_creator_os);
+ sb->s_rev_level = ext2fs_swab32(sb->s_rev_level);
+ sb->s_def_resuid = ext2fs_swab16(sb->s_def_resuid);
+ sb->s_def_resgid = ext2fs_swab16(sb->s_def_resgid);
+ sb->s_first_ino = ext2fs_swab32(sb->s_first_ino);
+ sb->s_inode_size = ext2fs_swab16(sb->s_inode_size);
+ sb->s_block_group_nr = ext2fs_swab16(sb->s_block_group_nr);
+ sb->s_feature_compat = ext2fs_swab32(sb->s_feature_compat);
+ sb->s_feature_incompat = ext2fs_swab32(sb->s_feature_incompat);
+ sb->s_feature_ro_compat = ext2fs_swab32(sb->s_feature_ro_compat);
+ sb->s_algorithm_usage_bitmap = ext2fs_swab32(sb->s_algorithm_usage_bitmap);
+ sb->s_reserved_gdt_blocks = ext2fs_swab16(sb->s_reserved_gdt_blocks);
+ sb->s_journal_inum = ext2fs_swab32(sb->s_journal_inum);
+ sb->s_journal_dev = ext2fs_swab32(sb->s_journal_dev);
+ sb->s_last_orphan = ext2fs_swab32(sb->s_last_orphan);
+ sb->s_default_mount_opts = ext2fs_swab32(sb->s_default_mount_opts);
+ sb->s_first_meta_bg = ext2fs_swab32(sb->s_first_meta_bg);
+ sb->s_mkfs_time = ext2fs_swab32(sb->s_mkfs_time);
+ for (i=0; i < 4; i++)
+ sb->s_hash_seed[i] = ext2fs_swab32(sb->s_hash_seed[i]);
+ for (i=0; i < 17; i++)
+ sb->s_jnl_blocks[i] = ext2fs_swab32(sb->s_jnl_blocks[i]);
+
+}
+
+void ext2fs_swap_group_desc(struct ext2_group_desc *gdp)
+{
+ gdp->bg_block_bitmap = ext2fs_swab32(gdp->bg_block_bitmap);
+ gdp->bg_inode_bitmap = ext2fs_swab32(gdp->bg_inode_bitmap);
+ gdp->bg_inode_table = ext2fs_swab32(gdp->bg_inode_table);
+ gdp->bg_free_blocks_count = ext2fs_swab16(gdp->bg_free_blocks_count);
+ gdp->bg_free_inodes_count = ext2fs_swab16(gdp->bg_free_inodes_count);
+ gdp->bg_used_dirs_count = ext2fs_swab16(gdp->bg_used_dirs_count);
+}
+
+void ext2fs_swap_inode(struct ext2_fs *fs,
+ struct ext2_inode *t, struct ext2_inode *f,
+ int hostorder)
+{
+ unsigned i;
+ int islnk = 0;
+
+ if (hostorder && LINUX_S_ISLNK(f->i_mode))
+ islnk = 1;
+ t->i_mode = ext2fs_swab16(f->i_mode);
+ if (!hostorder && LINUX_S_ISLNK(t->i_mode))
+ islnk = 1;
+ t->i_uid = ext2fs_swab16(f->i_uid);
+ t->i_size = ext2fs_swab32(f->i_size);
+ t->i_atime = ext2fs_swab32(f->i_atime);
+ t->i_ctime = ext2fs_swab32(f->i_ctime);
+ t->i_mtime = ext2fs_swab32(f->i_mtime);
+ t->i_dtime = ext2fs_swab32(f->i_dtime);
+ t->i_gid = ext2fs_swab16(f->i_gid);
+ t->i_links_count = ext2fs_swab16(f->i_links_count);
+ t->i_blocks = ext2fs_swab32(f->i_blocks);
+ t->i_flags = ext2fs_swab32(f->i_flags);
+ t->i_file_acl = ext2fs_swab32(f->i_file_acl);
+ t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
+ if (!islnk || ext2fs_inode_data_blocks(fs, t)) {
+ for (i = 0; i < EXT2_N_BLOCKS; i++)
+ t->i_block[i] = ext2fs_swab32(f->i_block[i]);
+ } else if (t != f) {
+ for (i = 0; i < EXT2_N_BLOCKS; i++)
+ t->i_block[i] = f->i_block[i];
+ }
+ t->i_generation = ext2fs_swab32(f->i_generation);
+ t->i_faddr = ext2fs_swab32(f->i_faddr);
+
+ switch (fs->sb.s_creator_os) {
+ case EXT2_OS_LINUX:
+ t->osd1.linux1.l_i_reserved1 =
+ ext2fs_swab32(f->osd1.linux1.l_i_reserved1);
+ t->osd2.linux2.l_i_frag = f->osd2.linux2.l_i_frag;
+ t->osd2.linux2.l_i_fsize = f->osd2.linux2.l_i_fsize;
+ t->osd2.linux2.i_pad1 = ext2fs_swab16(f->osd2.linux2.i_pad1);
+ t->osd2.linux2.l_i_uid_high =
+ ext2fs_swab16 (f->osd2.linux2.l_i_uid_high);
+ t->osd2.linux2.l_i_gid_high =
+ ext2fs_swab16 (f->osd2.linux2.l_i_gid_high);
+ t->osd2.linux2.l_i_reserved2 =
+ ext2fs_swab32(f->osd2.linux2.l_i_reserved2);
+ break;
+ case EXT2_OS_HURD:
+ t->osd1.hurd1.h_i_translator =
+ ext2fs_swab32 (f->osd1.hurd1.h_i_translator);
+ t->osd2.hurd2.h_i_frag = f->osd2.hurd2.h_i_frag;
+ t->osd2.hurd2.h_i_fsize = f->osd2.hurd2.h_i_fsize;
+ t->osd2.hurd2.h_i_mode_high =
+ ext2fs_swab16 (f->osd2.hurd2.h_i_mode_high);
+ t->osd2.hurd2.h_i_uid_high =
+ ext2fs_swab16 (f->osd2.hurd2.h_i_uid_high);
+ t->osd2.hurd2.h_i_gid_high =
+ ext2fs_swab16 (f->osd2.hurd2.h_i_gid_high);
+ t->osd2.hurd2.h_i_author =
+ ext2fs_swab32 (f->osd2.hurd2.h_i_author);
+ break;
+ case EXT2_OS_MASIX:
+ t->osd1.masix1.m_i_reserved1 =
+ ext2fs_swab32(f->osd1.masix1.m_i_reserved1);
+ t->osd2.masix2.m_i_frag = f->osd2.masix2.m_i_frag;
+ t->osd2.masix2.m_i_fsize = f->osd2.masix2.m_i_fsize;
+ t->osd2.masix2.m_pad1 = ext2fs_swab16(f->osd2.masix2.m_pad1);
+ t->osd2.masix2.m_i_reserved2[0] =
+ ext2fs_swab32(f->osd2.masix2.m_i_reserved2[0]);
+ t->osd2.masix2.m_i_reserved2[1] =
+ ext2fs_swab32(f->osd2.masix2.m_i_reserved2[1]);
+ break;
+ }
+}

View File

@ -1,14 +0,0 @@
--- BUILD/ext2resize-1.1.19/src/ext2online.c
+++ BUILD/ext2resize-1.1.19/src/ext2online.c
@@ -512,9 +512,9 @@
*/
if (ext2_ioctl(fs, EXT2_IOC_GROUP_EXTEND, &size))
fs->flags |= FL_IOCTL;
- else if (errno != ENOTTY)
+ else
return 0;
-
+
ra = fs->newblocks - size;
/* Add new groups */

View File

@ -1,20 +0,0 @@
--- BUILD/ext2resize-1.1.19/src/ext2_unix_io.c
+++ BUILD/ext2resize-1.1.19/src/ext2_unix_io.c
@@ -256,7 +256,7 @@
goto error_free_cookie;
}
- if ((monster->fdwrite = open(dev, O_WRONLY | O_LARGEFILE)) < 0) {
+ if ((monster->fdwrite = open(dev, O_RDONLY | O_LARGEFILE)) < 0) {
char msg[4097];
snprintf(msg, 4096, "%s: writing %s", prog, dev);
@@ -301,7 +301,7 @@
return dh;
error_close_write:
- close(monster->fdread);
+ close(monster->fdwrite);
error_close_read:
close(monster->fdread);