Commit Graph

18 Commits (460c0af190ea11c903dd0e0730cfc7c3d279bcc8)

Author SHA1 Message Date
Adrien Schildknecht d4e5abfb1b libext2fs: replace 'unsigned long' by 'uintptr_t'
This is needed for win64:
    sizeof(unsigned long) != sizeof(void*)

Signed-off-by: Adrien Schildknecht <adriens@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-10 17:07:00 -04:00
Theodore Ts'o cf491d3a64 Eliminate unused variable and unused label warnings from Android build
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-07-13 10:47:16 -04:00
Andreas Dilger f797cf3e37 tests: don't consider "make check" a compiler error
In a number of places, the output format from "make check" is
incorrectly interpreted as compiler warning output (triggered by
the presence of colons and parenthesis in the output).  Convert
these lines to similar output that does not trigger false build
warnings.

In the case of the tst_uuid.c program, the "ctime()" output was
difficult to change, but in fact it is better to actually compare
the time-based UUID against wallclock time instead of just printing
the formatted time as a string, so this test is improved.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-12-29 17:13:24 -05:00
Andreas Dilger 182acd17be libext2fs: don't inline ext2fs_open_file() and ext2fs_stat()
The creation of inline wrappers ext2fs_open_file() and ext2fs_stat()
in commit c859cb1de0 in ext2fs.h caused
difficulties with the use of headers, since the headers for open64()
and stat64() may already be included (and skip the declaration of the
64-bit variants) before ext2fs.h is ever read.  There is no real way
to solve the missing prototypes and resulting compiler warnings inside
ext2fs.h.

Since ext2fs_open_file() and ext2fs_stat() are not performance
critical operations, they do not need to be inline functions at all,
and the needed function headers can be handled properly in one file.

Similarly, posix_memalloc() was having difficulties with headers, and
was being defined in ext2fs.h, but it is now only being used by a
single file, so move the required header there.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-05-28 10:54:12 -04:00
Theodore Ts'o d71520751e Support systems without posix_memalign() and memalign()
MacOS 10.5 doesn't have posix_memalign() nor memalign(), but it does
have valloc().  The Android SDK would like to be built on MacOS 10.5,
so I've added support for a good-enough emulation of memalign()'s
functionality using valloc(), with an explicit test to make sure
valloc() is returning a pointer which is sufficiently aligned given
the requested alignment.  This won't work if you try to operate on a
file system with a 16k blocksize using an e2fsprogs built on MacOS
10.5 system, but it is good enough for the common case of 4k
blocksize file systems, and we will let the memory allocation fail in
the alignment is not good enough.

I've also added a unit test for ext2fs_get_memalign() so we can be
sure it's working as expected.  I've tested the code paths with
HAVE_POSIX_MEMALIGN defined, HAVE_POSIX_MEMALIGN undefined, and
HAVE_POSIX_MEMALIGN and HAVE_MEMALIGN undefined on an x86 Linux
system, and so I know the valloc() code path works OK.  The simplistic
(and less safe) patch at:

https://trac.macports.org/attachment/ticket/33692/patch-lib-ext2fs-inline.c.diff

