History log of /external/e2fsprogs/lib/ext2fs/inline_data.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
77b3e9871877fce9908b0696250787fd6ea61af9 24-Oct-2015 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: clean up feature test macros with predicate functions

Create separate predicate functions to test/set/clear feature flags,
thereby replacing the wordy old macros. Furthermore, clean out the
places where we open-coded feature tests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
8f8511aba07c47df779be94eeb5970f2b73000d8 22-Jun-2015 Theodore Ts'o <tytso@mit.edu> libext2fs: fix gcc -Wall nits

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
3548bb64b5690608720120b56beeafaecc68d68b 03-Dec-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: refactor extent head creation

Don't open-code the creation of the extent tree header, since
ext2fs_extent_open2() knows how to take care of this.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
180f376b04c6cca59e25817927efd8fa95493022 08-Nov-2014 Darrick J. Wong <darrick.wong@oracle.com> misc: fix compiler warnings and minor build errors

Fix some gcc-4.8 warnings and other problems that broke the build.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
387e03160c44db21f97fbb4b7c4af954e0cb8931 04-Nov-2014 Eric Sandeen <sandeen@redhat.com> libext2fs: fix endian handling of ext3_extent_header in inline_data

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
/external/e2fsprogs/lib/ext2fs/inline_data.c
657f508cbf4c2ff180ea086bd7041125ec4e5b61 11-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: fix memory leak when failing to iterate inline_data directory

The xattr_get method returns to us a pointer to a buffer containing
the EA value. If for some reason we decide to fail out of iterating
the EA part of an inline-data directory, we must free the buffer that
xattr_get passed to us (via inline_data_ea_get).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
996999a1a45e1d36ff0e24925ee02fca87ad8283 11-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: don't fail inline data operations if there's no EA

Fix up the rest of the inline data code not to complain if there's no
EA, since it's possible that there's no EA because we're in the
process of creating an inline data file. Also, don't return an error
code when removing a nonexistent EA, because there's no reason to.

Furthermore, if we write less than 60 bytes of inline data, remove the
EA to avoid wasting space.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
cffe0221eb53c2de739f483aeb368684206ad4a8 11-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: strict inline data overwrite should not return ENOSPC

If we're doing a strict overwrite (same data size) of data in an
inline data file, we should be able to skip the size check. If the
in-core EA representation is fine but the on-disk EA is slightly
corrupt (this happens when fixing minor errors in an inline dir), the
ext2fs_xattr_inode_max_size() call, which reads the disk EA, can lead
us to think that there's no space when in reality there is no issue
with doing a strict overwrite.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
cd971869d77a9899db326d2ed42e1ef2916ba29f 11-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> misc: fix various endianness problems with inline_data

The inline data code fails to perform endianness conversions correctly
or at all in a number of places, so fix this so that big-endian
machines function properly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
ab74c0907150029716ef0a36b2f472c1de833030 26-May-2014 Zheng Liu <wenqing.lz@taobao.com> debugfs: fix two warning messages when compiling with LLVM

This commit fixes two warning messages when compiling with LLVM.

Reported-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
/external/e2fsprogs/lib/ext2fs/inline_data.c
bbccc6f3c6a106721fb6f1ef4df6bc32c7986235 27-May-2014 Andreas Dilger <adilger@dilger.ca> misc: fix compile warnings on master branch

Fix compile warnings found on the master branch when using LLVM.

- Add missing format string when using the libintl _() macro
- include <limits.h> header to get PATH_MAX definition
- fix format vs. variable mismatches
- add header block for create_inode.c file
- remove use of bzero(), use ext2fs_get_memzero() instead

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
251edc3d3b6fd3b8c2d93dd247e21a03705e4a6b 27-Mar-2014 Eryu Guan <guaneryu@gmail.com> libext2fs: fix build errors on bigendian hosts

Fix the following build errors on bigendian hosts.

- ctx is a pointer, use '->' not '.'
- add missing argument to ext2fs_dirent_swab_in2

