Commit Graph

674 Commits (977ac8731bf3bd934421dd8107e77325ec7e6de7)

Author SHA1 Message Date
Theodore Ts'o 1b4cd9c746 sparse.c (ext2fs_list_backups, ext2fs_bg_has_super),
res_gdt.c (list_backups), closefs.c (ext2fs_bg_has_super),
	ext2fs.h: Move ext2fs_list_backups() to res_gdt.c, and
	ext2fs_bg_has_super() back to closefs.c.  There's no
	reason for the new file, since list_backups() isn't being
	used by any other functions, and can be made static, and
	all users of the ext2fs filesystem will have to call
	ext2fs_close() anyway.
2004-12-15 18:06:52 -05:00
Theodore Ts'o 22c6821a24 Supplied changelog for resize inode patch. 2004-12-15 17:26:32 -05:00
Theodore Ts'o d323f8fb36 Add support for on-line resizing ala the resize inode. This patch
is taken from Fedora Core 3's e2fsprogs 1.35-11.2.src.rpm's 
e2fsprogs-resize.patch.
2004-12-15 14:39:16 -05:00
Theodore Ts'o 522798d342 Add install-strip and install-shlibs-strip targets
Use Linux-kernel-style makefile output for "make install"

Update intl/Makefile.in to version from gettext 0.14.1
2004-12-15 11:28:55 -05:00
Theodore Ts'o 6d4022786d Use MKINSTALLDIRS macro so that the Makefiles can find the script
correctly.

Update Makefile dependencies.

Update "make depend" production so that it filters out comments
inserted by newer gcc compilers.

Remove sync from e2fsck's "make all" target.
2004-12-14 21:46:26 -05:00
Theodore Ts'o 3838f7df13 Avoid using uint and uchar types when probing for ocfs2 filesystems
in the blkid library, to allow compilation using dietlibc.
2004-11-30 19:05:38 -05:00
Theodore Ts'o 2e8ca9a26b Add support for passing options to the io layer using the URL syntax. For
example, /tmp/test.img?offset=1024.  Multiple options can separated using
the & character, although at the moment the only option implemented is
the offset option in the unix_io layer.
2004-11-30 14:07:11 -05:00
Theodore Ts'o 47204ff983 Use Linux-kernel-style makefile output to make it easier to
see errors/warnings.
2004-11-30 10:52:27 -05:00
Theodore Ts'o 39dc1c45cb Add definition for the extents filesystem feature and inode flag.
Change the maximum allowable blocksize to be 65536.  This allows e2fsck to
check filesystems with a pagesize of 65536, and mke2fs to accept -b 65536.
Of course such a filesystem will not currently work on a Linux/x86 system,
at least not as of this writing!
2004-11-29 22:14:23 -05:00
Theodore Ts'o 921f4ad536 Remove support for EVMS 1.x plugin library. 2004-11-19 17:25:27 -05:00
Theodore Ts'o 2b5901d9c7 Remove the a.out DLL support, since it's been obsolete and unmaintained
for a long time now.
2004-11-19 17:06:47 -05:00
Theodore Ts'o 4b8f81aace probe.c (probe_ocfs): Fix bug where the wrong size for "ocfs1"
was being passed to blkid_set_tag().  Thanks to Andrea
	Dilger for pointing this out.
2004-11-19 14:28:01 -05:00
Theodore Ts'o 1a9c8c35ba getsize.c (ext2fs_get_device_size): Add support for Windows
9x/NT under Cygwin.  Thanks to Sam Robb
	(samrobb@users.sourceforge.net) for pointing this and the
	suggested code patch.
