History log of /external/e2fsprogs/lib/ext2fs/punch.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e0ed7404719a9ddd2ba427a80db5365c8bad18c0 20-Mar-2014 JP Abgrall <jpa@google.com> Switch back to 1.42.9 now that there is a fix

Revert "Revert changes that moved from 1.41.14 to 1.42.9"

This reverts commit 65f0aab98b20b5994a726ab90d355248bcddfffd.
/external/e2fsprogs/lib/ext2fs/punch.c
65f0aab98b20b5994a726ab90d355248bcddfffd 06-Mar-2014 JP Abgrall <jpa@google.com> Revert changes that moved from 1.41.14 to 1.42.9

Revert "e2fsck: Don't use e2fsck_global_ctx unless HAVE_SIGNAL_H"
commit e80e74c41d85ff93f3d212ba6512340f48054a93.

Revert "Merge remote-tracking branch 'linaro/linaro-1.42.9' into aosp_master"
This reverts commit e97b2b6fc82f840e84dfc631b87f21be44ff2421, reversing
changes made to 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Revert "Prepare for upstream 1.42.9"
This reverts commit 7e2fb9d09c245eba70ee008b78007315e9c0f1df.

Bug: 13340735
Change-Id: If48b153a95ef5f69f7cdccb00e23524abff3c5a8
Signed-off-by: JP Abgrall <jpa@google.com>
/external/e2fsprogs/lib/ext2fs/punch.c
18a1444b4f1e6a0948fd38fa0de382d86cfe04de 31-Dec-2013 Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> Add files that would normally be generated by the e2fsprogs build system

Android doesn't run ./configure and friends, so it has to rely on
pre-populated versions of the autogenerated files.

This is somewhat bogus (e.g. hardcoded little-endian reference in
lib/ext2fs/ext2_types.h) and should at some point be fixed, but it's
what Android has always done, not a regression from the 1.41.14 branch.

Also, don't #include config.h which we don't generate (we pass what it
usually contains as -D parameters from Android.mk) anywhere.

Add a new Android.mk file for the quota library.

Change-Id: I162c6327fee5bd06261d9cdcc34bda10f04a6f21
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
/external/e2fsprogs/lib/ext2fs/punch.c
f404167dda29a59d2be2882328aeb074b9899669 17-Dec-2013 Theodore Ts'o <tytso@mit.edu> Clean up sparse warnings

Mostly by adding static and removing excess extern qualifiers. Also
convert a few remaining non-ANSI function declarations to ANSI.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
84397754250d13e8596dd68c157c4c9863800079 16-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: only punch complete clusters

When bigalloc is enabled, using ext2fs_block_alloc_stats2() to free
any block in a cluster has the effect of freeing the entire cluster.
This is problematic if a caller instructs us to punch, say, blocks
12-15 of a 16-block cluster, because blocks 0-11 now point to a "free"
cluster.

The naive way to solve this problem is to see if any of the other
blocks in this logical cluster map to a physical cluster. If so, then
we know that the cluster is still in use and it mustn't be freed.
Otherwise, we are punching the last mapped block in this cluster, so
we can free the cluster.

The implementation given only does the rigorous checks for the partial
clusters at the beginning and end of the punching range.

Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
4c6fd9c20a3473db3fe419d613244e26c4a92b7b 15-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: clamp block-map punch range end to 2^32 blocks

In the ^extent case, passing ~0ULL as the 'end' parameter to
ext2fs_punch() causes the (end - start + 1) calculation to overflow to
zero. Since the old-style mapped block files cannot have more than
2^32 blocks, just clamp it to ~0U.

This fixes a regression in t_quota_2off with the patch "libext2fs: use
ext2fs_punch() to truncate quota file" applied.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
042a0f52ec79e448fd798df7757c6addeb00aede 12-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: don't error out when punching a totally sparse file