make[2]: Entering directory `/root/e2fsprogs/lib/ext2fs'
CC inline_data.c
inline_data.c: In function ‘ext2fs_inline_data_dir_iterate’:
inline_data.c:221:5: error: request for member ‘errcode’ in something not a structure or union
ctx.errcode = ext2fs_dirent_swab_in2(fs, ctx->buf, ctx->buflen, 0);
^
inline_data.c:222:9: error: request for member ‘errcode’ in something not a structure or union
if (ctx.errcode) {
^
inline_data.c: In function ‘ext2fs_inline_data_dir_expand’:
inline_data.c:364:2: error: too few arguments to function ‘ext2fs_dirent_swab_in2’
retval = ext2fs_dirent_swab_in2(fs, buf, size);
^
In file included from inline_data.c:19:0:
ext2fs.h:1569:18: note: declared here
extern errcode_t ext2fs_dirent_swab_in2(ext2_filsys fs, char *buf, size_t size,
^
make[2]: *** [inline_data.o] Error 1

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Zheng Liu <wenqing.lz@taobao.com>
/external/e2fsprogs/lib/ext2fs/inline_data.c
8f22fa055bdf9dbe0dc8a5de440ed57eb706e098 14-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: repair side effects when iterating dirents in inline dirs

In ext2fs_inline_data_dir_iterate(), we must be very careful to undo
any modifications we make to the dir_context pointer passed in by the
caller, because it's entirely possible that the caller will still want
to do something with the ctx or something inside.

Specifically, ext2fs_dblist_dir_iterate() wants to be able to free
ctx->buf, and it reuses the ctx for multiple dblist entries. That
means that assigning ctx->buf will cause weird crashes at the end of
dir_iterate().

Since we're being careful with ctx, we might as well handle adding the
INLINE_DATA flag to ctx->flags for ext2fs_process_dir_block, since the
dblist caller forgets to unset the flag before reusing the ctx.

This fixes some crashes and valgrind complaints in resize2fs, and is
necessary for the next patch, which fixes resize2fs not to corrupt
inline_data filesystems.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
179e3bd708251048980c845d0080de1ce79ef21a 14-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: during inlinedata expand, don't corrupt inode

When expanding an inline data inode, it's possible that the reduction
in the size of the EA structures causes the freeing of the EA block,
which changes the inode. If this happens, the local version of the
inode that ext2fs_inline_data_expand was modifying will be out of sync
with what's on the disk. This local copy gets written out to disk
after a block allocation, at which point it's possible that the inode
EA block and logical block zero point to the same physical block,
which is bad news.

Therefore, write the local copy to disk before removing the inline
data EA, and reread it afterwards.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
97bd89cd398108b05e33b676809b50348bf6abb2 14-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: fix iblocks correctly when expanding an inline_data file

i_blocks covers the number of blocks allocated to an inode for data,
extents, and ACL blocks. Since it's possible for a file to have a
separate ACL block and inline data, we must be careful when expanding
an inline data file to adjust, not set, the value of i_blocks.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
cb803fc2caa45fe40f326dcf51f525a56e8af01b 14-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: don't fail when doing a strict rewrite of inline data

ext2fs_inline_data_set() tries to ensure that there is sufficient free
space in the inode to store the inline data. Unfortunately, it gets
the check wrong -- ext2fs_xattr_inode_max_size() returns the amount of
unused bytes in the EA area, and _data_set() doesn't factor in the
size of the existing inline data. Therefore, a strict rewrite of an
N-byte inlinedata with another N-byte inlinedata fails.

Fix the code to do the size check correctly.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
31253488385a62e4db53cad04f55188a2861b4bb 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> libext2fs: add a unit test for inline data

In this unit test, we will test the interface of inline data and make
sure it is fine.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
54e880b870f7fe98a6ea23013c18e2a71e28c01c 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> libext2fs: handle inline data in read/write function

Currently ext2fs_file_read/write are used to copy data from/to a file.
But they manipulate data by blocksize. For supporting inline data, we
handle it in two new fucntions called ext2fs_file_read/write_inline_data.

In read path the implementation is straightforward. But in write path
things get more complicated because if the size of data is greater than
the maximum size of inline data we will expand this file. So now we
will check this in ext2fs_inline_data_set. If this inode doesn't have
enough space, it will return EXT2_ET_INLINE_DATA_NO_SPACE error. Then
the caller will check this error and tries to expand the file.

The following commands in debugfs can handle inline_data feature after
applying this patch:
- dump
- cat
- rdump
- write

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
97581d448127f95dcc968c0785f7ab3413bf0222 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> debugfs: handle inline data feature in punch command

Now punch command only can remove all inline data because now
punch command is based on block unit and the size of inline data is
never beyond a block size.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
82e77d07ee6c9e2414233d4428887a22bf755609 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> debugfs: make mkdir command support inline data

This commit tries to make mkdir command in debugfs support inline data.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
46bd6bdfc8c2e79336267f639b7963bea4487c42 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> debugfs: make expand command support inline data

This commit defines a ext2fs_inline_data_expand() to expand an inode with
inline data. In this commit this function only can expand a directory.
But later it will expand a file.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
133e94627b01823d2555450ddd1d95401ff2227a 03-Mar-2014 Zheng Liu <wenqing.lz@taobao.com> debugfs: make stat command support inline data

If there is an inode with inline data, we just print the size of inline
data in stat command.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c
416c1de94ddf7199aedaf7b039292a36b92699fb 06-Dec-2013 Zheng Liu <wenqing.lz@taobao.com> libext2fs: handle inline data in dir iterator function

Inline_data is handled in dir iterator because a lot of commands use
this function to traverse directory entries in debugfs. We need to
handle inline_data individually because inline_data is saved in two
places. One is in i_block, and another is in ibody extended attribute.

After applied this commit, the following commands in debugfs can
support the inline_data feature:
- cd
- chroot
- link*
- ls
- ncheck
- pwd
- unlink

* TODO: Inline_data doesn't expand to ibody extended attribute because
link command doesn't handle DIR_NO_SPACE error until now. But if we
have already expanded inline data to ibody ea area, link command can
occupy this space.

Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/lib/ext2fs/inline_data.c