Commit Graph

133 Commits (0edb4d8504afc08c48ce7f30b670a2a7e27db7bc)

Author SHA1 Message Date
Theodore Ts'o a78926effb Many files:
ext2fs.h (EXT2_FLAG_IMAGE_FILE): Add new flag, and add image_header
  	field in the ext2_filsys structure
  block.c (block_iterate_ind, block_iterate_dind, block_iterate_tind):
  inode.c (ext2fs_read_inode):
  rw_bitmaps.c (read_bitmaps):
  openfs.c (ext2fs_open): Add support for EXT2_FLAG_IMAGE_FILE
  imager.c (ext2fs_image_bitmap_read): Fix bug in imager to make sure
  	the full bitmap is saved.
2001-05-03 04:02:29 +00:00
Theodore Ts'o f955cc1425 ChangeLog, dir_iterate.c:
dir_iterate.c (ext2fs_process_dir_block): Add a double-check to make
  	sure the rec_len is a multiple of 4, to prevent bus-errors on
  	architectures which care about mis-aligned pointer references.
2001-05-01 19:04:28 +00:00
Theodore Ts'o 954a683dd0 ChangeLog, getsize.c:
getsize.c (ext2fs_get_device_size): Use an unsigned long to query the
  	device sizes using the BLKGETSIZE ioctl.
2001-04-26 01:42:37 +00:00
Theodore Ts'o 52db0b4178 ChangeLog, Makefile.in, ismounted.c:
ismounted.c (check_mntent): Check /proc/mounts on Linux systems before
  	checking /etc/mtab.  The EXT2_MF_READONLY flag is now set from the
  	/etc/mtab options field for all filesystems, not just the root
  	filesystem.  Add debugging code to make it easier to test
  	ext2fs_check_if_mounted().
2001-04-17 02:22:05 +00:00
Theodore Ts'o 036039460f ChangeLog, ext2_err.et.in, mkjournal.c:
mkjournal.c (ext2fs_create_journal_superblock): Add safety check;
  	return an error if there's an attempt to create a journal less than
  	1024 filesystem blocks.
  ext2_err.et.in, mkjournal.c: Change EXT2_JOURNAL_NOT_BLOCK and
  	EXT2_NO_JOURNAL_SB to be EXT2_ET_*.
2001-04-17 00:53:25 +00:00
Theodore Ts'o 9ec53cf4f3 ChangeLog, Makefile.in, bitops.h, tst_byteswap.c:
bitops.h (ext2fs_swab16, ext2fs_swab32): Add i386 assembly inline
  	functions.
  tst_byteswap.c: New function to test the byteswap functions.  Add to
  	regression test suite.
2001-02-20 16:28:40 +00:00
Theodore Ts'o c5423c5b3e ChangeLog, e2image.c:
e2image.c (main): Add code to write the e2image header.
ChangeLog, e2image.h:
  e2image.h (struct ext2_image_hdr): Fix type for fs_hostname
2001-02-08 05:45:17 +00:00
Theodore Ts'o d23042af75 ChangeLog, mkjournal.c:
mkjournal.c (ext2fs_create_journal_superblock): Fix the setting of
  	s_first for external devices to always be 1, since jsb->s_first is
  	always relative to the start of the journal superblock.  Use htonl(1)
  	when setting s_nr_users.
2001-02-08 03:37:16 +00:00
Theodore Ts'o 020888625f ChangeLog, mkjournal.c:
mkjournal.c (ext2fs_add_journal_device): Fix bug where the device
  	number of the filesystem (instead of the journal) was being dropped
  	into s_journal_dev.
ChangeLog, dumpe2fs.c:
  dumpe2fs.c (print_journal_information): Use s_first_data_block to find
  	the correct block to read the journal superblock.