If we're asked to punch a file with no data blocks mapped to it and a
non-zero length, we don't need to do any work in ext2fs_punch_extent()
and can return success. Unfortunately, the extent_get() function
returns "no current node" because it (correctly) failed to find any
extents, which is bubbled up to callers. Since no extents being found
is not an error in this corner case, fix up ext2fs_punch_extent() to
return 0 to callers.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
dc9673abcf8e00f2b2e6e346b6312ef3745ac543 12-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: fix punching extents when there are no left extents

When deleting an entire extent, we cannot always slip to the previous
leaf extent because there might not /be/ a previous extent.
Attempting to correct for that error by asking for the 'current' leaf
extent also doesn't work, because the failed attempt to change to the
previous extent leaves us with no current extent.

Fix this problem by recording the lblk of the next extent before
deleting the current extent and _goto()ing to the next extent after
the deletion.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
8d74ab767d0f97258fed40f2f2d862227545bcea 12-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: check return values

Fix up a few places where we ignore return values.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
341bc5e368f7a768482f041971fb3c4b156d6ed9 12-Dec-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: don't overflow when punching indirect blocks with large blocks

On a FS with a rather large blockize (> 4K), the old block map
structure can construct a fat enough "tree" (or whatever we call that
lopsided thing) that (at least in theory) one could create mappings
for logical blocks higher than 32 bits. In practice this doesn't
happen, but the 'max' and 'iter' variables that the punch helpers use
will overflow because the BLOCK_SIZE_BITS shifts are too large to fit
a 32-bit variable. The current variable declarations also cause punch
to fail on TIND-mapped blocks even if the file is < 16T. So enlarge
the fields to fit.

Yes, this is an obscure corner case, but it seems a little silly if we
can't punch a file's block 300,000,000 on a 64k-block filesystem.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
4dbfd79d1458ce1259b951377e341aeb6197f8c1 07-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> e2fsprogs: fix blk_t <- blk64_t assignment mismatches

Fix all the places where we should be using a blk64_t instead of a
blk_t. These fixes are more severe because 64bit values could be
truncated silently.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
581646b94f3b57a461105968b49105a1357216ea 07-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: ind_punch() must not stop examining blocks prematurely

When we're iterating the main loop in ind_punch(), "offset" tracks how
far we've progressed into the block map, "start" tells us where to
start punching, and "count" tells us how many blocks we are to punch
after "start". Therefore, we would like to break out of the loop once
the "offset" that we're looking at has progressed past the end of the
punch range. Unfortunately, if start !=0, the if-break clause in the
loop causes us to break out of the loop early.

Therefore, change the breakout test to terminate the loop at the
correct time.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
4ee4ad80dcceb42b1e5cfd2d4067a38b99b9fa95 07-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: allow callers to punch a single block

The range of blocks to punch is treated as an inclusive range on both
ends, i.e. if start=1 and end=2, both blocks 1 and 2 are punched out.
Thus, start == end means that the caller wishes to punch a single
block. Remove the check that prevents us from punching a single
block.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
5d494038eede1bb538441dedf4207529629154b3 07-Oct-2013 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: rewind extent pointer when totally deleting an extent

During a punch operation, if we decide to delete an extent out of the
extent tree, the subsequent extents are moved on top of the current
extent (that is to say, they're memmmove'd down one slot). Therefore
it is not correct to advance to the next leaf because that means we
miss half the extents in the range! Rereading the current pointer
should be fine.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
d1154eb460efe588eaed3d439c1caaca149fa362 18-Sep-2011 Theodore Ts'o <tytso@mit.edu> 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>
/external/e2fsprogs/lib/ext2fs/punch.c
d32c915abfb224f6f6659e9cada7e9f759b7e3d2 07-Jul-2011 Theodore Ts'o <tytso@mit.edu> libext2fs: Fix gcc -Wall warnings

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c
3adb9374fb92736e393ad64f751073b19927ec0e 22-Jul-2010 Theodore Ts'o <tytso@mit.edu> libext2fs: Add new function ext2fs_punch()

This function deallocates a range of blocks from a passed-in file.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/punch.c