History log of /external/e2fsprogs/misc/create_inode.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
978002e04483ddab12187f2e08b28996657bc818 10-Aug-2017 Jin Qian <jinqian@google.com> misc: fix resource leak in populate_fs

Contributed-By: Ivan Maidanski <i.maidanski@samsung.com>
Change-Id: Ibffdeea347d993c97f86ff7bfc5e78024048afce
/external/e2fsprogs/misc/create_inode.c
83da0276c3ff0a1c33f9042798b319542e254060 13-Jul-2017 Jin Qian <jinqian@google.com> build mke2fs for windows using android mingw library

Bug: 23686092
Change-Id: I4c7b0c69e3e3c48321d3a0a964ad65c87fc32bbd
/external/e2fsprogs/misc/create_inode.c
95e97131a0e96ad2c30c67d1c167dc586619486b 19-May-2017 Mike Frysinger <vapier@gentoo.org> include sys/sysmacros.h as needed

The minor/major/makedev macros are not entirely standard. glibc has had
the definitions in sys/sysmacros.h since the start, and wants to move away
from always defining them implicitly via sys/types.h (as this pollutes the
namespace in violation of POSIX). Other C libraries have already dropped
them. Since the configure script already checks for this header, use that
to pull in the header in files that use these macros.

Change-Id: Ib7f441fe168c2ca72a274978fea422a0c3010e4f
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
6686ee96494413b48aa3dd70b5db533cbb7e4852 30-Nov-2016 Adrien Schildknecht <adriens@google.com> misc: add callbacks to populate_fs

This patch let the caller of populate_fs registers a set of callbacks that
will be called everytime an inode is created.

Test: mm

Change-Id: I28ae100c4cc81223192860c29366cbac3077fe21
/external/e2fsprogs/misc/create_inode.c
c2c5c58593f7e4944fcf57d07e66baaf6a82b11d 22-Jul-2016 Matthias Andree <matthias.andree@gmx.de> libext2fs: fix infinite loop if copying in an empty directory

In m_minrootdir, on FreeBSD 9.3, try_lseek_copy() fails on an empty file
because errcode is uninitialized and the while() loop never executes,
and the errcode garbage is returned.

Initialize errcode = 0 in try_lseek_copy() to avoid a "fail" result when
there was nothing to copy.

Signed-off-by: Matthias Andree <matthias.andree@gmx.de>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
478360f50b68356849813f97db46fd156da5248e 30-May-2016 Theodore Ts'o <tytso@mit.edu> Fix Android build warnings

Also fix some additional gcc -Wall build warnings in a traditional
Linux environment.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
051fd4e0288166c081511d5c2e0f9031415b1bea 17-May-2016 Theodore Ts'o <tytso@mit.edu> misc: fix various Coverity warnings

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
d0e855fa478a7bb522861d96bfc733df6456d536 11-May-2016 Theodore Ts'o <tytso@mit.edu> misc: avoid PATH_MAX dependency in create_inode.c

Addresses-Debian-Bug: #822576

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
7889640d6d0b3ec3ce0f557e563e84c7bbe3fc19 24-Oct-2015 Darrick J. Wong <darrick.wong@oracle.com> misc: 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/misc/create_inode.c
f7134a9ece545b26e9d1d2b7240427064d5344fe 13-Jul-2015 Theodore Ts'o <tytso@mit.edu> Remove dropped const warning and enable pread/pwrite for Android build

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
ec794020acd00cf62d215d216449abeefe8ca320 13-Jul-2015 Theodore Ts'o <tytso@mit.edu> create_inode: remove backup definition of __func__

We are using __func__ without any backup definition in the rest of
e2fsprogs, and this is causing warnings in the Android build, so just
remove it.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
25f291c9b32d8017e6969c72a75e37d354c0570b 13-Jul-2015 Theodore Ts'o <tytso@mit.edu> Eliminate unused parameter warnings from Android build

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
99ceb8ec1acd7f38da289966b9984b3ffa1914a9 13-Jul-2015 Theodore Ts'o <tytso@mit.edu> Move the check_plausibility() function from misc to lib/support

The check_plausibility() function is now used all over the place, so
we should move the plausible.c file to lib/support and remove the
special case handling for that file that had been in the build system.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
344c043b38689c5e394a8659b6ef63814eff7479 17-May-2015 Theodore Ts'o <tytso@mit.edu> create_inode: handle source symlinks with extended attributes