2001-01-18 01:44:19 +00:00
Theodore Ts'o a112847b39 ChangeLog, ext2_err.et.in, ext2fs.h, initialize.c, mkjournal.c, openfs.c:
initialize.c (ext2fs_initialize): Add support for initializing the
  	ext2 superblock for external journal devices.  This basically means we
  	don't bother to allocate any block group descriptors.
  openfs.c (ext2fs_open): Only open external journal devices if the new
  	flag EXT2_FLAG_JOURNAL_DEV_OK is passed to ext2fs_open.  When opening
  	such devices, don't try to read the block group descriptors, since
  	they're not there.
  ext2_err.et.in (EXT2_NO_JOURNAL_SB): Add new error code
  mkjournal.c: Export a new function,
  	ext2fs_create_journal_superblock(), which allocates and returns a
  	buffer containing a journal superblock.  This is needed by mke2fs to
  	create an external journal.  Rewrote ext2fs_add_journal_device() so
  	that it no longer creates the external journal, but rather adds a
  	filesystem to an existing external journal.  It handles all of the
  	UUID manipulation.
  ext2fs.h: List the EXT3_FEATURE_JOURNAL_DEV as a flag supported by the
  	library.  Define the EXT2_FLAG_JOURNAL_DEV_OK.  Changed function
  	prototype for ext2fs_add_journal_device().
2001-01-16 06:56:14 +00:00
Theodore Ts'o 8077994116 ChangeLog, closefs.c:
closefs.c (ext2fs_flush): Don't write out anything beyond the primary
  	superblock if EXT2_INCOMPAT_JOURNAL_DEV is listed.
2001-01-14 18:03:43 +00:00
Theodore Ts'o b94bd81ae2 ChangeLog, imager.c:
imager.c: Fix gcc -Wall complaints and a series of bugs where retval
  	wasn't set correctly.  (Thanks to Andreas Dilger for pointing this
  	out.)
2001-01-12 17:26:05 +00:00
Theodore Ts'o 4d0f3e17a5 ChangeLog, MCONFIG.in, configure, configure.in:
MCONFIG.in: Change --enable-gcc-wall handling so that it's no longer a
  	configure option, but something which is done when the developer uses
  	the command "make gcc-wall".
  configure.in: Remove test for ino_t, since we don't use it any more
  	(we always use our own ext2_ino_t).  Remove --enable-gcc-wall support.
  	Add test for sys/ioctl.h
.del-types.h.in~ca55114a:
  Remove definition of ino_t
ChangeLog, Makefile.in, ext2fs.h, flushb.c, jump.funcs:
  flushb.c (ext2fs_sync_device): New function which centralizes all of
  	the places which might try to use the BLKFLSBUF or FDFLUSH ioctls (and
  	usually failing to define them since the system header files don't
  	usually do this for us, and we're trying to avoid usage of kernel
  	include files now.)
2001-01-11 15:48:50 +00:00
Theodore Ts'o 31dbecd482 Many files:
alloc.c, bb_inode.c, bitmaps.c, bitops.h, block.c, bmap.c, bmove.c,
  	brel.h, cmp_bitmaps.c, dblist.c, dblist_dir.c, dir_iterate.c,
  	expanddir.c, ext2fs.h, ext2fsP.h, fileio.c, finddev.c, get_pathname.c,
  	icount.c, inode.c, irel.h, irel_ma.c, ismounted.c, link.c, lookup.c,
  	mkdir.c, mkjournal.c, namei.c, newdir.c, read_bb_file.c, test_io.c,
  	tst_iscan.c, unix_io.c, unlink.c: Change use of ino_t to ext2_ino_t,
  	to protect applications that attempt to compile
  	-D_FILE_OFFSET_BITS=64, since this inexplicably changes ino_t(!?).  So
  	we use ext2_ino_t to avoid an unexpected ABI change.
2001-01-11 04:54:39 +00:00
Theodore Ts'o e446d71838 ChangeLog, dirblock.c:
dirblock.c (ext2fs_read_dir_block): Fix a potential case where we may
  	overrun allocated memory in case of a corrupted filesystem (or an
  	e2fsck test case :-) when byte-swapping the directory block.
2001-01-05 22:27:06 +00:00
Theodore Ts'o cdaf1fa78f ChangeLog, mkjournal.c:
mkjournal.c (ext2fs_add_journal_device): Fix various gcc -Wall
  	complaints including a missing return 0 at the end of
  	ext2fs_add_journal_device.