Shows that using valloc() apparently works OK for MacOS 10.5 (but if
it doesn't the unit test will catch a problem).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-05-11 18:21:08 -04:00
Theodore Ts'o 3a6db9bbc8 libext2fs: fix ext2fs_get_memalign when posix_memalign() doesn't exist
Reported by: Gianluigi Tiesi <sherpya@netfarm.it>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-03-26 15:37:28 -07:00
Theodore Ts'o 7f21666a3d libext2fs: allow ext2fs_get_memalign() to compile w/o posix_memalign()
Addresses-Sourceforge-Bug: #3219173

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-10-16 21:50:26 -04:00
Theodore Ts'o d1154eb460 Shorten compile commands run by the build system
The DEFS line in MCONFIG had gotten so long that it exceeded 4k, and
this was starting to cause some tools heartburn.  It also made "make
V=1" almost useless, since trying to following the individual commands
run by make was lost in the noise of all of the defines.

So fix this by putting the configure-generated defines in lib/config.h
and the directory pathnames to lib/dirpaths.h.

In addition, clean up some vestigal defines in configure.in and in the
Makefiles to further shorten the cc command lines.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-09-18 17:34:37 -04:00
Theodore Ts'o 543547a52a libe2p, libext2fs: Update file copyright permission states to match COPYING
The top-level COPYING file states that the e2p and ext2fs libraries
are available under the LGPLv2.  The files were incorrectly labelled.
Alex Thomas/Luster has been consulted wrt to the ext3_extents.h file;
the rest of the files were primarily authored by Theodore Ts'o.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-05-17 23:04:39 -04:00
Theodore Ts'o efc6f628e1 Remove trailing whitespace for the entire source tree
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2008-08-27 23:07:54 -04:00
Theodore Ts'o 9f8046fc6d Many files:
alloc.c, alloc_tables.c, badblocks.c, bb_compat.c, bb_inode.c,
  	bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c,
  	check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c, dblist_dir.c,
  	dir_iterate.c, dirblock.c, dupfs.c, expanddir.c, ext2_fs.h, fileio.c,
  	finddev.c, flushb.c, freefs.c, get_pathname.c, getsize.c, icount.c,
  	imager.c, initialize.c, inline.c, inode.c, irel_ma.c, ismounted.c,
  	link.c, lookup.c, mkdir.c, mkjournal.c, namei.c, native.c, newdir.c,
  	nt_io.c, openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c,
  	rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c, tst_byteswap.c,
  	tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, valid_blk.c,
  	version.c, write_bb_file.c, ext2_fs.h: Moved file from include/linux.
  	Adjust all files in this directroy to include this file.
2001-05-14 11:35:52 +00:00
Theodore Ts'o b5abe6fac9 Many files:
inode.c (ext2fs_open_inode_scan): Initialize the group variables
  	so that we don't need to call get_next_blockgroup() the first
  	time around.  Saves a bit of time, and prevents us from
  	needing to assign -1 to current_group (which is an unsigned
  	value).
  icount.c (insert_icount_el): Cast the estimated number of inodes
  	from a float to an ino_t.
  alloc.c, alloc_tables.c, badlbocks.c, bb_compat.c, bb_inode.c,
  	bitmaps.c, bitops.c, block.c, bmap.c, bmove.c, brel_ma.c,
  	check_desc.c, closefs.c, cmp_bitmaps.c, dblist.c,
  	dblist_dir.c, dir_iterate.c, dirblock.c, dupfs.c, expanddir.c,
  	ext2fs.h, fileio.c, freefs.c, get_pathname.c, getsize.c,
  	icount.c, initialize.c, inline.c, inode.c, irel_ma.c,
  	ismounted.c, link.c, lookup.c, mkdir.c, namei.c, native.c,
  	newdir.c, openfs.c, read_bb.c, read_bb_file.c, rs_bitmap.c,
  	rw_bitmaps.c, swapfs.c, test_io.c, tst_badblocks.c,
  	tst_getsize.c, tst_iscan.c, unix_io.c, unlink.c, valid_blk.c,
  	version.c: If EXT2_FLAT_INCLUDES is defined, then assume all
  	of the ext2-specific header files are in a flat directory.
  block.c, bmove.c, dirblock.c, fileio.c: Explicitly cast
  	all assignments from void * to be compatible with C++.
  closefs.c (ext2fs_flush): Add a call to io_channel_flush() to
  	make sure the contents of the disk are flushed to disk.
  dblist.c (ext2fs_add_dir_block): Change new to be new_entry to
  	avoid C++ namespace clash.
  bitmaps.c (ext2fs_copy_bitmap): Change new to be new_map to
  	avoid C++ namespace clash.
  ext2fs.h, bb_inode.c, block.c, bmove.c, brel.h, brel_ma.c,
  	irel.h, irel_ma.c, dblist.c, dblist_dir.c, dir_iterate.c,
  	ext2fsP.h, expanddir.c, get_pathname.c, inode.c, link.c,
  	unlink.c: Change private to be priv_data (to avoid C++
  	namespace clash)
1998-01-19 14:47:53 +00:00
Theodore Ts'o 5be8dc2143 Many files:
dblist.c (ext2fs_get_num_dirs): Make ext2fs_get_num_dirs more paranoid
  	about validating the directory counts from the block group
  	information.
  all files: Don't include stdlib.h anymore; include it in ext2_fs.h,
  	since that file requires stdlib.h
ChangeLog, Makefile.in, dirinfo.c:
  dirinfo.c (e2fsck_add_dir_info): Use ext2fs_get_num_dirs instead of
  	e2fsck_get_num_dirs, which has been removed.
  Makefile.in (PROGS): Remove @EXTRA_PROGS@, since we don't want to
  	compile and install flushb.
ChangeLog, configure.in:
  Remove @EXTRA_PROGS@, since we aren't using it in 2fsck/Makefile.in anymore
ChangeLog, Makefile.in:
  Install debugfs in /sbin, instead of /usr/sbin.
libext2fs.texinfo:
  Update version string to be 1.12
Makefile.in:
  Fix bug in find script which made the exclusion list, where a '-' was
  missing from an -name option.
1997-12-01 18:24:10 +00:00
Theodore Ts'o 1d2ff46ae7 Many files:
Add #ifdef's for HAVE_SYS_STAT_H and HAVE_SYS_TYPES_H
1997-10-19 23:00:21 +00:00
Theodore Ts'o 4cbe8af4b0 Many files:
block.c (ext2fs_block_iterate2): Use retval which is a errcode_t type.
  bitmaps.c (make_bitmap): Use size_t instead of int where appropriate.
  bb_inode.c (set_bad_block_proc): Add #pragma argsused for Turbo C.
  alloc.c (ext2fs_new_inode): Use ino_t instead of int for the group number.
  get_pathname.c: Use ino_t instead of int where appropriate.
  ext2fs.h: Make the magic structure element be errcode_t instead of int.
  alloc.c alloc_tables.c badblocks.c bb_compat.c bb_inode.c
  	bitmaps.c block.c bmove.c brel_ma.c check_desc.c closefs.c
  	cmp_bitmaps.c dblist.c dblist_dir.c dir_iterate.c dirblock.c
  	dupfs.c expanddir.c freefs.c get_pathname.c icount.c
  	initialize.c inline.c inode.c irel_ma.c link.c llseek.c
  	lookup.c mkdir.c namei.c newdir.c read_bb.c read_bb_file.c
  	rs_bitmap.c rw_bitmaps.c swapfs.c test_io.c tst_badblocks.c
  	tst_iscan.c unix_io.c unlink.c valid_blk.c version.c: Add an
  	#ifdef for HAVE_UNISTD_H
1997-08-10 23:07:40 +00:00
Theodore Ts'o 19c78dc07f Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:17:09 +00:00
Theodore Ts'o f3db3566b5 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:34:30 +00:00
Theodore Ts'o 3839e65723 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:21:57 +00:00