We need to use lgetxattr(2) instead of getxattr(2) or attempts to
create file systems with extended attributes will fail:

set_inode_xattr: No data available while reading attribute "trusted.link" of "link"
__populate_fs: No data available while setting xattrs for "link"
mke2fs: No data available while populating file system

Reported-by: Jack_Fewx@Dell.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
b04af4fe041fe11a2ded55406270717a7451e66d 05-May-2015 Darrick J. Wong <darrick.wong@oracle.com> copyin: fix error handling

Save errno (in retval) before doing anything else, because the
"anything else" (usually com_err()) can call library functions, which
will reset errno.

Fix the error messages to use the message catalog, and don't _ever_
print an error without providing context.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
76f132349182c5b59698e831223a7dbcb883ae3d 05-May-2015 Darrick J. Wong <darrick.wong@oracle.com> copy-in: for files, only iterate file blocks that are mapped

Rewrite the file copy-in algorithm to detect smaller holes in the
files we're copying in. Use SEEK_DATA/SEEK_HOLE/FIEMAP when available
to skip known empty parts. This fixes the particular bug where zeroed
blocks on a system with 64k pages are needlessly copied into a
4k-block filesystem. It also saves time by skipping parts we know to
be zeroed.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
a433db04d054a4c949c816b28cfa9952b35e0b0a 05-May-2015 Darrick J. Wong <darrick.wong@oracle.com> copy-in: create hardlinks with the correct directory filetype

When we're creating hard links via ext2fs_link, the (misnamed?) flags
argument specifies the filetype for the directory entry. This is
*derived* from i_mode, so provide a translator. Otherwise, fsck will
complain about unset file types.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.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/misc/create_inode.c
0c49965fb69e7a8fac7043bea186323aa1c2197a 19-Sep-2014 Theodore Ts'o <tytso@mit.edu> create_inode: don't indiscriminately #include "nls-enable.h"

The create_inode.h header file is pulled in by debugfs, which is not
internationalized. It had no business pulling in nls-enable.h; that
header file should only be used in specific .c files that support
internationalization.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
c4c9bc590c4a1f21ec3053aacc232430493f10b0 24-Aug-2014 Darrick J. Wong <darrick.wong@oracle.com> misc: fix gcc warnings

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
c84da2eed09acee1cc9d2912bed71e9bb5788c8e 10-Jul-2014 Ross Burton <ross.burton@intel.com> misc: copy extended attributes in populate_fs

When creating a file system using a source directory, also copy any extended
attributes that have been set.

[ Add configure tests for Linux-specific xattr syscalls and add fallback
when compiling on non-Linux systems. --tytso ]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
22302aa32060870767c271a6c8dd0219fffeae6b 26-Jul-2014 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
debugfs/debugfs.c
e2fsck/pass1.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/misc/create_inode.c
ec3a42b1927feceabeeea1b9ee72f350423707b0 27-May-2014 Darrick J. Wong <darrick.wong@oracle.com> Misc coverity fixes

Fix various small resource leaks and error code handling issues that
Coverity pointed out.

Fixes-Coverity-Bugs: 1215250, 1193379, 119194[2-4], 1049160
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
3cbb51f91d7c96774eb59fe9e0abd9864d0554f2 21-May-2014 Andreas Dilger <adilger@dilger.ca> misc: fix create_inode warnings with LLVM

Fix name clash in do_mknod_internal() due to local variables named
"major" and "minor" shadowing identical macro names.

Also, no need to set the major and minor device for a FIFO inode.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Lukas Czerner <lczerner@redhat.com>
/external/e2fsprogs/misc/create_inode.c
6bb8845953adc9087f1d1bf3bcb375dbc121254b 27-May-2014 Theodore Ts'o <tytso@mit.edu> Merge branch 'maint' into next

Conflicts:
debugfs/debugfs.c
c61e00680f71094955419a3a7af7776f6146c296 12-May-2014 Darrick J. Wong <darrick.wong@oracle.com> libext2fs: create sockets when populating filesystem

Since the code to copy-in a socket when creating a filesystem is
fairly simple, just do it here.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
1bad6f4624b360450b59ac72b62a11cbcead948b 12-May-2014 Darrick J. Wong <darrick.wong@oracle.com> misc: coverity fixes

Fix various small resource leaks and error code handling issues that
Coverity pointed out.

Fixes-Coverity-Bugs: 11919{39-45}, 1174118, 1049160, 1049144
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
3aec816ff62e49aa7d2ab67fa43fc837fc68d219 12-Mar-2014 Theodore Ts'o <tytso@mit.edu> create_inode: fix gcc -Wall complaints