ChangeLog, ext2fs.h:
  ext2fs.h: Indent the #warning to fix gcc -Wall complaint.
2001-01-05 22:23:22 +00:00
Theodore Ts'o 4becab6824 ChangeLog, Makefile.in, mkjournal.c:
Makefile.in: Link in libe2p when creating libext2fs as a shared
  	library, since mkjournal.c now references fsetflags().
  mkjournal.c (ext2fs_add_journal_inode): Folded in Andreas Dilger's
  	changes (with fixups) to allow on-line creation of a journal file.
.del-types.h.in~ca55114a:
  Change what we use to protect the header file to be _ASM_TYPES_H
  instead of _LINUX_TYPES_H.  (Needed to make libc5 builds happy).
version.h:
  Update for WIP release.
2001-01-03 19:22:42 +00:00
Theodore Ts'o 43ec8734f2 ChangeLog, ext2fs.h, ismounted.c:
ismounted.c: add ext2fs_check_mount_point() function, which will
  	optionally return the mount point of a device if mounted
ChangeLog, closefs.c, ext2fs.h:
  ext2fs.h, closefs.c (ext2fs_flush): Add new flag,
  	EXT2_FLAG_SUPER_ONLY, which the close routines to only update the
  	superblock, and not the group descriptors.
2001-01-03 14:56:46 +00:00
Theodore Ts'o 31a17b36d5 ChangeLog, ext2fs.h, mkjournal.c:
mkjournal.c: rename ext2fs_add_journal_fs() to the more descriptive
  	ext2fs_add_journal_inode()
2001-01-03 13:04:12 +00:00
Theodore Ts'o e5b38a5faf Many files:
ext2fs.h: Remove definition of ext2fs_sb.  Note: this may break source
  	(but not binary) compatibility of some users of the ext2 library.
  	They should just simply do a global search and replace of struct
  	ext2fs_sb with struct ext2_super_block, and use their own private copy
  	of ext2_fs.h if they aren't already.
  closefs.c, initialize.c, link.c, newdir.c, openfs.c, swapfs.c: Replace
  	use of ext2fs_sb with ext2_super_block.
ChangeLog, main.c:
  main.c (main): Replace use of struct ext2fs_sb with struct ext2_super_block.
2001-01-01 16:17:12 +00:00
Theodore Ts'o 2fe1efe2e5 ChangeLog, ext2fs.h:
ext2fs.h: Cleaned up header file by removing definitions of feature
  	flags that might not have been defined in older ext2 header files.
  	Now that we're using our own include/linux/ext2fs.h header file, this
  	can never happen.
  jfs_dat.h: Removed old header file which is no longer needed.
ChangeLog:
  jfs_compat.h: Remove uneeded header file.
2000-12-31 13:39:17 +00:00
Theodore Ts'o a917d1ccf4 ChangeLog, closefs.c, ext2fs.h, jump.funcs, super.c:
Rename _ext2fs_update_fs_dynamic_rev to _ext2fs_update_dynamic_rev
2000-12-13 18:36:23 +00:00
Theodore Ts'o 3fe973b306 ChangeLog, closefs.c, ext2fs.h, jump.funcs:
closefs.c (ext2fs_update_fs_dynamic_rev): New function suggested by
  	Andreas Dilger to update the filesystem revision to EXT2_DYNAMIC_REV.
2000-12-13 17:55:49 +00:00
Theodore Ts'o 7dcfa6e217 ChangeLog, swapfs.c:
swapfs.c (ext2fs_swap_super): Add byte swapping for the journal fields.
2000-12-13 17:50:14 +00:00
Theodore Ts'o 4e246704ea ChangeLog, ext2fs.h, mkjournal.c:
ext2fs.h, mkjournal.c (ext2fs_add_journal_fs,
  	ext2fs_add_journal_device): Add a new argument to the APIs of these
  	function, which is a flags word.  This is used to allow the creation
  	of a V1 superblock for those folks who are using ext3 0.3b in
  	production.  Note, the user-land interface for getting at this flag
  	won't be documented, as the V1 superblock is deprecated.