2004-10-08 12:45:24 -04:00
Theodore Ts'o 414846b126 Add support for ocfs2 detection to the blkid library,
courtesy of manish.singh@oracle.com
2004-09-17 21:37:49 -04:00
Theodore Ts'o 9ee42c9509 gen_uuid.c (get_node_id): glibc always defines AF_LINK, so only
try to use struct sockaddr_dl if HAVE_NET_IF_DL_H is
	defined.  (Addresses Debian Bug #256669)
2004-09-17 20:38:27 -04:00
Theodore Ts'o 56eb4d4749 Remove XSI:isms for greater portability. (Addresses
Debian Bug #255589)
2004-09-17 19:54:22 -04:00
Theodore Ts'o 9845cf5dbd Clean up the header file #include's for lib/blkid/getsize.c
and lib/ext2fs/getsize.c

In lib/blkid/getsize.c, include <sys/disk.h> if present since
this is where the DIOCGMEDIASIZE ioctl is defined on FreeBSD.
(Addresses Debian Bug #264630)
2004-09-17 19:07:03 -04:00
Theodore Ts'o 488f3c2dad On non-linux systems, use lseek64() if it is present in
ext2fs_llseek() and blkid_llseek().  (Addresses Debian bug #269044)
2004-09-17 17:47:12 -04:00
Theodore Ts'o 1ad54a940c Add ability for debugfs to use a separate source of data blocks when
reading from an e2image file.  (New -d option)

Add new functions ext2fs_get_data_io, ext2fs_set_data_io,
ext2fs_rewrite_to_io to libext2fs library.
2004-07-28 21:11:48 -04:00
Theodore Ts'o 919994abc0 setflags.c, fsetflags.c: On linux systems, undefine HAVE_CHFLAGS
to deal with lame glibc's that define this function
	without actually implementing it.  Can you say "attractive
	nuisance", boys and girls?   I knew you could!  (Thanks to
	Pavel Troller for reporting this braindamage.)
2004-06-25 00:52:08 -04:00
Theodore Ts'o 37a1ee9b99 uuid.h (UUID_DEFINE): Make the UUID defined as a static
variable, with __attribute__ ((unused)) if we are using GCC.
2004-05-27 20:24:52 -04:00
Theodore Ts'o a63d126783 closefs.c (ext2fs_flush): Make sure the master superblock is
written last, and only after other I/O has been flushed to
	disk.  Thanks to Junfeng Yang from the Stanford
	Metacompilation group for pointing a potential ordering
	constraint problem if we don't write things out in the
	right order.
2004-05-26 21:29:14 -04:00
Theodore Ts'o a002e7e200 Implement the ability for the test_io mechanism to abort after n reads
or writes to a particular block.  The block is specified by
	TEST_IO_BLOCK environment variable, and the read/write count
	by the TEST_IO_READ_ABORT and TEST_IO_WRITE_ABORT environment
	variables.  The block data is now only dumped if the 0x10 bit
	is set in TEST_IO_FLAGS.
2004-05-26 21:04:07 -04:00
Theodore Ts'o 1b510f57f4 read.c (blkid_read_cache): Add missing fclose() which was
causing a memory and file descriptor leak.  Thanks to
	magnus.fromreide at teligent.se.
2004-05-15 17:27:43 -04:00
Theodore Ts'o aa5c0a4562 Remove .cvsignore files; they were out of date, and causes lintian
to flame about their presence in the source tarball.
2004-05-05 09:02:36 -04:00
Theodore Ts'o 6d4934974f Update and clean up uuid man pages, including renaming libuuid.3 to
uuid.3

Eliminate empty lines at end of uuid.h
2004-05-04 22:05:05 -04:00
Theodore Ts'o d1492994a5 gen_uuid.c (uuid_generate_time): Mask off the timestamp to avoid
a Y8.8888K problem.
2004-05-04 20:51:02 -04:00
Theodore Ts'o 7ce0806406 probe.c (blkid_verify_devname): If the time is earlier than the
last modified time of the device, then force a reverify;
	it means the system time may not be trustworthy.
2004-04-19 21:42:18 -04:00
Theodore Ts'o ebfd60f185 Clarified that the lib/uuid directory is under a BSD-style and
referred the reader to lib/uuid/COPYING, a new file.
2004-04-12 13:19:21 -04:00
Theodore Ts'o 7a3a386b9e In the blkid library, if the BLKID_FILE environment
variable is set, use it to find the blkid.tab file if the
calling application did not supply a filename.
2004-04-12 07:26:23 -04:00
Theodore Ts'o dd60705665 Refine the build process to avoid re-running subst all the time on
some generated files, by having subst update the modtime on these 
files even when the generated file hasn't changed.  We do this with 
generated files that do not have any downstream dependencies.
2004-04-03 13:53:46 -05:00
Theodore Ts'o 9dd97ae37d Change licensing of libuuid man pages from GPL to 3-clause BSD-style,
with permission from Andreas Dilger (the original author of the man
pages), email dated Mon, 29 Mar 2004 23:11:53 -0700, Message-ID
20040330061153.GD1177@schnapps.adilger.int.
2004-04-03 11:24:10 -05:00
Theodore Ts'o 31808116a1 Change the use of the term "internal format" to "binary representation"
in the uuid_parse and uuid_unparse man pages.
2004-04-03 10:48:25 -05:00
Theodore Ts'o 2625803ecf Use C99 stdint.h types instead of custom types in the uuid library. 2004-04-03 10:20:26 -05:00
Theodore Ts'o 13be1fff00 gen_uuid.c (get_node_id): Clean up AF_LINK #ifdef's for Darwin. 2004-03-30 01:32:31 -05:00
Matthias Andree 83e692e88b unix_io.c, pass1.c:
int -> unsigned for 1 bit wide bitfields - we cannot have a value and a sign in 1 bit.
  Fixes some of the Intel C++ 8.0 warnings (-w1 level).
2004-03-30 04:17:14 +02:00
Matthias Andree 289e0557c2 GNU/KFreeBSD portability fixes. (Addresses Debian Bug #239934) 2004-03-30 03:57:41 +02:00
Theodore Ts'o d3d741fc38 Add the uuid_unparse_upper and uuid_unparse_lower functions to the
uuid library.
2004-03-22 16:22:28 -05:00
Theodore Ts'o 1cdb6f7602 Don't close the file descriptor when determining the size.
This bug was introduced in the previous getsize changes, 
and was screwing up the blkid library probe functions.
(Addresses Debian Bug #239191)
2004-03-21 20:16:19 -05:00
Theodore Ts'o 1bbfec624c Change the license on the UUID library to be 3-clause BSD-style 2004-03-20 14:02:24 -05:00
Theodore Ts'o 880f30a7eb Add UUID type #define's, and add an CPP macro to define
UUID constants.
2004-03-19 21:54:13 -05:00
Theodore Ts'o a5aa379710 Use 14 bits for the clock sequence, instead of just 13 bits when
generating UUID's.
2004-03-19 19:56:55 -05:00
Theodore Ts'o 84ea6e70b7 Fix Darwin/Mac OS X support to fetch the ethernet address in the uuid library. 2004-03-19 19:29:17 -05:00
Theodore Ts'o 2c5cfbcb99 Only use the BLKGETSIZE64 ioctl on Linux 2.6 since it is
unreliable in Linux 2.4.  (Addresses Debian Bug #236528).  

Fix typo in the ioctl used for Mac OS X.
2004-03-08 14:12:09 -05:00
Theodore Ts'o 9387c281ef probe.c (probe_ocfs), probe.h: Add support for the Oracle
Cluster Filesystem (ocfs).  Patches courtesy of Rusty
	Lynch (rusty@linux.co.intel.com).
2004-03-04 19:59:58 -05:00
Theodore Ts'o 85b8700344 Update getsize functions to use the Apple Darwin and Linux 64-bit
ioctl's.
2004-03-02 10:11:11 -05:00
Theodore Ts'o 434661f8d5 Patch from Brian Bergstrand to use the correct -fPIC flag for
Darwin in order to get rid of the compiler warning.
2004-02-29 22:46:49 -05:00
Theodore Ts'o b70b1167fe Update version number for e2fsprogs 1.35 release. 2004-02-28 10:52:35 -05:00
Theodore Ts'o e47fd8414d ext2fs.h (ext2fs_resize_mem): Fix C++ problem. (Addresses Red
Hat Bugzilla #112448; thanks Thomas Woerner from Red Hat.)
2004-02-21 21:04:30 -05:00
Theodore Ts'o 795afc4483 Fix libext2fs and debugfs to correctly deal with symlinks that have
extended attribute information.  (Addresses Debian Bug #232328)
2004-02-21 20:54:31 -05:00
Theodore Ts'o 1daf758571 Update for WIP release 1.35-WIP release dated 31-Jan-2004. 2004-01-31 22:33:16 -05:00
Theodore Ts'o 3c203cb683 fgetflags.c, fgetversion.c, fsetflags.c, fsetversion.c: Apply
patch from Brian Bergstrand to support ext2_ioctl() in
	Darwin.  This is implemented via the fsctl system call.
2004-01-31 21:16:35 -05:00
Theodore Ts'o 9c5534d484 gen_uuid.c (uuid_generate_time): Fix bug pointed out by Ralf
S. Engelshall; when generating a random ethernet address
	because one is not available, set the least significant
	bit of the first byte of the MAC address, since it is the
	first bit to be transmitted, and is therefore the
	multicast bit.
2004-01-30 02:07:13 -05:00
Theodore Ts'o 1ba7a2f2b6 Fix a byte swap bugs, including one which caused e2fsck to
incorrectly treat as valid symlinks created with SE Linux 
(Debian bug #228723) as well as failing the f_journal test case on 
big endian systems due to the backup journal blocks not being swapped.
2004-01-30 01:48:06 -05:00
Matthias Andree b34cbddbd6 Re-add FreeBSD support.
Tested on FreeBSD 5.2-CURRENT as of 2003-12-28.
Tested on FreeBSD 4.9-STABLE  as of 2003-12-27.
2003-12-28 18:21:26 +01:00
Matthias Andree b969b1b8a5 Fix more compiler warnings. 2003-12-28 13:04:35 +01:00
Theodore Ts'o 09e7220f62 com_err.3: Fix C syntax error pointed out by ESR. 2003-12-11 11:24:44 -05:00
Theodore Ts'o 544349270e Fix gcc -Wall nitpicks 2003-12-07 01:28:50 -05:00
Theodore Ts'o 068cab5bd1 et_c.awk: Add declaration of the Heimdal initialization routine
to avoid gcc -Wall complaints

(Incomplete checkin --- see previous changeset as well)
2003-11-28 09:38:13 -05:00
Theodore Ts'o 52501d440d et_c.awk: Add declaration of the Heimdal initialization routine
to avoid gcc -Wall complaints

Rename test cases to spell Heimdal correctly (only one 'l').
2003-11-28 09:36:37 -05:00
Theodore Ts'o 2540bb79b7 com_err.h, com_err.c: Use GCC attributes to mark com_err and
default_com_err_proc as taking printf-style format
	strings.
2003-11-26 23:19:28 -05:00
Theodore Ts'o 8ce230959c com_err.h: Retore the type of n_msgs in the error_table
structure to "int" from "unsigned int" fix a core dumping 
	bug in the com_right() function.  (Addresses Debian bug 
	#213450)
2003-11-22 13:54:38 -05:00
Theodore Ts'o ef344e13d2 Centeralize calculation of which blocks are reserved/used for
the superblock and block group descriptors into two functions:
ext2fs_reserve_super_and_bgd, found in lib/ext2fs/alloc_sb.c, and
ext2fs_super_and_bgd_lock, found in lib/ext2fs/close.c.

Change e2fsck/pass1.c (mark_table_blocks), lib/ext2fs/closefs.c
(ext2fs_flush), lib/ext2fs/initialize.c (ext2fs_initialize),
and misc/dumpe2fs.c (list_desc) to use these functions.

e2fsck/ChangeLog
    pass1.c (mark_table_blocks): Use the new function
    	ext2fs_reserve_super_and_bgd to calculate the blocks to be
    	reserved.

lib/ext2fs/ChangeLog
    closefs.c (ext2fs_super_and_bgd_loc): New function which
    	centralizes the calculation of the superblock and block
    	group descriptors.
    	(ext2fs_flush): Use ext2fs_super_and_bgd_lock to figure
    	out where to write the superblock and block group
    	descriptors.
    
    alloc_sb.c (ext2fs_reserve_super_and_bgd): New function which
    	reserves space in the block bitmap using
    	ext2fs_super_and_bgd_loc.
    
    initialize.c (ext2fs_initialize): Use
    	ext2fs_reserve_super_and_bgd to initialize the block bitmap.

misc/ChangeLog
    dumpe2fs.c (list_desc): Use ext2fs_super_and_bgd_loc to
    	determine the locations of the superblock and block group
     	descriptors.
2003-11-21 09:02:21 -05:00
Theodore Ts'o a435ec3449 Add support for backing up the journal inode location in the
superblock.  E2fsck will automatically save the journal information
in the superblock if it is not there already, and will use it if the
journal inode appears to be corrupted.  ext2fs_add_journal_inode() 
will also save the backup information, so that new filesystems
created by mke2fs and filesystems that have journals added via
tune2fs will also have journal location written to the superblock as
well.  Debugfs's logdump command has been enhanced so that it can
use the journal information in the superblock.

The debugfs man page has been improved to more fully describe the
logdump command.

Added two new functions, ext2fs_file_open2() and 
ext2fs_inode_io_intern2() which take a pointer to an inode structure;
this is needed so that e2fsck and debugfs can synthesize a
fake journal inode and use it to access the journal.
2003-08-21 00:40:26 -04:00
Theodore Ts'o 51bc084517 Makefile.in: Delete com_err.info on a make clean
testcases: Update to reflect fixed prototype for
	initialize_xxx_err_table_r.
2003-08-20 12:54:31 -04:00
Theodore Ts'o 924b083a3e et_h.awk: Fix wrong prototype for initialize_xxx_err_table_r.
(Thanks to Gombas Gabor for pointing this out, addresses
	Debian bug #204332)
2003-08-19 08:36:48 -04:00
Theodore Ts'o 74832b53a0 fs_ext2.c (fs_cleanup, fs_init_task, fs_set_volumes): Use an
ugly union to fix pointer aliasing problems in lib/evms.
2003-08-01 11:02:24 -04:00
Theodore Ts'o c4e3d3f374 ext2fs_getmem(), ext2fs_free_mem(), and ext2fs_resize_mem()
all now take a 'void *' instead of a 'void **' in order to 
avoid pointer aliasing problems with GCC 3.x.
2003-08-01 09:41:07 -04:00
Theodore Ts'o 44104b2b37 Add Heimdal compile_et extensions from Philipp Thomas <pthomas@suse.de> 2003-08-01 08:59:40 -04:00
Theodore Ts'o 9c7ec17809 Update for 1.34 release. 2003-07-26 01:03:34 -04:00
Theodore Ts'o c6df04bbdb Update makefile dependencies. 2003-07-23 09:53:06 -04:00
Theodore Ts'o 3de5bf6106 probe.c (probe_udf): Add specific UDF probing code, and probe
UDF before checking for ISO9660 filesystems.
2003-07-22 01:06:36 -04:00
Theodore Ts'o 78e2edf796 probe.c (blkid_known_fstype): New function which returns true if
the filesystem type is one which this blkid library supports.
2003-07-21 19:42:19 -04:00
Theodore Ts'o a30b9446d1 probe.c: When revalidating a filesystem in the blkid library,
delete the LABEL tag if the filesystem no longer has a label.
2003-07-20 11:22:34 -04:00
Theodore Ts'o 849c610250 tag.c (blkid_find_dev_with_tag): If blkid_probe_all() returns an
error, then reflect that error upwards; don't try again
	(forever).  This prevents an infinite loop when /proc and
	the /etc/blkid.tab file are not present.
2003-07-18 19:10:28 -04:00
Theodore Ts'o 48e6e81362 Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
Theodore Ts'o 7d7bdd578b Fix bug in resize2fs which caused it to fail on filesystems with a
non-empty bad block list.  Resize2fs now discards any blocks on the 
badblock list which are no longer part of the filesystem as the result
of a filesystem shrink.  (Note: this means that shrinking and then
enlarging a filesystem is no longer a reversible operation;
information about bad blocks in the part of the filesystem
which is to be chopped off will be lost.)
2003-06-24 17:34:02 -04:00
Theodore Ts'o d339f2684d Makefile.in (ELF_OTHER_LIBS): The blkid library depends on the
uuid library.  (Addresses Debian bug: #194094)
2003-05-21 17:56:36 -04:00
Theodore Ts'o 93d5c38791 mke2fs.c (PRS, set_fs_defaults): If the sector size of the
device is larger than the default block size, then use the
	sector size of the device as the default block size.

getsectsize.c (ext2fs_get_device_sectsize): New function which
   	returns the hardware sector size (if it is available).
2003-05-21 17:28:29 -04:00
Theodore Ts'o 813bde19f5 Add package dependency to shlibs for comerr to indicate support
for kth compatibility.  (Closes Debian bug #193096)
2003-05-13 23:53:20 -04:00
Theodore Ts'o b8a953157b unix_io.c: Add #ifdef NO_IO_CACHE which disables all userspace
caching by the unix_io layer.  Not enabled, only for
	debugging.
2003-05-13 23:41:29 -04:00
Theodore Ts'o 58f9d9e679 Update debian changelog.
Declare comerr-dev as replacing << e2fslibs-dev 1.33-2, to avoid
        errors when upgrading to the new versions of comerr-dev and
        e2fslibs-dev

Declare init_error_table as taking a long for the second argument.
2003-05-06 00:31:55 -04:00
Theodore Ts'o d03550970c Add full Heimdall compatibility. 2003-05-05 23:07:32 -04:00
Theodore Ts'o b16fb628bf Update Debian changelog.
Add support for OV-style continuation (closes Debian bug #191900).

Move /usr/include/com_err.h from the e2fslibs-dev package to the 
comerr-dev package.  (closes Debian bug #191899)
2003-05-05 20:02:39 -04:00
Theodore Ts'o c62dbdb9ec Stupid think-o bugfix in test_io.c: Don't close data->outfile
if it is stderr.
2003-05-05 19:50:49 -04:00
Theodore Ts'o 2a29f1354f Add --enable-test-io-debug configure option which causes e2fsck and
tune2fs to use the test I/O manager.

The test I/O manager has been changed to not do anything extra by 
default, unless the TEST_IO_FLAGS and/or TEST_IO_BLOCK environment
variables are set, which controls what I/O operations are logged and
a block number to watch, respectively.  The log messages are sent to
stderr by default, unless a filename is specified via the 
TEST_IO_LOGFILE environment variable.
2003-05-05 12:08:47 -04:00
Theodore Ts'o 68dbdc2f1d tst_badblocks.c (file_test): Use tmpfile() instead of mktemp(). 2003-05-03 16:39:50 -04:00
Theodore Ts'o 05a27b1d34 getsize.c (ext2fs_get_device_size): Allow windows code to get
the resize for filesystems that are in regular files.
2003-04-29 21:10:15 -04:00
Theodore Ts'o 71df0dc393 Update for 1.33 release.
Fix typo's in README.subset

Change debian control file so it doesn't bomb out if the EVMS FSIM
is not there, since it is not built on the Hurd.  Resolves Debian
bug #189687.
2003-04-21 16:17:09 -04:00
Theodore Ts'o afb6d709ba Use DYLD_LIBRAY_PATH so that "make check" works on
Darwin systems when building with shared libraries.
2003-04-21 16:12:34 -04:00
Theodore Ts'o 520ead378e Fix gcc -Wall warnings. 2003-04-19 13:48:27 -04:00
Theodore Ts'o a85e81a2ff configure.in: Remove CYGWIN definition; we will use the
automatically defined __CYGWIN__ instead.
2003-04-18 07:22:01 -04:00
Theodore Ts'o c6928406b3 Add Cygwin/Windows version of ext2fs_get_device_size() 2003-04-17 22:06:46 -04:00
Theodore Ts'o fff45483ed Add portability enhancements for Cygwin32 environment. 2003-04-13 00:44:19 -04:00
Theodore Ts'o 2c93113e6a Remove EXT2_FEATURE_RO_COMPAT_BTREE_DIR mention of since it's not
actually used, and may confuse people who are looking for
EXT2_FEATURE_COMPAT_DIR_INDEX, which is in use.
2003-04-11 13:26:21 -04:00
Theodore Ts'o 9d51b6191b Use the SS_READLINE_PATH environment variable to control the search
for a suitable readine library.  As a default, try using libreadline,
libedit, and libeditline.
2003-04-11 12:56:27 -04:00
Theodore Ts'o 085c2af234 Import bug fixes from EVMS 2.0 tree.
Fixed possible hangs caused by bugs in calling waitpid, and not
setting the pipe to non-blocking mode.  Also fixed a file descriptor
leak.  Made sure all functions call log entry/exit functions.
2003-04-03 20:09:19 -05:00
Theodore Ts'o edab294f1c gen_uuid.c (get_random_bytes): Always xor in a stream of bytes
from the system PRNG (i.e., random/srandom, seeded from
	the time, pid, and uid) in case /dev/random isn't doing
	the right thing on a particular system.  It doesn't hurt,
	and it can help, in the case of a buggy /dev/random.
2003-04-03 08:25:15 -05:00
Theodore Ts'o 09a2ef8dda Fix XFS superblock definition. Add support to
extract UUID and labels for JFS and romfs.  (Thanks to
Janos Farkas <chexum@acomp.hu>.)
2003-04-03 00:04:28 -05:00
Theodore Ts'o 72d272a5d1 Update dependencies of ss/Makefile 2003-03-30 23:29:18 -05:00
Theodore Ts'o 0faabe5dea getsize.c: #include stat.h for the Apple Darwin port 2003-03-30 23:08:32 -05:00
Theodore Ts'o 91835c151f Change compile_et to generate header files that use <et/com_err.h>
instead of <com_err.h>, so the current version of the header file 
is used.

Add a --build-tree option to compile_et to make sure that it uses
the et_?.awk files from the build tree.

Remove legacy support for varargs.h, K&R C, and pre-POSIX signal 
support.  Also fixed gcc -Wall nits.
2003-03-30 22:26:13 -05:00
Theodore Ts'o 00aba96743 com_err.h, error_table.h: Move definition of the error_table
structure from the internal error_table.h to com_err.h,
	since it now needs to be public.

et_c.awk, et_h.awk: Import changes from krb5's et library so
	that the error_table structure is defined and available
	publically.

error_message.c: Import krb5 and heimdall com_err extensions to
	the et library.
2003-03-19 19:46:02 -05:00
Theodore Ts'o 88fe61c7c3 cache.c: Initialize blkid_debug_mask to zero since some
operating systems can't deal with variables in the common
	section in shared libraries.
2003-03-17 18:13:57 -05:00
Theodore Ts'o 9522e0aa04 ls.c (list_super2): Display the superblock fields even if the
journal or the dir index feature is not enabled.
2003-03-17 13:53:38 -05:00
Theodore Ts'o aa75ecccab Fix the Apple Darwin port. 2003-03-17 10:01:22 -05:00
Theodore Ts'o 6cca7ba96d Update dependency information in Makefiles 2003-03-16 20:21:16 -05:00
Theodore Ts'o 6fe7d1156a Update debian files to support the blkid library, and to fix a number
of Lintian warnings.

Added mk_cmds man page.
2003-03-16 19:58:25 -05:00
Theodore Ts'o 3ae497eab2 Add to the ss (subsystem) library the ability to dynamically link
to the readline library if it is present in the system.
2003-03-16 06:26:25 -05:00
Theodore Ts'o e71d87317a Add Apple/Darwin patches. 2003-03-14 02:13:48 -05:00
Theodore Ts'o 220c0040fb badblocks.c (ext2fs_u32_list_count), ext2fs.h: Add new function
which returns the number of entries in the list.
2003-03-14 00:59:42 -05:00
Theodore Ts'o 20754488a2 fileio.c (ext2fs_file_lseek): Fix bug added when adding 64-bit
support; avoid null dereference when ret_pos is NULL.
2003-03-10 14:32:09 -05:00
Theodore Ts'o cd0d521b82 Fix bug; if a partition has no known type, don't derference a null
pointer and crash.
2003-03-06 12:58:03 -05:00
Theodore Ts'o ed78c021c3 Fix up lots of portability problems that caused e2fsprogs not to build successfully
under Solaris.
2003-03-06 11:09:18 -05:00
Theodore Ts'o 94ba8c7506 Changes to create a subset distribution which consists only of the
et, ss, uuid, and blkid libraries.  The configure script and top-level 
makefile were changed to support working with a subset distribution.
2003-03-02 02:07:14 -05:00
Theodore Ts'o 7e89304878 tag.c (blkid_set_tag): Fix bug; don't return an error when
deleting a tag by setting the value to NULL.  This
	caused a failed device verification to loop forever in
	blkid_verify_devname().
2003-03-01 22:57:31 -05:00
Theodore Ts'o 2859522002 Update libblkid documentation.
Fix tst_resolve to use latest blkid API's.
2003-03-01 20:01:27 -05:00
Theodore Ts'o ed1b33e8fb Minor bug fixes in the blkid library.
Convert mke2fs, fsck, and tune2fs to use the blkid library.
2003-03-01 19:29:01 -05:00
Theodore Ts'o 1549a44762 resolve.c (blkid_get_tag_value): Rename function (used to be
blkid_get_tagname_devname)
2003-02-27 19:33:36 -05:00
Theodore Ts'o 79dd234a79 Internal changes to the blkid library:
1) Only one tag with a particular name can be attached to a device
at a time.  This significantly simplifies the library, and was needed
to allow the cache file to be re-read and changes integrated into the 
in-core version of the data structure in a simpler fashion than earlier
versions of the library. 

2)  To accomodate this, the ext2/ext3 filesystems are now always tagged
as "ext2" type filesystems.  Ext3 filesystems are tagged with a 
SEC_TYPE tag with the value ext3.

3)  The new blkid_read_cache() function checks the mod time of the
cache file, and if the file has been changed since the last time the
cache file was read into memory, it is re-read.  This function is now
called before probing all of the devices in the system or searching
all devices in the cache for a specific tag value.

4)  After probing all devices, blkid_flush_cache() is called to write
out the cache file.  This assures that all of the hard work involved
in doing a blkid_probe_all() is saved to disk.
2003-02-22 17:15:20 -05:00
Theodore Ts'o f0a22d0fd3 Add dynamic debugging capabilities to the blkid library,
controlled by the environment variable BLKID_DEBUG. The debugging
code is enabled by a new configuration option, --enable-blkid-debug.
2003-02-22 13:19:53 -05:00
Theodore Ts'o 98999c399d Rename blkid_get_devname() to blkid_get_dev(), and blkid_get_token()
to blkid_get_devname().
2003-02-16 00:47:07 -05:00
Theodore Ts'o bc40efd3d0 Remove bid_id from the blkid device structure, as it is not used
for anything.
2003-02-14 01:40:23 -05:00
Theodore Ts'o ce72b862c5 Add a priority label to the device structure, so we can give
preference to EVMS and LVM devices when searching for a device
matching a particular LABEL or UUID in the blkid library.
2003-02-14 01:31:45 -05:00
Theodore Ts'o 50b380b4d4 Wholesale changes to blkid library to simplify the implementation
and shrink its size.  Change library version to be 1.0.
2003-02-12 23:51:21 -05:00
Theodore Ts'o 76b07bb1bc Roto-till and clean up libblkid API.
read.c (parse_tag): Do not return that blkid_tag when parsing
	the blkid.tag file.

resolve.c (blkid_get_token, blkid_get_tagname_devname): Fold in
	code from removed functions

tag.c (blkid_create_tag): Don't return the newly tag strcture
	any more, as it's not needed.
	(blkid_find_tag_cache, blkid_get_tag_cache,
	 blkid_token_to_tag, blkid_find_tv_tags): Remove these 
	functions, as they are either only used once or have
	interfaces that should be deprecated.
	(blkid_find_tag_dev, blkid_find_head_cache): Replace use
	of blkid_tag with one or two const char * type/value
	arguments.
	(blkid_find_dev_with_tag): Fold in code from removed functions

probe.h, probe.c: Use a more sophisticated set of byte-swapping
	routines which are more compact and efficient.  Drop
	calculation of bid_free, since it's unnecessary.  Avoid 

save.c (blkid_save_cache): Set the permissions on the blkid
	cache file to 644.
2003-01-27 01:09:24 -05:00
Theodore Ts'o 7a603aa89f Separate public and private interfaces into separate header files.
Start separating internal implementation details from the
publically exported interface of the blkid library.
2003-01-26 01:54:39 -05:00
Theodore Ts'o 0f3ac480c7 devname.c: Add support for EVMS to the blkid library. 2003-01-25 18:44:33 -05:00
Theodore Ts'o d3f917989b Fix gcc -Wall nits. 2003-01-25 00:26:48 -05:00
Theodore Ts'o 3a1d6f3cc0 save.c (blkid_save_cache): Use mkstemp() instead mktemp(). 2003-01-24 23:11:29 -05:00
Theodore Ts'o e12f2ae74c Integrate new blkid library. 2003-01-23 16:45:16 -05:00
Theodore Ts'o 23b7c8b886 unix_io.c (unix_write_blk): Fix up GCC -Wall nits. 2003-01-22 18:30:01 -05:00
Theodore Ts'o 819157db79 Remove 32-bit limitations for debugfs's dump command and to the
ext2fs library's ext2fs_file_read.
2003-01-22 18:25:39 -05:00
Theodore Ts'o 4564c727e9 initialize.c (ext2fs_initialize): If the user specifies a really
large number of inodes, then reduce the number of blocks
	per group until we find a workable set of filesystem
	parameters.

ext2_err.et.in (EXT2_ET_TOO_MANY_INODES): Add new error code.
2003-01-19 21:01:22 -05:00
Theodore Ts'o 38513011b9 Update files for 1.32 release. 2002-11-09 15:00:56 -05:00
Theodore Ts'o 82c4660c75 unix_io.c (find_cached_block, reuse_cache, unix_read_blk,
unix_write_blk): Optimize routines so that we don't end up
	searching the cache twice when a block isn't in the
	cache.  If reads are larger than READ_DIRECT_SIZE, don't
	let them go through the cache.
2002-11-09 14:56:17 -05:00
Theodore Ts'o 1d47dfb91e unix_io.c (find_cached_block): Fixed bug which caused some clean
blocks to be erroneously marked as dirty, so they would
	get written back to the disk before they are evicted from
	the cache.  Harmless, but it slows down e2fsck
	significantly.
2002-11-09 10:33:49 -05:00
Theodore Ts'o ae65b29f11 Update files for 1.31 release. 2002-11-08 20:08:48 -05:00
Theodore Ts'o c4e5e36a40 pf.c: Print the indexed directory flag if present. Don't display
all of the compression flags unless compression support has
	been enabled.
2002-11-08 19:12:48 -05:00
Theodore Ts'o 3f9f271075 Missed a EVMS 1.2 ABI fixup. 2002-11-08 15:25:57 -05:00
Theodore Ts'o feb44c6955 Skip byteswap tests on --disable-swapfs
Disable certain tests that depend on the byteswapping functions
being present so that "make check" succeeds even if --disable-swapfs
is passed to the configure script.
2002-11-08 14:55:38 -05:00
Theodore Ts'o f606dd32ff Update "make depend". 2002-11-08 14:31:03 -05:00
Theodore Ts'o 3a68a67990 fs_ext2.c (fs_expand, fs_shrink),
fsimext2.c (fsim_mkfs, fsim_fsck): Inform the user if e2fsck, 
	mke2fs or resize2fs dies with a signal, or if the exit 
	with a non-zero exit status.
2002-11-08 14:10:15 -05:00
Theodore Ts'o 88888f159a fsimext2.c (set_mkfs_options): If the hard sector size is 1024,
don't force a blocksize of 1024; there's no need to do so.
2002-11-08 14:01:07 -05:00
Theodore Ts'o 420053aa65 Default the EVMS_ABI_CODE if it is not defined to 1.2.0. 2002-11-08 13:59:11 -05:00
Theodore Ts'o a9d799a01d Update EVMS plugin to support EVMS ABI 1.2 2002-11-08 13:50:51 -05:00
Theodore Ts'o 1f6169c31b fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev
1.7 (2002/09/11): Add a hack to force mkfs won't a 
	blocksize equal to the hardsector size if it is larger
	than 512 bytes.
2002-11-08 12:26:37 -05:00
Theodore Ts'o d5f445c603 Synchronize with EVMS CVS. Add better error handling
for child processes that die unexpectedly.
2002-11-08 12:07:21 -05:00
Theodore Ts'o d894e8b858 fs_ext2.c (fs_expand): Synchronize with EVMS CVS rev 1.12
(2002/08/28): Use the EVMS_IS_MOUNTED macro.
2002-11-08 11:57:14 -05:00
Theodore Ts'o 2993bf7d3c fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev
1.11 (2002/8/27).  Read from the resize2fs output in 
	non-blocking mode, so the GUI continues to updates the window.
2002-11-08 11:54:29 -05:00
Theodore Ts'o 758ab678d8 fsimext2.h: Synchronize with EVMS CVS rev 1.8 (2002/8/29).
Change all __uXX's to u_intXX_t's.
2002-11-08 11:46:22 -05:00
Theodore Ts'o bfd418832d closefs.c (write_bgdesc, ext2fs_flush): Fix bug in meta_bg
support when the MASTER_SB_ONLY flag is set.  Some of
	the descriptor blocks that should have been written out
	were getting skipped.
2002-11-08 09:21:46 -05:00
Theodore Ts'o 5d823a478f Update files for 1.30 release. 2002-11-01 02:13:53 -05:00
Theodore Ts'o a2c8bf9483 ext2_fs.h: Add support for a new inode flag, which is to be used
for indicating the top of directory hierarchies for the
	Orlov block allocator.
2002-11-01 02:01:41 -05:00
Theodore Ts'o 15f9011add Add support for a new inode flag, which is to be used
for indicating the top of directory hierarchies for the
Orlov block allocator.
2002-11-01 01:53:52 -05:00
Theodore Ts'o 61bee88d45 gen_uuid.c (get_random_bytes): Don't spin forever if read()
returns EINTR or EAGAIN, so that when /dev/random is
	opened O_NONBLOCK, we don't end up spinning forever.
2002-10-31 15:17:16 -05:00
Theodore Ts'o 3a42fe220c ismounted.c (check_mntent, check_mntent_file): Add better
support for loopback-mounted filesystems.  Check /etc/mtab
	if /proc/mounts doesn't turn up any mount flags, since
	/etc/mtab has the loopback image filename, instead of
	/dev/loop0.  Also, check based on st_dev and st_ino, so
	that if a relative pathname or a pathnames using symbolic
	links are used, we can detect the the filesystem correctly
	in those cases.  (Addresses Sourceforge bug #619119)
2002-10-31 13:23:37 -05:00
Theodore Ts'o 55ca9ae5ec flushb.c (ext2fs_sync_device): If the BLKFLSBUF ioctl succeeds,
don't try the FDFLUSH ioctl that was required for floppies
	with older kernels.  This avoids needless whining from the
	MD device driver.  (Addresses Sourceforge bug #545832).
2002-10-31 12:21:05 -05:00
Theodore Ts'o 9ed06a1eb9 openfs.c (ext2fs_open): Fix bug which caused us to pass the
wrong group_block to ext2fs_descriptor_block_loc if we're
	using the backup superblock/block group descriptors.
	(ext2fs_descriptor_block_loc): If we're using the backup
	superblock descriptors, use the backup descriptor block in
	the next block group.
2002-10-31 11:45:06 -05:00
Theodore Ts'o 76dd5e5c28 Add support for the meta_bg feature flag to the resize2fs program.
Fix bug in meta_bg support in mke2fs, e2fsck, and dumpe2fs; we were 
incorrectly reserving the legacy block groups desriptor blocks.
2002-10-30 23:07:21 -05:00
Theodore Ts'o 9d2aefb3bc Add a new superblock field, s_mkfs_time, which indicates when
the filesystem was created.  It is set via mke2fs, and printed 
via list_super2() (which is called by dumpe2fs).  

Also, list_super2() will now print "n/a" if the last mount time
(s_mtime) is zero.
2002-10-25 17:29:55 -04:00
Theodore Ts'o 4a959fe6f1 Add support for new default mount options for the journal data mode. 2002-10-20 01:52:52 -04:00
Theodore Ts'o c046ac7f2e Add support for the meta_blockgroup filesystem format. 2002-10-20 00:38:57 -04:00
Theodore Ts'o a0c3fd5e4c Add support for new feature in ext2/3 filesystems; a default mount options field
in the superblock.  Added the tune2fs '-o' option to set this field.
2002-10-15 17:43:43 -04:00
Theodore Ts'o 3e69906495 Fix gcc -Wall nits.
Fix format bug if NLS is in use.

Add extra so that the info directory looks OK on OpenWall.
2002-10-13 23:56:28 -04:00
Theodore Ts'o 8132d840c8 Fix endian problems in the htree code for e2fsck and debugfs.
When byte-swapping a filesystem on a PPC architecture, byte-swap
the bitmaps since the historical big-endian ext2 variant had
byte-swapped bitmaps, and the ext2fs library assumes this.  Otherwise
the regression test suite will fail...
2002-10-02 22:07:17 -04:00
Theodore Ts'o c663305947 Update for 1.29 release. 2002-09-24 01:26:50 -04:00
Theodore Ts'o d25f8cf646 lib/et/internal.h: Remove declaration of perror. All modern systems
can be expected to define perror() these days.
2002-09-23 23:51:57 -04:00
Theodore Ts'o 87ee8dcad3 Update changelogs for 1.28 release 2002-08-31 03:02:57 -04:00
Theodore Ts'o ea1959f015 Fix a bug which caused e2fsck to fail to correctly check filesystems
using a non-zero hash version (i.e., half MD4 or TEA hash).

The hash version wasn't getting copied into dx_dir->hashversion and
this caused the kernel to treat all directories if they were using the 
legacy hash, which was Bad.
2002-08-31 02:32:41 -04:00
Theodore Ts'o f61fc0b5d9 Add support for the hash_seed and s_def_hash_ver fields in the
superblock.  Dumpe2fs can now print out these fields, and they 
can be modified using debugfs's set_super_value command.  Also added
to debugfs was the ability to set s_uuid and s_journal_uuid features
as well.
2002-08-24 00:04:03 -04:00
Theodore Ts'o ee504128d3 valid_blk.c (ext2fs_inode_has_valid_blocks): Fix bug which
failed to accurately characterize non-standard slow
	symlinks.  (Which don't appear in practice on real-life
	systems, fortunately.)
2002-08-20 01:14:30 -04:00
Theodore Ts'o e6f2bda381 Makefile.in: Revamp makefile so that it doesn't depend
--enable-elf-shlibs.  We always build the shared library,
	since it's meant to be used as a plugin library.
2002-08-18 03:37:10 -04:00
Theodore Ts'o 9a4311a666 Clean up fsck handling, and fix bug which caused fs_shrink and
fs_expand to abort if fsck fixed a problem and exited with a 
status code of 1.
2002-08-18 02:44:58 -04:00
Theodore Ts'o 21b3ba9c56 More EVMS 1.1 CVS synchronization.
Fix up logging macros to use __FUNCTION__ correctly.
2002-08-18 02:00:42 -04:00
Theodore Ts'o 8fd69563ce fs_ext2.c, fsimext2.c: Synchronize with EVMS CVS tree.
Fixed up confusion caused by bad parameter names for
	get_fs_limits().  Added missing conversion of
	volume->vol_size from sectors to bytes.  Fix up error 
	returns for unsupported tasks as EINVAL, not ENOSYS.
	Use logical names for the API version numbers, since 
	the ABI is much more dependent on the headers.  Add
	code to byte-swap the superblock if necessary.
2002-08-18 01:48:46 -04:00
Theodore Ts'o 2b399a21e4 common.h, dlist.h, enginestructs.h, options.h, plugfuncs.c,
fs_ext2.c: Synchronize with ABI of EVMS 1.1.
2002-08-18 01:11:12 -04:00
Theodore Ts'o e5b164373c Update to debian's 1.27+1.28-WIP-0626-1
Revert the shlibs hack.

Makefile.in: Remove inode_io.o from the standard object files 
	in libext2fs, and only build it if debugfs is enabled
	(it requires fileio.o, which is only built if 
	--disable-debugfs isn't specified to configure).
2002-08-17 21:11:29 -04:00
Theodore Ts'o 023d111e92 chattr.1.in: Document the compression attribute flags E, X, and
Z, and explain that chattr can't set or set these flags.
	(Addresses Debian Bug #151990)

fsetflags.c (fsetflags), fgetflags.c (fgetflags.c), setflags.c
	(setflags), getflags.c (getflags): Check to make sure the
	file is a regular file or a directory before attempting to
	use the ext2 ioctls.  Otherwise, return EOPNOTSUPP.
	(Addresses Debian Bug #152029).
2002-08-17 14:44:56 -04:00
Theodore Ts'o b33278c4d6 Modify the half MD4 hash so it is no longer endian dependent. This is
a backwards incompatible change, but this should be OK since the kernel
MD4 ext3 code was only in the CVS tree, and hasn't generally escaped.

Add support for the TEA hash.
2002-08-17 10:52:51 -04:00
Theodore Ts'o 0684a4f33b Overhaul extended attribute handling. Should now be correct with
respect to the latest V2 bestbits ACL code.
2002-08-17 10:19:44 -04:00
Theodore Ts'o 917e875098 Makefile.in: Move dupfs.o and test_io.o from the
needed-by-debugfs object list to the needed-by-resizer
	object list.  Fixes compile problem if the system is built
	with only --disable-debugfs.
2002-08-13 15:16:47 -04:00
Theodore Ts'o fe4dd429dc link.c (ext2fs_link): When adding a new link to a directory,
clear the HTREE bit.
2002-07-29 19:26:33 -04:00
Theodore Ts'o cc90bdfd08 dirhash.c (ext2fs_dirhash): Fix bug which caused MD4
calculations for names > 32 characters to be completely
	bogus.  Changed MD4 calculation to match what is currently
	being used in the CVS gkernel tree.
2002-07-23 13:11:53 -04:00
Theodore Ts'o b7a00563b2 Add support to e2fsck to reindex directories to use hash trees. 2002-07-20 00:28:07 -04:00
Theodore Ts'o 3ea1f0fb45 dirhash.c (halfMD4Transform): Shift the hash by one bit,
since that's required by the directory indexing code.
2002-07-19 22:30:37 -04:00
Theodore Ts'o 8d7f458743 parse.c (uuid_parse): Fix uuid parsing bug which didn't complain
for certain types of invalid input text.  (Addresses
	Debian bug #152891).

tst_uuid.c: Add test cases for invalid text strings passed to
	uuid_parse.
2002-07-15 23:49:57 -04:00
Theodore Ts'o a8a813ee33 fsetflags.c (fsetflags), fgetflags.c (fgetflags): Save
errno if the ioctl fails, and restore it just before we
	return.
2002-07-14 16:13:55 -04:00
Theodore Ts'o 50cd7e06e2 ext2fs.h, read_bb_file.c: Change private to priv_data, to avoid
using a C++ reserved word.
2002-07-14 16:00:50 -04:00
Theodore Ts'o 593c6ead7e Various portability fixes which should help out HURD.
The iterate_on_dir function in libe2p has been changed to be more
general, so it relies less on the layout of struct dirent.  We also
make sure the errno returned by the ioctl is returned by 
fgetversion() and fsetversion().
2002-07-14 15:58:38 -04:00
Theodore Ts'o f154d2f687 unix_io.c (unix_open): Only attempt the setrlimit workaround if
the kernel version is 2.4.10 -- 2.4.17, since otherwise an
	old version of glibc (built against 2.2 headers) will
	interact badly with the workaround to actually cause more
	problems.  I hate it when the glibc folks think they're
	being smarter than the kernel....
2002-07-14 08:33:32 -04:00
Theodore Ts'o 9e6c5dd73e ext2_fs.h: Add superblock field for reserved group descriptors. 2002-07-09 11:08:10 -04:00
Theodore Ts'o 4e9bf7fa01 Added amusing political correctness quote. 2002-07-07 16:32:46 -04:00
Theodore Ts'o 2cb403b255 bitops.h: Add #define's for ext2fs_{l,b}e{32,16}_to_cpu and
ext2fs_cpu_to_{l,b}e{32,16}
2002-06-28 08:10:29 -04:00
Theodore Ts'o 5818d6789a ismounted.c (check_mntent): In AIX 4.3, MOUNTED isn't defined.
Add appropriate fallbacks in this case.
2002-06-27 21:19:45 -04:00
Theodore Ts'o 503f9e7f6e Add support for the half-MD4 HTREE hash.
Add HTREE root node tests.
2002-06-26 16:52:10 -04:00
Theodore Ts'o 88372d5c4b Applied Andrew Morton's patch to support the dirsync option. 2002-06-15 18:58:39 -04:00
Andreas Dilger b21bf26778 Do sanity checking of the number of blocks and inodes in a group for
8192-byte and 16384-byte blocksize filesystems.

Change the default bytes-per-inode ratio of a new filesystem to be at most
one inode per block for large blocksizes.
2002-06-10 11:05:56 -06:00
Andreas Dilger 7da78ff17d ext2_fs.h: Further minor cleanups of the header. Consolidate
some checks for __KERNEL__ into one place.
2002-06-09 17:38:50 -06:00
Theodore Ts'o 26bfdca8f2 fs_ext2.c (fs_init_task): Fix minor bugs pointed out by Steve
Pratt.  Fixed a selection bug and added checks to make
	sure volumes are not mounted when creating the list of
	volumes which can be mkfs'ed by the ext2/3 plugin.
2002-06-01 21:48:24 -04:00