We had several functions that were not returning zero on success. Fix
this.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
b99888a070656cb81994d2e1e08d946597b1fe43 12-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> create_inode: handle hard link inum mappings per populate_fs invocation

When calling populate_fs, the map for hardlink detection is not
cleaned up between populate_fs invocations, which could lead to
unexpected results if anyone calls populate_fs twice in the same
client program). This doesn't happen right now, but we might as well
clean it up.

The detctor fails if the external directory crosses mountpoints,
so fix that too.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
a3111e80b82d28e2ad5c8ad74bc4acecf559d1d4 11-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> create_inode: move debugfs internal state back to debugfs

Since create_inode.c is shared between debugfs and mke2fs, don't
spread debugfs internal state into mke2fs.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
9c891f7e6be4f0d2e67caeee12ecdbba72c3150a 12-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> create_inode: whitespace fixes

Fix a ton of whitespace issues.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
8f8d8a575be5ee7c01438c98ff001ce0bc054115 12-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> create_inode: minor cleanups

Fix a couple of small style issues in the create_inode files.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
117b54c35a4830d7bd6d193e8f42976704feb461 12-Mar-2014 Darrick J. Wong <darrick.wong@oracle.com> create_inode: clean up return mess in do_write_internal

do_write_internal returns errno when ext2 library calls fail; since
errno only reflects the outcome of the last C library call, this will
result in confused callers. Eliminate the naked return since
this results in an undefined return value.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
d23b1965f35a5ecf239b080f8de68e4bed66b0e4 06-Mar-2014 Theodore Ts'o <tytso@mit.edu> Merge branch 'ry/mke2fs-populate' into next

Conflicts:
debugfs/debugfs.c
f84894bc047898559f314531ed469c52d79ad7f2 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: handle hardlinks

Create the inode and save the native inode number when we meet the hard
link (st_nlink > 1) at the first time, use ext2fs_link() to link the
name to the target inode number when we meet the same native inode
number again.

This algorithm is referred this from the genext2fs.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
b696065425c238152da448e0e13f554d06e7def7 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: set owner/mode/time for the inode

Set the uid, gid, mode and time for inode.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
3068f03f1cc9854ae88ed889cc1594a6871a0213 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: create directory

The do_mkdir_internal() is used for making dir on the target fs, most of
the code are from debugfs/debugfs.c, the debugfs/debugfs.c will be
modified to use this function.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
ce600dc4aa4e5a111cac1ac70abaf34de45cc31c 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: copy regular file

The do_write_internal() is used for copying file from native fs to
target, most of the code are from debugfs/debugfs.c, the
debugfs/debugfs.c will be modified to use this function.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
b25ddc5ed5dab31c99781540c94de23158758fa4 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: create symlink

The do_symlink_internal() is used for creating symlinks, most of the
code are from debugfs/debugfs.c, the debugfs/debugfs.c will be modified
to use this function.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
b2346118971aef99f9701189d774ee5294b352da 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: create special file

The do_mknod_internal() is used for creating special file which is
block, character and fifo, most of the code are from debugfs/debugfs.c,
the debugfs/debugfs.c will be modified to use this function.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
052064b9195da7b6902409a455cdd22b6b2be3d7 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> misc/create_inode.c: copy files recursively

Use opendir() and readdir() to read the native directory, then use
lstat() to identify the file type and call the corresponding function to
add the file to the filesystem, call the populate_fs() recursively if it
is a directory.

NOTE: the libext2fs can't create the socket file.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c
0d4deba22e2aa95ad958b44972dc933fd0ebbc59 06-Mar-2014 Robert Yang <liezhi.yang@windriver.com> mke2fs: add the ability to copy files from a given directory

We will add a -d option which will be used for adding the files from a
given directory to the filesystem, it is similiar to genext2fs, but
genext2fs doesn't fully support ext4.

* We already have the basic operations in debugfs:
- Copy regular file
- Create directory
- Create symlink
- Create special file

We will move these operations into create_inode.h and create_inode.c,
then let both mke2fs and debugfs use them.

* What we need to do are:
- Copy the given directory recursively, this will be done by the
populate_fs()
- Set the owner, mode and other informations
- Handle the hard links

TODO:
- The libext2fs can't create the socket file (S_IFSOCK), do we have a
plan to support it ?

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
/external/e2fsprogs/misc/create_inode.c