2000-12-09 14:39:16 +00:00
Theodore Ts'o 586187372a ChangeLog, jfs_user.h, mkjournal.c:
mkjournal.c (init_journal_superblock): Sync Stephen's changes which
  	creates a V2 superblock instead of a V1 superblock.
ChangeLog, jfs.h, jfs_compat.h, list.h:
  jfs.h, jfs_compat.h, list.h: New files added to support ext3.
2000-12-09 05:47:45 +00:00
Theodore Ts'o f20d0d57f7 ChangeLog, test_io.c:
test_io.c (test_write_blk, test_write_byte): Fix typos pointed out by
  	Andreas Dilger.
2000-12-05 03:53:41 +00:00
Theodore Ts'o 72ed126483 ChangeLog, Makefile.in, e2image.h, ext2_err.et.in, ext2fs.h, imager.c:
imager.c (ext2fs_image_{inode,super,bitmap}_{read,write}, ext2_fs.h,
  	Makefile.in: New file that has routines that save ext2fs metadata to a
  	file.
  ext2_err.et.in (EXT2_ET_MAGIC_E2IMAGE): New error code assigned.
  e2image.h: New file which defines the file format for the ext2 image
  	file.  (Saved copy of ext2 metadata to a file as a saving throw
  	against worst-case damage.)
ChangeLog, Makefile.in, e2image.c:
  e2image.c, Makefile.in: New program which saves ext2 metadata to a
  	file for people who need a last-ditch saving throw.
2000-11-12 19:32:20 +00:00
Theodore Ts'o 6a7f455bb1 ChangeLog, inode.c:
inode.c (ext2fs_flush_icache): Add new function ext2fs_flush_icache()
  	which flushes the internal inode cache.  Applications which modify the
  	inode table blocks directly must call this function.
2000-11-12 19:07:06 +00:00
Theodore Ts'o 17ee8b17f9 ChangeLog, mkjournal.c:
mkjournal.c: Add #include of netinet/in.h, since Solaris requires it
  	for ntohl().
2000-10-26 20:45:58 +00:00
Theodore Ts'o c180ac8653 Many files:
ext2_io.h (io_channel_write_byte): Add new interface to allow callers
  	to write specific byte ranges.  This is an optional interface, which
  	not all IO channels may implement.
  unix_io.c (unix_write_byte): test_io.c (test_write_byte): Add
  	implementation of the write_byte function.
  closefs.c (write_primary_superblock, ext2fs_flush): Add a new function
  	which writes the primary superblock.  If the IO channel supports
  	writing raw bytes directly, only fields which were modified are
  	written to the disk.  This makes it safe(r) to use utilities like
  	tune2fs on a mounted filesystem.
  freefs.c (ext2fs_free): Free the original superblock if it is available.
  openfs.c (ext2fs_open): Store a copy of the original superblock when
  	opening it.
  ext2fs.h: Add a field to store the original superblock in the ext2
  	context structure.
2000-10-26 20:24:43 +00:00
Theodore Ts'o 4381966695 ChangeLog, llseek.c:
llseek.c: Add #ifdef's for IA64 (it's a 64-bit platform, so we don't
  	need to use llseek).
ChangeLog, fsck.c:
  fsck.c (device_already_active): Add a special case check for MD
  	devices, so we don't try to check them in parallel with other devices.
2000-10-25 02:06:09 +00:00
Theodore Ts'o d3cd93cabe ChangeLog, Makefile.in, ext2_err.et.in, ext2fs.h, jfs_dat.h, mkjournal.c:
Makefile.in, ext2fs.h, jfs_dat.h, mkjournal.c: Add functions for
  	creating an ext3 journal on a filesystem.
  ext2_err.et.in (EXT2_JOURNAL_NOT_BLOCK): Add new error code.
.del-ext2_fs.h~7a460879, ChangeLog:
  ext2_fs.h (EXT2_JOURNAL_INO): Add definition for EXT2_JOURNAL_INO;
  	reserve inode #7 for EXT2_RESIZE_INO.
TODO:
  Commit TOOD suggestion.
