Initialize the on-disk structure before we fill it in, to avoid the
following valgrind warning:
Conditional jump or move depends on uninitialised value(s)
at 0x4323A8: qtree_entry_unused (quotaio_tree.c:40)
by 0x431218: v2r1_mem2diskdqblk (quotaio_v2.c:85)
by 0x432409: qtree_write_dquot (quotaio_tree.c:336)
by 0x431136: v2_commit_dquot (quotaio_v2.c:264)
by 0x42FB63: quota_write_inode (mkquota.c:126)
by 0x408BE6: create_quota_inodes (mke2fs.c:2466)
by 0x409A2D: main (mke2fs.c:2850)
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Some different types such as u_int16_t and __uint32_t have snuck into
e2fsprogs. These types are not guaranteed by any standard, and they
are not provided by dietlibc. Convert them to __u16, __u32,
etc. since these are guaranteed to be provided by e2fsprogs' build.
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
The macro for log_err() was written so that it needed to always
have an argument, but GCC was unhappy to have an argument when
none was specified in the format string. Use the CPP "##" to
eat the preceeding comma if no argument is specified.
Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This patch cleans up the quota code as suggested in previous reviews. This
includes
* remove BUG_ON()s and 'exit()' calls from library code
* remove calls to malloc/free and instead use ext2fs_get/free_mem functions.
* lib/quota/common.c file in not needed anymore and is removed.
* rename exported functions to start with quota_
(ex: init_quota_context --> quota_init_context)
* better error handling in quota library
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
The type loff_t is not portable. Use ext2_loff_t which handles this
for us.
Cc: Aditya Kali <adityakali@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
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>
This patch adds the quota library (ported form Jan Kara's quota-tools) in
e2fsprogs in order to make quotas as a first class supported feature in Ext4.
This patch also provides interface in lib/quota/mkquota.h that will be used by
mke2fs, tune2fs, e2fsck, etc. to initialize and update quota files.
This first version of the quota library does not support reading existing quota
files. This support will be added in the near future.
Thanks to Jan Kara for his work on quota-tools. Most of the files in this patch
are taken as-is from quota tools and were simply modified to work with
libext2fs in e2fsprogs.
Signed-off-by: Aditya Kali <adityakali@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>