diff options
Diffstat (limited to 'lib/support')
-rw-r--r-- | lib/support/Android.bp | 1 | ||||
-rw-r--r-- | lib/support/Makefile.in | 9 | ||||
-rw-r--r-- | lib/support/mkquota.c | 2 | ||||
-rw-r--r-- | lib/support/plausible.c | 9 | ||||
-rw-r--r-- | lib/support/print_fs_flags.c | 1 | ||||
-rw-r--r-- | lib/support/quotaio.c | 9 | ||||
-rw-r--r-- | lib/support/quotaio.h | 13 | ||||
-rw-r--r-- | lib/support/sort_r.h | 2 |
8 files changed, 24 insertions, 22 deletions
diff --git a/lib/support/Android.bp b/lib/support/Android.bp index af9b28d..ded3d40 100644 --- a/lib/support/Android.bp +++ b/lib/support/Android.bp @@ -15,6 +15,7 @@ cc_library { host_supported: true, ramdisk_available: true, vendor_ramdisk_available: true, + vendor_available: true, recovery_available: true, unique_host_soname: true, defaults: ["e2fsprogs-defaults"], diff --git a/lib/support/Makefile.in b/lib/support/Makefile.in index b622909..3f26cd3 100644 --- a/lib/support/Makefile.in +++ b/lib/support/Makefile.in @@ -137,10 +137,11 @@ plausible.o: $(srcdir)/plausible.c $(top_builddir)/lib/config.h \ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ $(top_srcdir)/lib/ext2fs/bitops.h $(srcdir)/nls-enable.h print_fs_flags.o: $(srcdir)/print_fs_flags.c $(top_builddir)/lib/config.h \ - $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2fs.h \ - $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \ - $(top_srcdir)/lib/ext2fs/ext3_extents.h $(top_srcdir)/lib/et/com_err.h \ - $(top_srcdir)/lib/ext2fs/ext2_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(top_builddir)/lib/dirpaths.h $(srcdir)/print_fs_flags.h \ + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \ + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \ + $(top_srcdir)/lib/et/com_err.h $(top_srcdir)/lib/ext2fs/ext2_io.h \ + $(top_builddir)/lib/ext2fs/ext2_err.h \ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/hashmap.h \ $(top_srcdir)/lib/ext2fs/bitops.h profile.o: $(srcdir)/profile.c $(top_builddir)/lib/config.h \ diff --git a/lib/support/mkquota.c b/lib/support/mkquota.c index 9339c99..81cfbf1 100644 --- a/lib/support/mkquota.c +++ b/lib/support/mkquota.c @@ -269,7 +269,7 @@ static inline qid_t get_qid(struct ext2_inode_large *inode, enum quota_type qtyp case PRJQUOTA: inode_size = EXT2_GOOD_OLD_INODE_SIZE + inode->i_extra_isize; - if (inode_includes(inode_size, i_projid)) + if (ext2fs_inode_includes(inode_size, i_projid)) return inode_projid(*inode); return 0; default: diff --git a/lib/support/plausible.c b/lib/support/plausible.c index 65a6b2e..eccba22 100644 --- a/lib/support/plausible.c +++ b/lib/support/plausible.c @@ -108,18 +108,15 @@ static void print_ext2_info(const char *device) return; sb = fs->super; - if (sb->s_mtime) { - tm = sb->s_mtime; + if ((tm = ext2fs_get_tstamp(sb, s_mtime))) { if (sb->s_last_mounted[0]) printf(_("\tlast mounted on %.*s on %s"), EXT2_LEN_STR(sb->s_last_mounted), ctime(&tm)); else printf(_("\tlast mounted on %s"), ctime(&tm)); - } else if (sb->s_mkfs_time) { - tm = sb->s_mkfs_time; + } else if ((tm = ext2fs_get_tstamp(sb, s_mkfs_time))) { printf(_("\tcreated on %s"), ctime(&tm)); - } else if (sb->s_wtime) { - tm = sb->s_wtime; + } else if ((tm = ext2fs_get_tstamp(sb, s_wtime))) { printf(_("\tlast modified on %s"), ctime(&tm)); } ext2fs_close_free(&fs); diff --git a/lib/support/print_fs_flags.c b/lib/support/print_fs_flags.c index f47cd66..093820f 100644 --- a/lib/support/print_fs_flags.c +++ b/lib/support/print_fs_flags.c @@ -14,6 +14,7 @@ #include "config.h" #include <stdio.h> +#include "print_fs_flags.h" #include "ext2fs/ext2fs.h" struct flags_name { diff --git a/lib/support/quotaio.c b/lib/support/quotaio.c index b41bb74..f5f2c7f 100644 --- a/lib/support/quotaio.c +++ b/lib/support/quotaio.c @@ -119,7 +119,7 @@ errcode_t quota_inode_truncate(ext2_filsys fs, ext2_ino_t ino) break; if (qtype != MAXQUOTAS) { - inode.i_dtime = fs->now ? fs->now : time(0); + ext2fs_set_dtime(fs, &inode); if (!ext2fs_inode_has_valid_blocks2(fs, &inode)) return 0; err = ext2fs_punch(fs, ino, &inode, NULL, 0, ~0ULL); @@ -272,6 +272,7 @@ static errcode_t quota_inode_init_new(ext2_filsys fs, ext2_ino_t ino) { struct ext2_inode inode; errcode_t err = 0; + time_t now; err = ext2fs_read_inode(fs, ino, &inode); if (err) { @@ -287,8 +288,10 @@ static errcode_t quota_inode_init_new(ext2_filsys fs, ext2_ino_t ino) memset(&inode, 0, sizeof(struct ext2_inode)); ext2fs_iblk_set(fs, &inode, 0); - inode.i_atime = inode.i_mtime = - inode.i_ctime = fs->now ? fs->now : time(0); + now = fs->now ? fs->now : time(0); + ext2fs_inode_xtime_set(&inode, i_atime, now); + ext2fs_inode_xtime_set(&inode, i_ctime, now); + ext2fs_inode_xtime_set(&inode, i_mtime, now); inode.i_links_count = 1; inode.i_mode = LINUX_S_IFREG | 0600; inode.i_flags |= EXT2_IMMUTABLE_FL; diff --git a/lib/support/quotaio.h b/lib/support/quotaio.h index 84fac35..6152416 100644 --- a/lib/support/quotaio.h +++ b/lib/support/quotaio.h @@ -16,8 +16,7 @@ * AND/OR * quota_data_add/quota_data_sub/quota_data_inodes(); * } - * quota_write_inode(qctx, USRQUOTA); - * quota_write_inode(qctx, GRPQUOTA); + * quota_write_inode(qctx, (1 << USRQUOTA) | (1 << GRPQUOTA)); * quota_release_context(&qctx); * } * @@ -102,8 +101,8 @@ struct quotafile_ops; /* Generic information about quotafile */ struct util_dqinfo { - time_t dqi_bgrace; /* Block grace time for given quotafile */ - time_t dqi_igrace; /* Inode grace time for given quotafile */ + __u32 dqi_bgrace; /* Block grace time for given quotafile */ + __u32 dqi_igrace; /* Inode grace time for given quotafile */ union { struct v2_mem_dqinfo v2_mdqi; } u; /* Format specific info about quotafile */ @@ -138,8 +137,8 @@ struct util_dqblk { qsize_t dqb_bhardlimit; qsize_t dqb_bsoftlimit; qsize_t dqb_curspace; - time_t dqb_btime; - time_t dqb_itime; + __u64 dqb_btime; + __u64 dqb_itime; union { struct v2_mem_dqblk v2_mdqb; } u; /* Format specific dquot information */ @@ -223,7 +222,7 @@ void quota_data_add(quota_ctx_t qctx, struct ext2_inode_large *inode, ext2_ino_t ino, qsize_t space); void quota_data_sub(quota_ctx_t qctx, struct ext2_inode_large *inode, ext2_ino_t ino, qsize_t space); -errcode_t quota_write_inode(quota_ctx_t qctx, enum quota_type qtype); +errcode_t quota_write_inode(quota_ctx_t qctx, unsigned int qtype_bits); /* Flags for quota_read_all_dquots() */ #define QREAD_USAGE 0x01 #define QREAD_LIMITS 0x02 diff --git a/lib/support/sort_r.h b/lib/support/sort_r.h index 8473ca8..660294e 100644 --- a/lib/support/sort_r.h +++ b/lib/support/sort_r.h @@ -267,7 +267,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, #if defined _SORT_R_GNU typedef int(* __compar_d_fn_t)(const void *, const void *, void *); - extern void qsort_r(void *base, size_t nel, size_t width, + extern void (qsort_r)(void *base, size_t nel, size_t width, __compar_d_fn_t __compar, void *arg) __attribute__((nonnull (1, 4))); |