2000-10-24 18:33:16 +00:00
Theodore Ts'o adfc8c6c99 ChangeLog, ext2_io.h, unix_io.c:
unix_io.c: Make massive changes to support a multiple block
  	writethrough cacheing.
  ext2_io.h: Added flags field to the io_channel structure.
2000-10-18 19:22:24 +00:00
Theodore Ts'o de23aa1d17 ChangeLog, Makefile.in, ext2fs.h, finddev.c:
finddev.c, ext2fs.h, Makefile.in: Add new file, finddev.c, which
  	provides the function ext2fs_find_block_device().  This function
  	returns the pathname to a block device, given its device number.
2000-08-19 17:00:47 +00:00
Theodore Ts'o f9e67064ce configure.in:
Commit this file for future use; contains a configure.in script for when
  libuuid gets separtead out into its own package.
libext2fs.texinfo:
  Update version numbers for 1.19 release.
TODO:
  Commit TODO list for 1.19 release.
README:
  Update file for 1.19 release.
ChangeLog, e2fsprogs.spec:
  e2fsprogs.spec: Merge in a few changes from the Red Hat 6.2 spec file,
  	now that we're using a modern rpm to build e2fsprogs.  Also updated
  	version number to 1.19.
version.h:
  Update version number for 1.19 release.
ChangeLog:
  Check in changes for 1.19 release.
2000-07-13 23:25:54 +00:00
Theodore Ts'o ab146766e3 ChangeLog, ext2fs.h:
ext2fs.h (EXT2_LIB_FEATURE_INCOMPAT_SUPP): Add
  	EXT3_FEATURE_INCOMPAT_RECOVER (aka needs_recovery) to the list of
  	filesystem flags supported by the library.
ChangeLog, e2fsprogs.spec:
  e2fsprogs.spec (%post): Remove resize2fs from its old location in
  	/usr/sbin in the postinstall script.
RELEASE-NOTES, version.h:
  Update for WIP release.
2000-07-07 04:37:35 +00:00
Theodore Ts'o 8f13d8cb5c ChangeLog, ext2fs.h:
ext2fs.h: Update to include latest journalling additions to the superblock.
.del-ext2_fs.h~7a460879, ChangeLog:
  ext2_fs.h: Update to include latest journalling additions to the
  superblock.
2000-07-04 19:41:29 +00:00
Theodore Ts'o 57dca85467 Many files:
tst_badblocks.c: Update test program to test ext2fs_read_bb_FILE2 and
  	ext2fs_write_FILE.
  write_bb_file.c (ext2fs_write_bb_FILE): New function which writes out
  	bad blocks list to a file.
  read_bb_file.c (ext2fs_read_bb_FILE2): Add new function which changes
  	the callback function to take two additional arguments; a private
  	blind pointer supplied by the caller, and pointer to a char *
  	containing a pointer to the invalid string.
  badblocks.c (ext2fs_badblocks_equal): Add new function which returns
  	true if two badblocks list are equal.
  Makefile.in: Remove explicit link of -lc in the shared library.  (It
  	shouldn't be necessary, and is harmful in some cases).
jump.funcs:
  dll/jump.funcs: Add new jumptable entries for ext2fs_write_bb_FILE,
  	ext2fs_read_bb_FILE2, and ext2fs_badblocks_equal.
2000-07-04 19:20:25 +00:00
Theodore Ts'o abf7d3880b ChangeLog, getsize.c:
getsize.c (main): Add debugging code under #ifdef DEBUG
2000-06-10 19:27:17 +00:00
Theodore Ts'o 2e8d40d562 ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
  ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
  	files.  Switched to 4-digit years.
  dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
  	which recursively dumps a directory and its contents.
  	(fix_perms): New function.  Break permission-fixing code out of
  	dump_file() so it can be called by rdump code as well.
  	(dump_file): Call fix_perms().
  debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
  	which changes the cwd on the native filesystem.
  debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
  	catastrophic mode.  Changed callers.
  	(do_open_filesys, main): Accept new -b, -s, -c options for
  	open_filesystem.
ChangeLog, mkdir.c:
  mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
  	that if there's an error reading it, we can more cleanly back out of
  	the operation.
version.h:
  Update version file for WIP release.
2000-05-27 15:15:40 +00:00
Theodore Ts'o 7fd86d3967 ChangeLog, getsize.c:
getsize.c: Under linux, manually define the ioctl for BLKGETSIZE if it
  	isn't already defined and it's safe to do so.
.cvsignore:
  Ignore build files when builddir==srcdir
2000-05-25 23:42:22 +00:00
Theodore Ts'o dc5f68cad3 ChangeLog, getsize.c, llseek.c, unix_io.c:
getsize.c (ext2fs_get_device_size): Use open64() instead of open() if
  it exists.
  unix_io.c (unix_open): Use open64() instead of open() if it exists.
  llseek.c: Simplify header includes of unistd.h.  If lseek64 is
  	available (and prototypes are defined) use it in preference to llseek.
2000-05-25 23:31:54 +00:00
Theodore Ts'o f0f4acbdd5 ChangeLog, Makefile.in:
Makefile.in: Add hack dependency rule so that parallel makes work
  	correctly.
2000-05-25 23:22:11 +00:00
Theodore Ts'o fa7ef7176e ChangeLog, ext2fs.h:
ext2fs.h: Add appropriate ifdef's to support C++ compilation.
2000-05-19 02:11:41 +00:00
Theodore Ts'o 06af47f0e8 ChangeLog, block.c:
block.c: Readibility tweak in conditionals involving ctx->fs->flags.
2000-04-03 13:51:00 +00:00
Theodore Ts'o e589f678e1 ChangeLog, gen_uuid.c:
gen_uuid.c (get_random_bytes): Make more paranoid about misbehaving
  	/dev/urandom.  If we get a return of zero without an error more than 8
  	times in a row, we break out and return an error.  Also, if
  	/dev/urandom doesn't exist, try /dev/random.
ChangeLog, ext2fs.h:
  ext2fs.h: Use AUTOCONF SIZEOF_* macros if available to determine how
  	to define __s64 and __u64.  Turn off "compression is experimental"
  	warning if the cpp macro I_KNOW_THAT_COMPRESSION_IS_EXPERIMENTAL is
  	defined.
2000-04-03 13:45:40 +00:00
Theodore Ts'o 5a63dd28f2 ChangeLog, ext2fs.h:
ext2fs.h: Define EXT2FS_COMPRESSED_BLKADDR and HOLE_BLKADDR.
  	Conditionally include Compression as a supported type if
  	ENABLE_COMPRESSION (via --enable-compression) is turned on.
2000-02-11 15:44:08 +00:00
Theodore Ts'o 2c1a0ce7c6 ChangeLog, swapfs.c:
swapfs.c (ext2fs_swap_super): Swap the compression usage bitmap.
2000-02-11 15:39:19 +00:00
Theodore Ts'o 28ffafb09c ChangeLog, bitops.h:
bitops.h (ext2fs_mark_generic_bitmap, ext2fs_unmark_generic_bitmap,
  	ext2fs_mark_block_bitmap, ext2fs_unmark_block_bitmap,
  	ext2fs_mark_inode_bitmap, ext2fs_unmark_inode_bitmap): Change to
  	return the previous state of the bit that is being marked or unmarked.
  	For speed optimization.
ChangeLog, pass3.c:
  pass3.c (check_directory): Only do the loop detection algorithm if
  	we've searched over 2048 parent directories and haven't found the end
  	yet.  This means that in the common case, we don't allocate or clear
  	the inode_loop_detection bitmap, which for large systems, merely
  	clearing the bitmap for each directory was turning out to be quite
  	expensive.  Thanks to Jani Jaakkola (jjaakkol@cs.helsinki.fi) for
  	identifying this problem.
ChangeLog, Makefile.in, e2fsck.h, unix.c:
  Makefile.in: Call sync after finishing building all in this directory.
  unix.c (PRS): sync the filesystem before trying to use BLKFLSBUF, to
  	minimize the chance of causing dirty blocks to get dropped.
  e2fsck.h: Manually define BLKFLSBUF if not defined, and we're on a
  	Linux/i386 system.
2000-02-08 19:14:02 +00:00