I got tired of quota being broken, so this patch set fixes all of the
known problems with e2fsck fixing up corrupted quota records. The quota
library API is still not what I would call ideal, but cleanups can wait
for the 1.43 branch.
Theodore Ts'o (9):
quota: add debugging code to print the dquot structure
quota: fix e2fsck so we update the quota file correctly
quota: fix e2fsck to notice missing quota entries
quota: fix memory leak in quota_compare_and_update()
quota: integrate mkquota.h into quotaio.h
quota: support storing the quota file handles in the quota context
debugfs: add commands to query the quota information
tests: add basic e2fsck regression test for fixing the quota inode
quota: remove warning message that we have fixed the nasty quota bugs
debian/rules | 4 -
debugfs/Makefile.in | 177 ++++++++++++++++++++++++++++++------------
debugfs/debug_cmds.ct | 6 ++
debugfs/debugfs.c | 3 +
debugfs/debugfs.h | 6 ++
debugfs/quota.c | 170 +++++++++++++++++++++++++++++++++++++++++
debugfs/ro_debug_cmds.ct | 7 +-
e2fsck/Makefile.in | 186 +++++++++++++++++++--------------------------
e2fsck/e2fsck.h | 2 +-
e2fsck/quota.c | 1 -
lib/quota/Makefile.in | 59 ++++----------
lib/quota/common.h | 1 +
lib/quota/mkquota.c | 71 ++++++++++++++---
lib/quota/mkquota.h | 64 ----------------
lib/quota/quota.pc.in | 11 ---
lib/quota/quotaio.c | 64 +++++++++++++---
lib/quota/quotaio.h | 64 +++++++++++++++-
misc/Makefile.in | 14 ++--
misc/ext4.5.in | 7 --
misc/mke2fs.c | 9 +--
misc/tune2fs.c | 6 +-
tests/f_quota/debugfs-cmds | 7 ++
tests/f_quota/expect.0 | 21 +++++
tests/f_quota/expect.1 | 13 ++++
tests/f_quota/expect.2 | 7 ++
tests/f_quota/image.gz | Bin 0 -> 1046 bytes
tests/f_quota/name | 1 +
tests/f_quota/script | 4 +
tests/m_quota/expect.1 | 4 -
29 files changed, 650 insertions(+), 339 deletions(-)
create mode 100644 debugfs/quota.c
delete mode 100644 lib/quota/mkquota.h
delete mode 100644 lib/quota/quota.pc.in
create mode 100644 tests/f_quota/debugfs-cmds
create mode 100644 tests/f_quota/expect.0
create mode 100644 tests/f_quota/expect.1
create mode 100644 tests/f_quota/expect.2
create mode 100644 tests/f_quota/image.gz
create mode 100644 tests/f_quota/name
create mode 100644 tests/f_quota/script
--
1.9.0
Previously if there was a missing quota entry --- i.e., if there were
files owned by group "eng", but there was no quota record for group
"eng", e2fsck would not notice the missing entry. This means that the
usage informtion would not be properly repaired. This is unfortunate.
Fix this by marking each quota record in quota_dict that has a
corresponding record on disk, and then check to see if there are any
records in quota_dict that have not been marked as having been seen.
In that case, we know we need to update the relevant quota inode.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
lib/quota/mkquota.c | 17 ++++++++++++++++-
lib/quota/quotaio.h | 2 ++
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index f77e072..f5ae0e0 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -458,6 +458,7 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
dq = get_dq(quota_dict, dquot->dq_id);
dq->dq_id = dquot->dq_id;
+ dq->dq_flags |= DQF_SEEN;
print_dquot("mem", dq);
print_dquot("dsk", dquot);
@@ -572,10 +573,13 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
ext2_filsys fs = qctx->fs;
struct quota_handle qh;
struct scan_dquots_data scan_data;
+ struct dquot *dq;
+ dnode_t *n;
+ dict_t *dict = qctx->quota_dict[qtype];
ext2_ino_t qf_ino;
errcode_t err = 0;
- if (!qctx->quota_dict[qtype])
+ if (!dict)
goto out;
qf_ino = qtype == USRQUOTA ? fs->super->s_usr_quota_inum :
@@ -595,6 +599,17 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
log_err("Error scanning dquots");
goto out;
}
+
+ for (n = dict_first(dict); n; n = dict_next(dict, n)) {
+ dq = dnode_get(n);
+ if (!dq)
+ continue;
+ if ((dq->dq_flags & DQF_SEEN) == 0) {
+ fprintf(stderr, "[QUOTA WARNING] "
+ "Missing quota entry ID %d\n", dq->dq_id);
+ scan_data.usage_is_inconsistent = 1;
+ }
+ }
*usage_inconsistent = scan_data.usage_is_inconsistent;
out:
diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
index 1c062f1..55e6eb0 100644
--- a/lib/quota/quotaio.h
+++ b/lib/quota/quotaio.h
@@ -104,6 +104,8 @@ struct dquot {
struct util_dqblk dq_dqb; /* Parsed data of dquot */
};
+#define DQF_SEEN 0x0001
+
/* Structure of quotafile operations */
struct quotafile_ops {
/* Check whether quotafile is in our format */
--
1.9.0
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
tests/f_quota/debugfs-cmds | 7 +++++++
tests/f_quota/expect.0 | 21 +++++++++++++++++++++
tests/f_quota/expect.1 | 13 +++++++++++++
tests/f_quota/expect.2 | 7 +++++++
tests/f_quota/image.gz | Bin 0 -> 1046 bytes
tests/f_quota/name | 1 +
tests/f_quota/script | 4 ++++
7 files changed, 53 insertions(+)
create mode 100644 tests/f_quota/debugfs-cmds
create mode 100644 tests/f_quota/expect.0
create mode 100644 tests/f_quota/expect.1
create mode 100644 tests/f_quota/expect.2
create mode 100644 tests/f_quota/image.gz
create mode 100644 tests/f_quota/name
create mode 100644 tests/f_quota/script
diff --git a/tests/f_quota/debugfs-cmds b/tests/f_quota/debugfs-cmds
new file mode 100644
index 0000000..112a3ff
--- /dev/null
+++ b/tests/f_quota/debugfs-cmds
@@ -0,0 +1,7 @@
+list_quota user
+list_quota group
+get_quota user 0
+get_quota user 100
+get_quota user 34
+get_quota group 0
+
diff --git a/tests/f_quota/expect.0 b/tests/f_quota/expect.0
new file mode 100644
index 0000000..c0ad63d
--- /dev/null
+++ b/tests/f_quota/expect.0
@@ -0,0 +1,21 @@
+debugfs: list_quota user
+ user id blocks quota limit inodes quota limit
+ 0 13312 0 0 2 0 0
+ 34 1024 0 0 1 0 0
+ 100 2048 32 50 2 20 30
+debugfs: list_quota group
+group id blocks quota limit inodes quota limit
+ 0 16384 0 0 5 0 0
+debugfs: get_quota user 0
+ user id blocks quota limit inodes quota limit
+ 0 13312 0 0 2 0 0
+debugfs: get_quota user 100
+ user id blocks quota limit inodes quota limit
+ 100 2048 32 50 2 20 30
+debugfs: get_quota user 34
+ user id blocks quota limit inodes quota limit
+ 34 1024 0 0 1 0 0
+debugfs: get_quota group 0
+group id blocks quota limit inodes quota limit
+ 0 16384 0 0 5 0 0
+debugfs:
diff --git a/tests/f_quota/expect.1 b/tests/f_quota/expect.1
new file mode 100644
index 0000000..0b3b4cf
--- /dev/null
+++ b/tests/f_quota/expect.1
@@ -0,0 +1,13 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+[QUOTA WARNING] Usage inconsistent for ID 0:actual (13312, 2) != expected (14336, 3)
+[QUOTA WARNING] Usage inconsistent for ID 100:actual (2048, 2) != expected (1024, 1)
+Update quota info for quota type 0? yes
+
+
+test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
+test_filesys: 14/16 files (14.3% non-contiguous), 36/100 blocks
+Exit status is 1
diff --git a/tests/f_quota/expect.2 b/tests/f_quota/expect.2
new file mode 100644
index 0000000..bfc558d
--- /dev/null
+++ b/tests/f_quota/expect.2
@@ -0,0 +1,7 @@
+Pass 1: Checking inodes, blocks, and sizes
+Pass 2: Checking directory structure
+Pass 3: Checking directory connectivity
+Pass 4: Checking reference counts
+Pass 5: Checking group summary information
+test_filesys: 14/16 files (14.3% non-contiguous), 36/100 blocks
+Exit status is 0
diff --git a/tests/f_quota/image.gz b/tests/f_quota/image.gz
new file mode 100644
index 0000000000000000000000000000000000000000..9cea6556e941fb0e3fb2bf09a29895ca246cad50
GIT binary patch
literal 1046
zc-o!F{WF^f0KoBdZspF1-D*lrSk+5+=nz^>MD?0oJL0vO3C%`l6v@;wr3l-3tD%~?
zzGRWMMx?1^&PXhr%sb7Cmj-$B49Sp)h}T6l&vyG0_PzW3@`csfKw9?*32#~HRWX@3
zk}G7(Gj~kbmczDY#KKO6Eue#tb%hIIj*ow|o40q~c;Lm+%?A5U)Z)IZ(z}mu`9vY_
z%(UEzKYq`?uX<Tj`=`q8T`0!k(sBS<D~Bu2Qq!};>D&73?b1R3|1Veohm+-H_0EfE
zk4X=7q^nJ%ZDXq3U5n<c)?m_!hDdc_$DEod!|)5(SZ^n)e>mZCb-u@b<@u8#JO^xX
zaTWlG==RYiCMkYIf+uTgPMPB#vD(0c{1WpN)zA;BhBeR`nlTiAv!UC}@8l8=nskyC
z!sLE0k%#opz6m;OkuW#qJn_?NJ?&6Z!O?Lt{CAG#(Kd5zEUO#LF|49+0{010eR)@}
zaj_E|jq(o-Uqn{IMC$ye<kKp6LN@l5DqU0ecxfZW&kv<6G@N@7?NXQFT3YHk-1>~9
zQb-<swsh&&rOLyBkk=jLFCxyDTWMjjVA-MdYt&QAu{~%zIpWQK3nD1V-Jv`r=aA7O
zy(Li6^W0RTs(Ps$-q8&J5kpU10^j~Vfh-U>PeVD@Rz#V(jGNqnW8-fTLB4|S`?IaW
zS*LQ-`#GVY2eQS$-$mu)J=9%qUD@%?B(Z})An%kKKtUerTxMTt<sX`pu%x1Jq++$$
z9KBj&HEQpcC<d({5Qsp|HD4p${&@4NMZ9+)t=3_*l!+m%Unvm98kFioG5ned=z7Jz
zKAy2D?zUYOR}mZb?pkDG@FH+x`|B`M6;@6DjVt^vbb6i07p);D2S`^foo7ri?nRJm
z1cDGs;*nuj`FF<9U4XA_ChzaE22vPpLEs#)ZDOQS3s&ScP|3rf^k-!Om3=@JkCz7G
z0H&dI2S{KEjT2mh<r~(KVrY9%s#T}G3;}0Z!U5feBmh8wJs8V=AIy&m66xfzvpa^P
zjX}o#u4Ox+D=!$&p}lZgb%~4jyZ%JObERQsWIlGR8`TU-8oX$I+&H-OiyZMD{C$@!
zgp;E#FF2uLr9F;%HKqzD(I`YKK_l@lO%!x;OdB;To`udzf#RB((iUFQlT@Kp7IA^_
zQzZX>0JEn{L%DUK@U(AeZBwQfb69VGr6Qx{My9ZGzv6aB;=<=X(!ZRv6HM8+2s(bc
zKR(wV@pAS}%@34MpfGxoajRx+e0oh<lRoBEA4OaEptZYQAq{4?nM_mtp3#?KZBEaZ
zkBZOuIx;@WOZ07alPFM03harg?7Wu7;R<woJqFuCY3lnBvIm9y{{-%b)+I!f5pw?+
F<R3nT9HRgL
literal 0
Hc-jL100001
diff --git a/tests/f_quota/name b/tests/f_quota/name
new file mode 100644
index 0000000..27ea8ba
--- /dev/null
+++ b/tests/f_quota/name
@@ -0,0 +1 @@
+fix incorrect usage stats in quota
diff --git a/tests/f_quota/script b/tests/f_quota/script
new file mode 100644
index 0000000..bf25e07
--- /dev/null
+++ b/tests/f_quota/script
@@ -0,0 +1,4 @@
+AFTER_CMD='$DEBUGFS -f $test_dir/debugfs-cmds $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log'
+PASS_ZERO=true
+
+. $cmd_dir/run_e2fsck
--
1.9.0
This allows us to verify quota information in an ext4 file systems
with the quota feature.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
debugfs/Makefile.in | 177 ++++++++++++++++++++++++++++++++++-------------
debugfs/debug_cmds.ct | 6 ++
debugfs/debugfs.c | 3 +
debugfs/debugfs.h | 6 ++
debugfs/quota.c | 170 +++++++++++++++++++++++++++++++++++++++++++++
debugfs/ro_debug_cmds.ct | 7 +-
6 files changed, 319 insertions(+), 50 deletions(-)
create mode 100644 debugfs/quota.c
diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
index 5ddeab7..3dd06f0 100644
--- a/debugfs/Makefile.in
+++ b/debugfs/Makefile.in
@@ -18,25 +18,27 @@ MK_CMDS= _SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
- filefrag.o extent_cmds.o extent_inode.o zap.o
+ filefrag.o extent_cmds.o extent_inode.o zap.o quota.o
RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_cmds.o \
- extent_inode.o
+ extent_inode.o quota.o
SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
$(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
$(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
$(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
- $(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c
+ $(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c \
+ $(srcdir)/quota.c
-LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
+LIBS= $(LIBQUOTA) $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
$(LIBUUID) $(SYSLIBS)
-DEPLIBS= $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
+DEPLIBS= $(DEPLIBQUOTA) $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
$(DEPLIBBLKID) $(DEPLIBUUID)
-STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) $(STATIC_LIBCOM_ERR) \
- $(STATIC_LIBBLKID) $(STATIC_LIBUUID) $(STATIC_LIBE2P) $(SYSLIBS)
+STATIC_LIBS= $(STATIC_LIBQUOTA) $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) \
+ $(STATIC_LIBCOM_ERR) $(STATIC_LIBBLKID) $(STATIC_LIBUUID) \
+ $(STATIC_LIBE2P) $(SYSLIBS)
STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBSS) \
$(DEPSTATIC_LIBCOM_ERR) $(DEPSTATIC_LIBUUID) \
$(DEPSTATIC_LIBE2P)
@@ -133,76 +135,153 @@ distclean: clean
#
debug_cmds.o: debug_cmds.c $(top_srcdir)/lib/ss/ss.h \
$(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
-debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
- $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
+debugfs.o: $(srcdir)/debugfs.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
+ $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
+ $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
+ $(top_srcdir)/lib/ext2fs/kernel-list.h
+util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
$(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
- $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/ext2fs/kernel-list.h
-util.o: $(srcdir)/util.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ls.o: $(srcdir)/ls.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-ls.o: $(srcdir)/ls.c $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
- $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-ncheck.o: $(srcdir)/ncheck.c $(srcdir)/debugfs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ncheck.o: $(srcdir)/ncheck.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-icheck.o: $(srcdir)/icheck.c $(srcdir)/debugfs.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+icheck.o: $(srcdir)/icheck.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-lsdel.o: $(srcdir)/lsdel.c $(srcdir)/debugfs.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+lsdel.o: $(srcdir)/lsdel.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-dump.o: $(srcdir)/dump.c $(srcdir)/debugfs.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+dump.o: $(srcdir)/dump.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
-set_fields.o: $(srcdir)/set_fields.c $(srcdir)/debugfs.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+set_fields.o: $(srcdir)/set_fields.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
$(top_srcdir)/lib/e2p/e2p.h
-logdump.o: $(srcdir)/logdump.c $(srcdir)/debugfs.h \
+logdump.o: $(srcdir)/logdump.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
$(srcdir)/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
$(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
-htree.o: $(srcdir)/htree.c $(srcdir)/debugfs.h \
+htree.o: $(srcdir)/htree.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
$(top_srcdir)/lib/e2p/e2p.h
-unused.o: $(srcdir)/unused.c $(srcdir)/debugfs.h \
+unused.o: $(srcdir)/unused.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
$(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+e2freefrag.o: $(srcdir)/../misc/e2freefrag.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
+ $(srcdir)/../misc/e2freefrag.h
+filefrag.o: $(srcdir)/filefrag.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+extent_inode.o: $(srcdir)/extent_inode.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+zap.o: $(srcdir)/zap.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
+ $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
+ $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
diff --git a/debugfs/debug_cmds.ct b/debugfs/debug_cmds.ct
index 96ff00f..6a18df6 100644
--- a/debugfs/debug_cmds.ct
+++ b/debugfs/debug_cmds.ct
@@ -190,5 +190,11 @@ request do_zap_block, "Zap block: fill with 0, pattern, flip bits etc.",
request do_block_dump, "Dump contents of a block",
block_dump, bd;
+request do_list_quota, "List quota",
+ list_quota, lq;
+
+request do_get_quota, "Get quota",
+ get_quota, gq;
+
end;
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 0e56ead..326f41e 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -56,6 +56,7 @@ const char *debug_prog_name;
int sci_idx;
ext2_filsys current_fs = NULL;
+quota_ctx_t current_qctx;
ext2_ino_t root, cwd;
static void open_filesystem(char *device, int open_flags, blk64_t superblock,
@@ -238,6 +239,8 @@ static void close_filesystem(NOARGS)
if (retval)
com_err("ext2fs_write_block_bitmap", retval, 0);
}
+ if (current_qctx)
+ quota_release_context(¤t_qctx);
retval = ext2fs_close(current_fs);
if (retval)
com_err("ext2fs_close", retval, 0);
diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h
index 33389fa..9b67f69 100644
--- a/debugfs/debugfs.h
+++ b/debugfs/debugfs.h
@@ -5,6 +5,7 @@
#include "ss/ss.h"
#include "ext2fs/ext2_fs.h"
#include "ext2fs/ext2fs.h"
+#include "quota/quotaio.h"
#ifdef __STDC__
#define NOARGS void
@@ -21,6 +22,7 @@
#define CHECK_FS_NOTOPEN 0x0004
extern ext2_filsys current_fs;
+extern quota_ctx_t current_qctx;
extern ext2_ino_t root, cwd;
extern int sci_idx;
extern ss_request_table debug_cmds, extent_cmds;
@@ -171,6 +173,10 @@ extern void do_set_mmp_value(int argc, char **argv);
extern void do_freefrag(int argc, char **argv);
extern void do_filefrag(int argc, char *argv[]);
+/* quota.c */
+extern void do_list_quota(int argc, char *argv[]);
+extern void do_get_quota(int argc, char *argv[]);
+
/* util.c */
extern time_t string_to_time(const char *arg);
diff --git a/debugfs/quota.c b/debugfs/quota.c
new file mode 100644
index 0000000..cbf237a
--- /dev/null
+++ b/debugfs/quota.c
@@ -0,0 +1,170 @@
+/*
+ * quota.c --- debugfs quota commands
+ *
+ * Copyright (C) 2014 Theodore Ts'o. This file may be redistributed
+ * under the terms of the GNU Public License.
+ */
+
+#include "config.h"
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <time.h>
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#include <sys/types.h>
+#ifdef HAVE_GETOPT_H
+#include <getopt.h>
+#else
+extern int optind;
+extern char *optarg;
+#endif
+
+#include "debugfs.h"
+
+const char *quota_type[] = { "user", "group", NULL };
+
+static int load_quota_ctx(char *progname)
+{
+ errcode_t retval;
+
+ if (check_fs_open(progname))
+ return 1;
+
+ if (!EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
+ EXT4_FEATURE_RO_COMPAT_QUOTA)) {
+ com_err(progname, 0, "quota feature not eanbled");
+ return 1;
+ }
+
+ if (current_qctx)
+ return 0;
+
+ retval = quota_init_context(¤t_qctx, current_fs, -1);
+ if (retval) {
+ com_err(current_fs->device_name, retval,
+ "while trying to load quota information");
+ return 1;
+ }
+ return 0;
+}
+
+static int parse_quota_type(const char *cmdname, const char *str)
+{
+ errcode_t retval;
+ char *t;
+ int flags = 0;
+ int i;
+
+ for (i = 0; i < MAXQUOTAS; i++) {
+ if (strcasecmp(str, quota_type[i]) == 0)
+ break;
+ }
+ if (i >= MAXQUOTAS) {
+ i = strtol(str, &t, 0);
+ if (*t)
+ i = -1;
+ }
+ if (i < 0 || i >= MAXQUOTAS) {
+ com_err(0, 0, "Invalid quota type: %s", str);
+ printf("Valid quota types are: ");
+ for (i = 0; i < MAXQUOTAS; i++)
+ printf("%s ", quota_type[i]);
+ printf("\n");
+ return -1;
+ }
+
+ if (current_fs->flags & EXT2_FLAG_RW)
+ flags |= EXT2_FILE_WRITE;
+
+ retval = quota_file_open(current_qctx, NULL, 0, i, -1, flags);
+ if (retval) {
+ com_err(cmdname, retval,
+ "while opening quota inode (type %d)", i);
+ return -1;
+ }
+ return i;
+}
+
+
+static int list_quota_callback(struct dquot *dq, void *cb_data)
+{
+ printf("%8u %8lld %8lld %8lld %8lld %8lld %8lld\n",
+ dq->dq_id, dq->dq_dqb.dqb_curspace,
+ dq->dq_dqb.dqb_bsoftlimit, dq->dq_dqb.dqb_bhardlimit,
+ dq->dq_dqb.dqb_curinodes,
+ dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
+}
+
+void do_list_quota(int argc, char *argv[])
+{
+ errcode_t retval;
+ int i, type;
+ int flags = 0;
+ struct quota_handle *qh;
+
+ if (load_quota_ctx(argv[0]))
+ return;
+
+ if (argc != 2) {
+ com_err(0, 0, "Usage: list_quota <quota_type>\n");
+ return;
+ }
+
+ type = parse_quota_type(argv[0], argv[1]);
+ if (type < 0)
+ return;
+
+ printf("%8s %8s %8s %8s %8s %8s %8s\n",
+ (type == 0) ? "user id" : "group id",
+ "blocks", "quota", "limit", "inodes", "quota", "limit");
+ qh = current_qctx->quota_file[type];
+ retval = qh->qh_ops->scan_dquots(qh, list_quota_callback, NULL);
+ if (retval) {
+ com_err(argv[0], retval, "while scanning dquots");
+ return;
+ }
+}
+
+void do_get_quota(int argc, char *argv[])
+{
+ errcode_t retval;
+ int i, err, type;
+ int flags = 0;
+ struct quota_handle *qh;
+ struct dquot *dq;
+ qid_t id;
+
+ if (load_quota_ctx(argv[0]))
+ return;
+
+ if (argc != 3) {
+ com_err(0, 0, "Usage: get_quota <quota_type> <id>\n");
+ return;
+ }
+
+ type = parse_quota_type(argv[0], argv[1]);
+ if (type < 0)
+ return;
+
+ id = parse_ulong(argv[2], argv[0], "id", &err);
+ if (err)
+ return;
+
+ printf("%8s %8s %8s %8s %8s %8s %8s\n",
+ (type == 0) ? "user id" : "group id",
+ "blocks", "quota", "limit", "inodes", "quota", "limit");
+
+ qh = current_qctx->quota_file[type];
+
+ dq = qh->qh_ops->read_dquot(qh, id);
+ if (dq) {
+ list_quota_callback(dq, NULL);
+ ext2fs_free_mem(&dq);
+ } else
+ com_err(argv[0], 0, "couldn't read quota record");
+
+}
diff --git a/debugfs/ro_debug_cmds.ct b/debugfs/ro_debug_cmds.ct
index 8226d1a..736ade6 100644
--- a/debugfs/ro_debug_cmds.ct
+++ b/debugfs/ro_debug_cmds.ct
@@ -90,5 +90,10 @@ request do_dump_mmp, "Dump MMP information",
request do_extent_open, "Open inode for extent manipulation",
extent_open, eo;
-end;
+request do_list_quota, "List quota",
+ lost_quota, lq;
+
+request do_get_quota, "Get quota",
+ get_quota, gq;
+end;
--
1.9.0
This makes memory management easier because when the quota context is
released, all of the quota file handles get released automatically.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
lib/quota/mkquota.c | 26 ++++++++++++++++---------
lib/quota/quotaio.c | 55 +++++++++++++++++++++++++++++++++++++++++++----------
lib/quota/quotaio.h | 6 ++++--
3 files changed, 66 insertions(+), 21 deletions(-)
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index bb8482b..58803d0 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -183,7 +183,7 @@ errcode_t quota_write_inode(quota_ctx_t qctx, int qtype)
}
write_dquots(dict, h);
- retval = quota_file_close(h);
+ retval = quota_file_close(qctx, h);
if (retval < 0) {
log_err("Cannot finish IO on new quotafile: %s",
strerror(errno));
@@ -251,9 +251,10 @@ static void quota_dnode_free(dnode_t *node,
*/
errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
{
- int i, err = 0;
+ errcode_t err;
dict_t *dict;
quota_ctx_t ctx;
+ int i;
err = ext2fs_get_mem(sizeof(struct quota_ctx), &ctx);
if (err) {
@@ -263,6 +264,7 @@ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
memset(ctx, 0, sizeof(struct quota_ctx));
for (i = 0; i < MAXQUOTAS; i++) {
+ ctx->quota_file[i] = NULL;
if ((qtype != -1) && (i != qtype))
continue;
err = ext2fs_get_mem(sizeof(dict_t), &dict);
@@ -283,6 +285,7 @@ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
void quota_release_context(quota_ctx_t *qctx)
{
+ errcode_t err;
dict_t *dict;
int i;
quota_ctx_t ctx;
@@ -298,6 +301,14 @@ void quota_release_context(quota_ctx_t *qctx)
dict_free_nodes(dict);
free(dict);
}
+ if (ctx->quota_file[i]) {
+ err = quota_file_close(ctx, ctx->quota_file[i]);
+ if (err) {
+ log_err("Cannot close quotafile: %s",
+ strerror(errno));
+ ext2fs_free_mem(&ctx->quota_file[i]);
+ }
+ }
}
*qctx = NULL;
free(ctx);
@@ -541,7 +552,7 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type)
return err;
}
- err = quota_file_open(qh, qctx->fs, qf_ino, type, -1, 0);
+ err = quota_file_open(qctx, qh, qf_ino, type, -1, 0);
if (err) {
log_err("Open quota file failed");
goto out;
@@ -549,7 +560,7 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type)
quota_read_all_dquots(qh, qctx, 1);
- err = quota_file_close(qh);
+ err = quota_file_close(qctx, qh);
if (err) {
log_err("Cannot finish IO on new quotafile: %s",
strerror(errno));
@@ -575,15 +586,12 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
struct dquot *dq;
dnode_t *n;
dict_t *dict = qctx->quota_dict[qtype];
- ext2_ino_t qf_ino;
errcode_t err = 0;
if (!dict)
goto out;
- qf_ino = qtype == USRQUOTA ? fs->super->s_usr_quota_inum :
- fs->super->s_grp_quota_inum;
- err = quota_file_open(&qh, fs, qf_ino, qtype, -1, 0);
+ err = quota_file_open(qctx, &qh, 0, qtype, -1, 0);
if (err) {
log_err("Open quota file failed");
goto out;
@@ -612,7 +620,7 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
*usage_inconsistent = scan_data.usage_is_inconsistent;
out_close_qh:
- err = quota_file_close(&qh);
+ err = quota_file_close(qctx, &qh);
if (err) {
log_err("Cannot close quotafile: %s", error_message(errno));
if (qh.qh_qf.e2_file)
diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
index a95a1f9..65fccaa 100644
--- a/lib/quota/quotaio.c
+++ b/lib/quota/quotaio.c
@@ -197,11 +197,16 @@ static unsigned int quota_read_nomount(struct quota_file *qf,
/*
* Detect quota format and initialize quota IO
*/
-errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
+errcode_t quota_file_open(quota_ctx_t qctx, struct quota_handle *h,
ext2_ino_t qf_ino, int type, int fmt, int flags)
{
+ ext2_filsys fs = qctx->fs;
ext2_file_t e2_file;
errcode_t err;
+ int allocated_handle = 0;
+
+ if (type >= MAXQUOTAS)
+ return EINVAL;
if (fmt == -1)
fmt = QFMT_VFS_V1;
@@ -210,18 +215,42 @@ errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
if (err)
return err;
+ if (qf_ino == 0) {
+ if (type == USRQUOTA)
+ qf_ino = fs->super->s_usr_quota_inum;
+ else
+ qf_ino = fs->super->s_grp_quota_inum;
+ }
+
log_debug("Opening quota ino=%lu, type=%d", qf_ino, type);
err = ext2fs_file_open(fs, qf_ino, flags, &e2_file);
if (err) {
log_err("ext2fs_file_open failed: %s", error_message(err));
return err;
}
- h->qh_qf.e2_file = e2_file;
+ if (!h) {
+ if (qctx->quota_file[type]) {
+ h = qctx->quota_file[type];
+ if (((flags & EXT2_FILE_WRITE) == 0) ||
+ (h->qh_file_flags & EXT2_FILE_WRITE))
+ return 0;
+ (void) quota_file_close(qctx, h);
+ }
+ err = ext2fs_get_mem(sizeof(struct quota_handle), &h);
+ if (err) {
+ log_err("Unable to allocate quota handle");
+ return err;
+ }
+ allocated_handle = 1;
+ }
+
+ h->qh_qf.e2_file = e2_file;
h->qh_qf.fs = fs;
h->qh_qf.ino = qf_ino;
h->e2fs_write = quota_write_nomount;
h->e2fs_read = quota_read_nomount;
+ h->qh_file_flags = flags;
h->qh_io_flags = 0;
h->qh_type = type;
h->qh_fmt = fmt;
@@ -231,17 +260,22 @@ errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
if (h->qh_ops->check_file &&
(h->qh_ops->check_file(h, type, fmt) == 0)) {
log_err("qh_ops->check_file failed");
- ext2fs_file_close(e2_file);
- return -1;
+ goto errout;
}
if (h->qh_ops->init_io && (h->qh_ops->init_io(h) < 0)) {
log_err("qh_ops->init_io failed");
- ext2fs_file_close(e2_file);
- return -1;
+ goto errout;
}
+ if (allocated_handle)
+ qctx->quota_file[type] = h;
return 0;
+errout:
+ ext2fs_file_close(e2_file);
+ if (allocated_handle)
+ ext2fs_free_mem(&h);
+ return -1;
}
static errcode_t quota_inode_init_new(ext2_filsys fs, ext2_ino_t ino)
@@ -307,12 +341,12 @@ errcode_t quota_file_create(struct quota_handle *h, ext2_filsys fs, int type, in
goto out_err;
}
h->qh_qf.ino = qf_inum;
+ h->qh_file_flags = EXT2_FILE_WRITE | EXT2_FILE_CREATE;
h->e2fs_write = quota_write_nomount;
h->e2fs_read = quota_read_nomount;
log_debug("Creating quota ino=%lu, type=%d", qf_inum, type);
- err = ext2fs_file_open(fs, qf_inum,
- EXT2_FILE_WRITE | EXT2_FILE_CREATE, &e2_file);
+ err = ext2fs_file_open(fs, qf_inum, h->qh_file_flags, &e2_file);
if (err) {
log_err("ext2fs_file_open failed: %d", err);
goto out_err;
@@ -345,7 +379,7 @@ out_err:
/*
* Close quotafile and release handle
*/
-errcode_t quota_file_close(struct quota_handle *h)
+errcode_t quota_file_close(quota_ctx_t qctx, struct quota_handle *h)
{
if (h->qh_io_flags & IOFL_INFODIRTY) {
if (h->qh_ops->write_info && h->qh_ops->write_info(h) < 0)
@@ -366,7 +400,8 @@ errcode_t quota_file_close(struct quota_handle *h)
ext2fs_file_set_size2(h->qh_qf.e2_file, new_size);
ext2fs_file_close(h->qh_qf.e2_file);
}
-
+ if (qctx->quota_file[h->qh_type] == h)
+ ext2fs_free_mem(&qctx->quota_file[h->qh_type]);
return 0;
}
diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
index d3820a4..7ca7830 100644
--- a/lib/quota/quotaio.h
+++ b/lib/quota/quotaio.h
@@ -53,6 +53,7 @@ typedef struct quota_ctx *quota_ctx_t;
struct quota_ctx {
ext2_filsys fs;
dict_t *quota_dict[MAXQUOTAS];
+ struct quota_handle *quota_file[MAXQUOTAS];
};
/*
@@ -105,6 +106,7 @@ struct quota_file {
struct quota_handle {
int qh_type; /* Type of quotafile */
int qh_fmt; /* Quotafile format */
+ int qh_file_flags;
int qh_io_flags; /* IO flags for file */
struct quota_file qh_qf;
unsigned int (*e2fs_read)(struct quota_file *qf, ext2_loff_t offset,
@@ -171,7 +173,7 @@ extern struct quotafile_ops quotafile_ops_meta;
/* Open existing quotafile of given type (and verify its format) on given
* filesystem. */
-errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
+errcode_t quota_file_open(quota_ctx_t qctx, struct quota_handle *h,
ext2_ino_t qf_ino, int type, int fmt, int flags);
@@ -180,7 +182,7 @@ errcode_t quota_file_create(struct quota_handle *h, ext2_filsys fs,
int type, int fmt);
/* Close quotafile */
-errcode_t quota_file_close(struct quota_handle *h);
+errcode_t quota_file_close(quota_ctx_t qctx, struct quota_handle *h);
/* Get empty quota structure */
struct dquot *get_empty_dquot(void);
--
1.9.0
We no longer need to reference https://ext4.wiki.kernel.org/index.php/Quota
since we've fixed the nasty bugs associated with e2fsck and the quota
feature. The wiki page will be updated once we've done a release that
includes these fixes indicated the verison which these problems have
been fixed.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
misc/ext4.5.in | 7 -------
misc/mke2fs.c | 7 -------
misc/tune2fs.c | 4 ----
tests/m_quota/expect.1 | 4 ----
4 files changed, 22 deletions(-)
diff --git a/misc/ext4.5.in b/misc/ext4.5.in
index 5ec39f5..134c19f 100644
--- a/misc/ext4.5.in
+++ b/misc/ext4.5.in
@@ -210,13 +210,6 @@ shared storage environments.
@QUOTA_MAN_COMMENT@Causes the quota files (i.e., user.quota and
@[email protected] which existed
@QUOTA_MAN_COMMENT@in the older quota design) to be hidden inodes.
-@[email protected]
-@[email protected] Warning:
-@QUOTA_MAN_COMMENT@The quota feature is still under development,
-@QUOTA_MAN_COMMENT@and may not be fully supported with your kernel
-@QUOTA_MAN_COMMENT@or may have various bugs. Please
-@QUOTA_MAN_COMMENT@see https://ext4.wiki.kernel.org/index.php/Quota
-@QUOTA_MAN_COMMENT@for more details.
.TP
.B resize_inode
.br
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index e1fd40e..9c4b0b2 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2162,13 +2162,6 @@ profile_error:
"See https://ext4.wiki.kernel.org/"
"index.php/Bigalloc for more information\n\n"));
- if (!quiet &&
- (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_QUOTA))
- fprintf(stderr, "%s", _("\nWarning: the quota feature is "
- "still under development\n"
- "See https://ext4.wiki.kernel.org/"
- "index.php/Quota for more information\n\n"));
-
/* Since sparse_super is the default, we would only have a problem
* here if it was explicitly disabled.
*/
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 37f0b56..9ba32a1 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -776,10 +776,6 @@ static void handle_quota_options(ext2_filsys fs)
quota_release_context(&qctx);
if ((usrquota == QOPT_ENABLE) || (grpquota == QOPT_ENABLE)) {
- fprintf(stderr, "%s", _("\nWarning: the quota feature is still "
- "under development\n"
- "See https://ext4.wiki.kernel.org/"
- "index.php/Quota for more information\n\n"));
fs->super->s_feature_ro_compat |= EXT4_FEATURE_RO_COMPAT_QUOTA;
ext2fs_mark_super_dirty(fs);
} else if (!fs->super->s_usr_quota_inum &&
diff --git a/tests/m_quota/expect.1 b/tests/m_quota/expect.1
index a0f6501..787871c 100644
--- a/tests/m_quota/expect.1
+++ b/tests/m_quota/expect.1
@@ -1,7 +1,3 @@
-
-Warning: the quota feature is still under development
-See https://ext4.wiki.kernel.org/index.php/Quota for more information
In scan_dquota_callback() we were copying dqb_off from the on-disk
dquot structure to the dqot structure that we have constructed in
memory. This is a bad idea, because if we detect that the quota inode
is corrupted and needs to be replaced, when we later write out the
inode, the fact that we have a non-zero dqb_off value means that quota
routines will not bother updating the quota tree index, since
presumably the quota tree index already has an entry for this dqot.
The problem is that e2fsck, the only user of these functions, has
zapped the quota inode so it can be written from scratch. So this
means the index for the quota records are not written out, so the
kernel can not find any of the records in the quota inodes. Oops.
The fix is simple; there is no reason to copy the dqb_off field into
the quota_dict copy of struct dquot.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
lib/quota/mkquota.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index 3849ae1..f77e072 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -458,7 +458,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
dq = get_dq(quota_dict, dquot->dq_id);
dq->dq_id = dquot->dq_id;
- dq->dq_dqb.u.v2_mdqb.dqb_off = dquot->dq_dqb.u.v2_mdqb.dqb_off;
print_dquot("mem", dq);
print_dquot("dsk", dquot);
--
1.9.0
The quota_handle wasn't getting closed in quota_compare_and_update().
Fix this, and also make sure that quota_file_close() doesn't
unnecessarily modify the quota inode if it's not necessary. Otherwise
e2fsck will claim that the file system is modified when it didn't need
to be.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
lib/quota/mkquota.c | 9 ++++++++-
lib/quota/quotaio.c | 9 +++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index f5ae0e0..ed10890 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -597,7 +597,7 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
err = qh.qh_ops->scan_dquots(&qh, scan_dquots_callback, &scan_data);
if (err) {
log_err("Error scanning dquots");
- goto out;
+ goto out_close_qh;
}
for (n = dict_first(dict); n; n = dict_next(dict, n)) {
@@ -612,6 +612,13 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
}
*usage_inconsistent = scan_data.usage_is_inconsistent;
+out_close_qh:
+ err = quota_file_close(&qh);
+ if (err) {
+ log_err("Cannot close quotafile: %s", error_message(errno));
+ if (qh.qh_qf.e2_file)
+ ext2fs_file_close(qh.qh_qf.e2_file);
+ }
out:
return err;
}
diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
index 7e98ed7..a95a1f9 100644
--- a/lib/quota/quotaio.c
+++ b/lib/quota/quotaio.c
@@ -356,9 +356,14 @@ errcode_t quota_file_close(struct quota_handle *h)
if (h->qh_ops->end_io && h->qh_ops->end_io(h) < 0)
return -1;
if (h->qh_qf.e2_file) {
+ __u64 new_size, size;
+
+ new_size = compute_inode_size(h->qh_qf.fs, h->qh_qf.ino);
ext2fs_file_flush(h->qh_qf.e2_file);
- ext2fs_file_set_size2(h->qh_qf.e2_file,
- compute_inode_size(h->qh_qf.fs, h->qh_qf.ino));
+ if (ext2fs_file_get_lsize(h->qh_qf.e2_file, &size))
+ new_size = 0;
+ if (size != new_size)
+ ext2fs_file_set_size2(h->qh_qf.e2_file, new_size);
ext2fs_file_close(h->qh_qf.e2_file);
}
--
1.9.0
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
lib/quota/common.h | 1 +
lib/quota/mkquota.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/lib/quota/common.h b/lib/quota/common.h
index 7d324bf..f1ad79f 100644
--- a/lib/quota/common.h
+++ b/lib/quota/common.h
@@ -13,6 +13,7 @@
#include <ext2fs/ext2_types.h>
#endif /* EXT2_FLAT_INCLUDES */
+/* #define DEBUG_QUOTA 1 */
#ifndef __attribute__
# if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index ba8c2da..3849ae1 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -45,6 +45,21 @@ static void print_inode(struct ext2_inode *inode)
return;
}
+
+static void print_dquot(const char *desc, struct dquot *dq)
+{
+ if (desc)
+ fprintf(stderr, "%s: ", desc);
+ fprintf(stderr, "%u %lld:%lld:%lld %lld:%lld:%lld\n",
+ dq->dq_id, dq->dq_dqb.dqb_curspace,
+ dq->dq_dqb.dqb_bsoftlimit, dq->dq_dqb.dqb_bhardlimit,
+ dq->dq_dqb.dqb_curinodes,
+ dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
+}
+#else
+static void print_dquot(const char *desc, struct dquot *dq)
+{
+}
#endif
/*
@@ -121,6 +136,7 @@ static void write_dquots(dict_t *dict, struct quota_handle *qh)
for (n = dict_first(dict); n; n = dict_next(dict, n)) {
dq = dnode_get(n);
if (dq) {
+ print_dquot("write", dq);
dq->dq_h = qh;
update_grace_times(dq);
qh->qh_ops->commit_dquot(dq);
@@ -444,6 +460,9 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
dq->dq_id = dquot->dq_id;
dq->dq_dqb.u.v2_mdqb.dqb_off = dquot->dq_dqb.u.v2_mdqb.dqb_off;
+ print_dquot("mem", dq);
+ print_dquot("dsk", dquot);
+
/* Check if there is inconsistancy. */
if (dq->dq_dqb.dqb_curspace != dquot->dq_dqb.dqb_curspace ||
dq->dq_dqb.dqb_curinodes != dquot->dq_dqb.dqb_curinodes) {
--
1.9.0
There are interfaces that are used by mke2fs.c and tune2fs.c which are
in quotaio.h, and some future changes will be much simpler if we can
combine the two header files together. Also the guard #ifdef for
mkquota.h was incorrect, which caused problems when both header files
needed to be included.
Also remove quota.pc and installation rules for libquota, since this
library is never going to be something that we can export externally
anyway. Eventually we'll want to clean up the interfaces and move the
external publishable interfaces to the libext2fs library, and then
rename what's left from libquota.a to libsupport.a for internal use
only.
Signed-off-by: "Theodore Ts'o" <[email protected]>
Cc: [email protected]
---
debian/rules | 4 --
e2fsck/Makefile.in | 186 ++++++++++++++++++++++----------------------------
e2fsck/e2fsck.h | 2 +-
e2fsck/quota.c | 1 -
lib/quota/Makefile.in | 59 ++++------------
lib/quota/mkquota.c | 1 -
lib/quota/mkquota.h | 64 -----------------
lib/quota/quota.pc.in | 11 ---
lib/quota/quotaio.h | 56 +++++++++++++++
misc/Makefile.in | 14 ++--
misc/mke2fs.c | 2 +-
misc/tune2fs.c | 2 +-
12 files changed, 160 insertions(+), 242 deletions(-)
delete mode 100644 lib/quota/mkquota.h
delete mode 100644 lib/quota/quota.pc.in
diff --git a/debian/rules b/debian/rules
index 2f722aa..7e8d01d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -425,10 +425,6 @@ ifneq ($(BUILD_E2FSCK_STATIC),no)
cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
endif
- # remove static quota library for now
- rm ${tmpdir}/usr/include/quota/mkquota.h
- find ${tmpdir} -name quota.pc -o -name libquota.a | xargs rm
-
ifeq ($(DEB_BUILD_GNU_SYSTEM), gnu)
${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
endif
diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
index 77017ef..4b10f6f 100644
--- a/e2fsck/Makefile.in
+++ b/e2fsck/Makefile.in
@@ -297,10 +297,9 @@ e2fsck.o: $(srcdir)/e2fsck.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
crc32.o: $(srcdir)/crc32.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -308,10 +307,9 @@ crc32.o: $(srcdir)/crc32.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/crc32defs.h crc32table.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/crc32defs.h crc32table.h
gen_crc32table.o: $(srcdir)/gen_crc32table.c $(srcdir)/crc32defs.h
dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/dict.h
@@ -322,10 +320,9 @@ super.o: $(srcdir)/super.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
pass1.o: $(srcdir)/pass1.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -333,10 +330,9 @@ pass1.o: $(srcdir)/pass1.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
pass1b.o: $(srcdir)/pass1b.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -344,10 +340,9 @@ pass1b.o: $(srcdir)/pass1b.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h $(srcdir)/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/dict.h
pass2.o: $(srcdir)/pass2.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -355,10 +350,9 @@ pass2.o: $(srcdir)/pass2.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h $(srcdir)/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/dict.h
pass3.o: $(srcdir)/pass3.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -366,10 +360,9 @@ pass3.o: $(srcdir)/pass3.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
pass4.o: $(srcdir)/pass4.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -377,10 +370,9 @@ pass4.o: $(srcdir)/pass4.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
pass5.o: $(srcdir)/pass5.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -388,10 +380,9 @@ pass5.o: $(srcdir)/pass5.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -399,11 +390,11 @@ journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/ext2fs/kernel-list.h $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
+ $(srcdir)/problem.h
recovery.o: $(srcdir)/recovery.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -411,11 +402,10 @@ recovery.o: $(srcdir)/recovery.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/ext2fs/kernel-list.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
revoke.o: $(srcdir)/revoke.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -423,11 +413,10 @@ revoke.o: $(srcdir)/revoke.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
- $(top_srcdir)/lib/ext2fs/kernel-list.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
+ $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
badblocks.o: $(srcdir)/badblocks.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
@@ -435,9 +424,9 @@ badblocks.o: $(srcdir)/badblocks.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -445,9 +434,9 @@ util.o: $(srcdir)/util.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
unix.o: $(srcdir)/unix.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/e2p/e2p.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -455,10 +444,10 @@ unix.o: $(srcdir)/unix.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h $(top_srcdir)/version.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h \
+ $(top_srcdir)/version.h
dirinfo.o: $(srcdir)/dirinfo.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -466,10 +455,9 @@ dirinfo.o: $(srcdir)/dirinfo.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(top_srcdir)/lib/ext2fs/tdb.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/tdb.h
dx_dirinfo.o: $(srcdir)/dx_dirinfo.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -477,9 +465,9 @@ dx_dirinfo.o: $(srcdir)/dx_dirinfo.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
ehandler.o: $(srcdir)/ehandler.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -487,9 +475,9 @@ ehandler.o: $(srcdir)/ehandler.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
problem.o: $(srcdir)/problem.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -497,10 +485,9 @@ problem.o: $(srcdir)/problem.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h $(srcdir)/problemP.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/problemP.h
message.o: $(srcdir)/message.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -508,10 +495,9 @@ message.o: $(srcdir)/message.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
ea_refcount.o: $(srcdir)/ea_refcount.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -519,9 +505,9 @@ ea_refcount.o: $(srcdir)/ea_refcount.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
rehash.o: $(srcdir)/rehash.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -529,10 +515,9 @@ rehash.o: $(srcdir)/rehash.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
region.o: $(srcdir)/region.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -540,9 +525,9 @@ region.o: $(srcdir)/region.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
profile.o: $(srcdir)/profile.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
$(srcdir)/profile.h prof_err.h
@@ -553,9 +538,9 @@ sigcatcher.o: $(srcdir)/sigcatcher.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
logfile.o: $(srcdir)/logfile.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
$(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
@@ -563,18 +548,7 @@ logfile.o: $(srcdir)/logfile.c $(top_builddir)/lib/config.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
+ $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
prof_err.o: prof_err.c
-quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
- $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
- $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/problem.h $(top_srcdir)/lib/quota/quotaio.h
diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h
index 8fc9993..c71a0a5 100644
--- a/e2fsck/e2fsck.h
+++ b/e2fsck/e2fsck.h
@@ -67,7 +67,7 @@
#define E2FSCK_ATTR(x)
#endif
-#include "quota/mkquota.h"
+#include "quota/quotaio.h"
/*
* Exit codes used by fsck-type programs
diff --git a/e2fsck/quota.c b/e2fsck/quota.c
index 42569bb..c6bbb9a 100644
--- a/e2fsck/quota.c
+++ b/e2fsck/quota.c
@@ -15,7 +15,6 @@
#include "e2fsck.h"
#include "problem.h"
-#include "quota/mkquota.h"
#include "quota/quotaio.h"
static void move_quota_inode(ext2_filsys fs, ext2_ino_t from_ino,
diff --git a/lib/quota/Makefile.in b/lib/quota/Makefile.in
index dc3eae0..92df268 100644
--- a/lib/quota/Makefile.in
+++ b/lib/quota/Makefile.in
@@ -12,9 +12,6 @@ INSTALL = @INSTALL@
all::
-SMANPAGES=
-
-
OBJS= mkquota.o quotaio.o quotaio_v2.o quotaio_tree.o dict.o
SRCS= $(srcdir)/mkquota.c \
@@ -53,12 +50,6 @@ LIBDIR= quota
#ELF_CMT# $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
#BSDLIB_CMT# $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
-all:: $(SMANPAGES) quota.pc
-
-quota.pc: $(srcdir)/quota.pc.in $(top_builddir)/config.status
- $(E) " CONFIG.STATUS $@"
- $(Q) cd $(top_builddir); CONFIG_FILES=lib/quota/quota.pc ./config.status
-
dict.o:
$(E) " CC $<"
$(Q) $(CC) -c $(ALL_CFLAGS) $(top_srcdir)/e2fsck/dict.c -o $@
@@ -72,32 +63,10 @@ dict.o:
#BSDLIB_CMT# $(top_srcdir)/e2fsck/dict.c
installdirs::
- $(E) " MKINSTALLDIRS $(libdir) $(includedir)/quota $(man3dir)"
- $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
- $(DESTDIR)$(includedir)/quota $(DESTDIR)$(man3dir) \
- $(DESTDIR)$(pkgconfigdir)
-
-install:: all installdirs
- $(E) " INSTALL_DATA $(libdir)/libquota.a"
- $(Q) $(INSTALL_DATA) libquota.a $(DESTDIR)$(libdir)/libquota.a
- -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libquota.a
- $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libquota.a
- $(E) " INSTALL_DATA $(includedir)/quota/mkquota.h"
- $(Q) $(INSTALL_DATA) $(srcdir)/mkquota.h $(DESTDIR)$(includedir)/quota/mkquota.h
- $(Q) for i in $(SMANPAGES); do \
- $(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \
- echo " INSTALL_DATA $(man3dir)/$$i"; \
- $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \
- done
- $(E) " INSTALL_DATA $(pkgconfigdir)/quota.pc"
- $(Q) $(INSTALL_DATA) quota.pc $(DESTDIR)$(pkgconfigdir)/quota.pc
+
+install:: all
uninstall::
- $(RM) -f $(DESTDIR)$(libdir)/libquota.a \
- $(DESTDIR)$(pkgconfigdir)/quota.pc
- for i in $(SMANPAGES); do \
- $(RM) -f $(DESTDIR)$(man3dir)/$$i; \
- done
clean::
$(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
@@ -108,7 +77,7 @@ clean::
mostlyclean:: clean
distclean:: clean
- $(RM) -f .depend Makefile quota.pc \
+ $(RM) -f .depend Makefile \
$(srcdir)/TAGS $(srcdir)/Makefile.in.old
#
@@ -132,33 +101,35 @@ mkquota.o: $(srcdir)/mkquota.c $(top_builddir)/lib/config.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/bitops.h \
$(top_srcdir)/lib/e2p/e2p.h $(srcdir)/quotaio.h $(srcdir)/dqblk_v2.h \
- $(srcdir)/quotaio_tree.h $(srcdir)/quotaio_v2.h $(srcdir)/mkquota.h \
- $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/common.h
+ $(srcdir)/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
+ $(srcdir)/quotaio_v2.h $(srcdir)/common.h
quotaio.o: $(srcdir)/quotaio.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio.h \
- $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
- $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h
+ $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
quotaio_tree.o: $(srcdir)/quotaio_tree.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio_tree.h \
- $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
- $(srcdir)/dqblk_v2.h
+ $(srcdir)/dqblk_v2.h $(top_srcdir)/lib/../e2fsck/dict.h
quotaio_v2.o: $(srcdir)/quotaio_v2.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio_v2.h \
- $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
- $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
+ $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
+ $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
- $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h
+ $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h
dict.o: $(srcdir)/../../e2fsck/dict.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(srcdir)/../../e2fsck/dict.h
diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
index ed10890..bb8482b 100644
--- a/lib/quota/mkquota.c
+++ b/lib/quota/mkquota.c
@@ -18,7 +18,6 @@
#include "quotaio.h"
#include "quotaio_v2.h"
#include "quotaio_tree.h"
-#include "mkquota.h"
#include "common.h"
/* Needed for architectures where sizeof(int) != sizeof(void *) */
diff --git a/lib/quota/mkquota.h b/lib/quota/mkquota.h
deleted file mode 100644
index ee15071..0000000
--- a/lib/quota/mkquota.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/** mkquota.h
- *
- * Interface to the quota library.
- *
- * The quota library provides interface for creating and updating the quota
- * files and the ext4 superblock fields. It supports the new VFS_V1 quota
- * format. The quota library also provides support for keeping track of quotas
- * in memory.
- * The typical way to use the quota library is as follows:
- * {
- * quota_ctx_t qctx;
- *
- * quota_init_context(&qctx, fs, -1);
- * {
- * quota_compute_usage(qctx, -1);
- * AND/OR
- * quota_data_add/quota_data_sub/quota_data_inodes();
- * }
- * quota_write_inode(qctx, USRQUOTA);
- * quota_write_inode(qctx, GRPQUOTA);
- * quota_release_context(&qctx);
- * }
- *
- * This initial version does not support reading the quota files. This support
- * will be added in near future.
- *
- * Aditya Kali <[email protected]>
- */
-
-#ifndef __QUOTA_QUOTAIO_H__
-#define __QUOTA_QUOTAIO_H__
-
-#include "ext2fs/ext2_fs.h"
-#include "ext2fs/ext2fs.h"
-#include "quotaio.h"
-#include "../e2fsck/dict.h"
-
-typedef struct quota_ctx *quota_ctx_t;
-
-struct quota_ctx {
- ext2_filsys fs;
- dict_t *quota_dict[MAXQUOTAS];
-};
-
-/* In mkquota.c */
-errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype);
-void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
- int adjust);
-void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
- qsize_t space);
-void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
- qsize_t space);
-errcode_t quota_write_inode(quota_ctx_t qctx, int qtype);
-errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type);
-errcode_t quota_compute_usage(quota_ctx_t qctx);
-void quota_release_context(quota_ctx_t *qctx);
-
-errcode_t quota_remove_inode(ext2_filsys fs, int qtype);
-int quota_file_exists(ext2_filsys fs, int qtype, int fmt);
-void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype);
-errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
- int *usage_inconsistent);
-
-#endif /* __QUOTA_QUOTAIO_H__ */
diff --git a/lib/quota/quota.pc.in b/lib/quota/quota.pc.in
deleted file mode 100644
index 1e4b887..0000000
--- a/lib/quota/quota.pc.in
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: quota
-Description: Quota management library
-Version: @E2FSPROGS_VERSION@
-Requires:
-Cflags: -I${includedir}/quota -I${includedir}
-Libs: -L${libdir} -lquota
diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
index 55e6eb0..d3820a4 100644
--- a/lib/quota/quotaio.h
+++ b/lib/quota/quotaio.h
@@ -1,6 +1,32 @@
/** quotaio.h
*
+ * Interface to the quota library.
+ *
+ * The quota library provides interface for creating and updating the quota
+ * files and the ext4 superblock fields. It supports the new VFS_V1 quota
+ * format. The quota library also provides support for keeping track of quotas
+ * in memory.
+ * The typical way to use the quota library is as follows:
+ * {
+ * quota_ctx_t qctx;
+ *
+ * quota_init_context(&qctx, fs, -1);
+ * {
+ * quota_compute_usage(qctx, -1);
+ * AND/OR
+ * quota_data_add/quota_data_sub/quota_data_inodes();
+ * }
+ * quota_write_inode(qctx, USRQUOTA);
+ * quota_write_inode(qctx, GRPQUOTA);
+ * quota_release_context(&qctx);
+ * }
+ *
+ * This initial version does not support reading the quota files. This support
+ * will be added in near future.
+ *
+ * Aditya Kali <[email protected]>
* Header of IO operations for quota utilities
+ *
* Jan Kara <[email protected]>
*/
@@ -11,8 +37,10 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include "ext2fs/ext2_fs.h"
#include "ext2fs/ext2fs.h"
#include "dqblk_v2.h"
+#include "../e2fsck/dict.h"
typedef int64_t qsize_t; /* Type in which we store size limitations */
@@ -20,6 +48,13 @@ typedef int64_t qsize_t; /* Type in which we store size limitations */
#define USRQUOTA 0
#define GRPQUOTA 1
+typedef struct quota_ctx *quota_ctx_t;
+
+struct quota_ctx {
+ ext2_filsys fs;
+ dict_t *quota_dict[MAXQUOTAS];
+};
+
/*
* Definitions of magics and versions of current quota files
*/
@@ -164,4 +199,25 @@ const char *quota_get_qf_name(int type, int fmt, char *buf);
const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt,
char *path_buf, size_t path_buf_size);
+/* In mkquota.c */
+errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype);
+void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
+ int adjust);
+void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
+ qsize_t space);
+void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
+ qsize_t space);
+errcode_t quota_write_inode(quota_ctx_t qctx, int qtype);
+errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type);
+errcode_t quota_compute_usage(quota_ctx_t qctx);
+void quota_release_context(quota_ctx_t *qctx);
+
+errcode_t quota_remove_inode(ext2_filsys fs, int qtype);
+int quota_file_exists(ext2_filsys fs, int qtype, int fmt);
+void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype);
+errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
+ int *usage_inconsistent);
+
+
+
#endif /* GUARD_QUOTAIO_H */
diff --git a/misc/Makefile.in b/misc/Makefile.in
index 29b6aab..8d3318b 100644
--- a/misc/Makefile.in
+++ b/misc/Makefile.in
@@ -629,10 +629,9 @@ tune2fs.o: $(srcdir)/tune2fs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/e2p/e2p.h $(srcdir)/jfs_user.h \
$(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
$(top_srcdir)/lib/ext2fs/kernel-list.h $(srcdir)/util.h \
- $(top_srcdir)/lib/quota/mkquota.h $(top_srcdir)/lib/quota/quotaio.h \
- $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
- $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/version.h \
- $(srcdir)/nls-enable.h
+ $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
+ $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
+ $(top_srcdir)/version.h $(srcdir)/nls-enable.h
mklost+found.o: $(srcdir)/mklost+found.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/version.h \
@@ -646,10 +645,9 @@ mke2fs.o: $(srcdir)/mke2fs.c $(top_builddir)/lib/config.h \
$(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
$(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
$(srcdir)/util.h profile.h prof_err.h $(top_srcdir)/version.h \
- $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h \
- $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
- $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
- $(srcdir)/mke2fs.h
+ $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/quotaio.h \
+ $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
+ $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/mke2fs.h
mk_hugefiles.o: $(srcdir)/mk_hugefiles.c $(top_builddir)/lib/config.h \
$(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
$(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fsP.h \
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 51532ef..e1fd40e 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -62,7 +62,7 @@ extern int optind;
#include "prof_err.h"
#include "../version.h"
#include "nls-enable.h"
-#include "quota/mkquota.h"
+#include "quota/quotaio.h"
#include "mke2fs.h"
#define STRIDE_LENGTH 8
diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index 7b3723b..37f0b56 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -60,7 +60,7 @@ extern int optind;
#include "jfs_user.h"
#include "util.h"
#include "blkid/blkid.h"
-#include "quota/mkquota.h"
+#include "quota/quotaio.h"
#include "../version.h"
#include "nls-enable.h"
--
1.9.0
I've fixed the summary line of this commit to read:
quota: remove mke2fs's and tune2fs's warning messages regarding quota
- Ted
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> lib/quota/common.h | 1 +
> lib/quota/mkquota.c | 19 +++++++++++++++++++
> 2 files changed, 20 insertions(+)
>
> diff --git a/lib/quota/common.h b/lib/quota/common.h
> index 7d324bf..f1ad79f 100644
> --- a/lib/quota/common.h
> +++ b/lib/quota/common.h
> @@ -13,6 +13,7 @@
> #include <ext2fs/ext2_types.h>
> #endif /* EXT2_FLAT_INCLUDES */
>
> +/* #define DEBUG_QUOTA 1 */
>
> #ifndef __attribute__
> # if !defined __GNUC__ || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index ba8c2da..3849ae1 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -45,6 +45,21 @@ static void print_inode(struct ext2_inode *inode)
>
> return;
> }
> +
> +static void print_dquot(const char *desc, struct dquot *dq)
> +{
> + if (desc)
> + fprintf(stderr, "%s: ", desc);
> + fprintf(stderr, "%u %lld:%lld:%lld %lld:%lld:%lld\n",
> + dq->dq_id, dq->dq_dqb.dqb_curspace,
> + dq->dq_dqb.dqb_bsoftlimit, dq->dq_dqb.dqb_bhardlimit,
> + dq->dq_dqb.dqb_curinodes,
> + dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
> +}
> +#else
> +static void print_dquot(const char *desc, struct dquot *dq)
> +{
> +}
> #endif
>
> /*
> @@ -121,6 +136,7 @@ static void write_dquots(dict_t *dict, struct quota_handle *qh)
> for (n = dict_first(dict); n; n = dict_next(dict, n)) {
> dq = dnode_get(n);
> if (dq) {
> + print_dquot("write", dq);
> dq->dq_h = qh;
> update_grace_times(dq);
> qh->qh_ops->commit_dquot(dq);
> @@ -444,6 +460,9 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
> dq->dq_id = dquot->dq_id;
> dq->dq_dqb.u.v2_mdqb.dqb_off = dquot->dq_dqb.u.v2_mdqb.dqb_off;
>
> + print_dquot("mem", dq);
> + print_dquot("dsk", dquot);
> +
> /* Check if there is inconsistancy. */
> if (dq->dq_dqb.dqb_curspace != dquot->dq_dqb.dqb_curspace ||
> dq->dq_dqb.dqb_curinodes != dquot->dq_dqb.dqb_curinodes) {
> --
> 1.9.0
>
--
Aditya
Looks good.
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> In scan_dquota_callback() we were copying dqb_off from the on-disk
> dquot structure to the dqot structure that we have constructed in
> memory. This is a bad idea, because if we detect that the quota inode
> is corrupted and needs to be replaced, when we later write out the
> inode, the fact that we have a non-zero dqb_off value means that quota
> routines will not bother updating the quota tree index, since
> presumably the quota tree index already has an entry for this dqot.
>
> The problem is that e2fsck, the only user of these functions, has
> zapped the quota inode so it can be written from scratch. So this
> means the index for the quota records are not written out, so the
> kernel can not find any of the records in the quota inodes. Oops.
>
> The fix is simple; there is no reason to copy the dqb_off field into
> the quota_dict copy of struct dquot.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> lib/quota/mkquota.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index 3849ae1..f77e072 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -458,7 +458,6 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
>
> dq = get_dq(quota_dict, dquot->dq_id);
> dq->dq_id = dquot->dq_id;
> - dq->dq_dqb.u.v2_mdqb.dqb_off = dquot->dq_dqb.u.v2_mdqb.dqb_off;
>
> print_dquot("mem", dq);
> print_dquot("dsk", dquot);
> --
> 1.9.0
>
--
Aditya
Looks good.
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> Previously if there was a missing quota entry --- i.e., if there were
> files owned by group "eng", but there was no quota record for group
> "eng", e2fsck would not notice the missing entry. This means that the
> usage informtion would not be properly repaired. This is unfortunate.
> Fix this by marking each quota record in quota_dict that has a
> corresponding record on disk, and then check to see if there are any
> records in quota_dict that have not been marked as having been seen.
> In that case, we know we need to update the relevant quota inode.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> lib/quota/mkquota.c | 17 ++++++++++++++++-
> lib/quota/quotaio.h | 2 ++
> 2 files changed, 18 insertions(+), 1 deletion(-)
>
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index f77e072..f5ae0e0 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -458,6 +458,7 @@ static int scan_dquots_callback(struct dquot *dquot, void *cb_data)
>
> dq = get_dq(quota_dict, dquot->dq_id);
> dq->dq_id = dquot->dq_id;
> + dq->dq_flags |= DQF_SEEN;
>
> print_dquot("mem", dq);
> print_dquot("dsk", dquot);
> @@ -572,10 +573,13 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> ext2_filsys fs = qctx->fs;
> struct quota_handle qh;
> struct scan_dquots_data scan_data;
> + struct dquot *dq;
> + dnode_t *n;
> + dict_t *dict = qctx->quota_dict[qtype];
> ext2_ino_t qf_ino;
> errcode_t err = 0;
>
> - if (!qctx->quota_dict[qtype])
> + if (!dict)
> goto out;
>
> qf_ino = qtype == USRQUOTA ? fs->super->s_usr_quota_inum :
> @@ -595,6 +599,17 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> log_err("Error scanning dquots");
> goto out;
> }
> +
> + for (n = dict_first(dict); n; n = dict_next(dict, n)) {
> + dq = dnode_get(n);
> + if (!dq)
> + continue;
> + if ((dq->dq_flags & DQF_SEEN) == 0) {
> + fprintf(stderr, "[QUOTA WARNING] "
> + "Missing quota entry ID %d\n", dq->dq_id);
> + scan_data.usage_is_inconsistent = 1;
> + }
> + }
> *usage_inconsistent = scan_data.usage_is_inconsistent;
>
> out:
> diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
> index 1c062f1..55e6eb0 100644
> --- a/lib/quota/quotaio.h
> +++ b/lib/quota/quotaio.h
> @@ -104,6 +104,8 @@ struct dquot {
> struct util_dqblk dq_dqb; /* Parsed data of dquot */
> };
>
> +#define DQF_SEEN 0x0001
> +
> /* Structure of quotafile operations */
> struct quotafile_ops {
> /* Check whether quotafile is in our format */
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> The quota_handle wasn't getting closed in quota_compare_and_update().
> Fix this, and also make sure that quota_file_close() doesn't
> unnecessarily modify the quota inode if it's not necessary. Otherwise
> e2fsck will claim that the file system is modified when it didn't need
> to be.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> lib/quota/mkquota.c | 9 ++++++++-
> lib/quota/quotaio.c | 9 +++++++--
> 2 files changed, 15 insertions(+), 3 deletions(-)
>
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index f5ae0e0..ed10890 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -597,7 +597,7 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> err = qh.qh_ops->scan_dquots(&qh, scan_dquots_callback, &scan_data);
> if (err) {
> log_err("Error scanning dquots");
> - goto out;
> + goto out_close_qh;
> }
>
> for (n = dict_first(dict); n; n = dict_next(dict, n)) {
> @@ -612,6 +612,13 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> }
> *usage_inconsistent = scan_data.usage_is_inconsistent;
>
> +out_close_qh:
> + err = quota_file_close(&qh);
> + if (err) {
> + log_err("Cannot close quotafile: %s", error_message(errno));
> + if (qh.qh_qf.e2_file)
> + ext2fs_file_close(qh.qh_qf.e2_file);
> + }
> out:
> return err;
> }
> diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
> index 7e98ed7..a95a1f9 100644
> --- a/lib/quota/quotaio.c
> +++ b/lib/quota/quotaio.c
> @@ -356,9 +356,14 @@ errcode_t quota_file_close(struct quota_handle *h)
> if (h->qh_ops->end_io && h->qh_ops->end_io(h) < 0)
> return -1;
> if (h->qh_qf.e2_file) {
> + __u64 new_size, size;
> +
> + new_size = compute_inode_size(h->qh_qf.fs, h->qh_qf.ino);
> ext2fs_file_flush(h->qh_qf.e2_file);
> - ext2fs_file_set_size2(h->qh_qf.e2_file,
> - compute_inode_size(h->qh_qf.fs, h->qh_qf.ino));
> + if (ext2fs_file_get_lsize(h->qh_qf.e2_file, &size))
> + new_size = 0;
> + if (size != new_size)
> + ext2fs_file_set_size2(h->qh_qf.e2_file, new_size);
> ext2fs_file_close(h->qh_qf.e2_file);
> }
>
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> There are interfaces that are used by mke2fs.c and tune2fs.c which are
> in quotaio.h, and some future changes will be much simpler if we can
> combine the two header files together. Also the guard #ifdef for
> mkquota.h was incorrect, which caused problems when both header files
> needed to be included.
>
> Also remove quota.pc and installation rules for libquota, since this
> library is never going to be something that we can export externally
> anyway. Eventually we'll want to clean up the interfaces and move the
> external publishable interfaces to the libext2fs library, and then
> rename what's left from libquota.a to libsupport.a for internal use
> only.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> debian/rules | 4 --
> e2fsck/Makefile.in | 186 ++++++++++++++++++++++----------------------------
> e2fsck/e2fsck.h | 2 +-
> e2fsck/quota.c | 1 -
> lib/quota/Makefile.in | 59 ++++------------
> lib/quota/mkquota.c | 1 -
> lib/quota/mkquota.h | 64 -----------------
> lib/quota/quota.pc.in | 11 ---
> lib/quota/quotaio.h | 56 +++++++++++++++
> misc/Makefile.in | 14 ++--
> misc/mke2fs.c | 2 +-
> misc/tune2fs.c | 2 +-
> 12 files changed, 160 insertions(+), 242 deletions(-)
> delete mode 100644 lib/quota/mkquota.h
> delete mode 100644 lib/quota/quota.pc.in
>
> diff --git a/debian/rules b/debian/rules
> index 2f722aa..7e8d01d 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -425,10 +425,6 @@ ifneq ($(BUILD_E2FSCK_STATIC),no)
> cp ${mandir}/man8/e2fsck.8 ${mandir}/man8/e2fsck.static.8
> endif
>
> - # remove static quota library for now
> - rm ${tmpdir}/usr/include/quota/mkquota.h
> - find ${tmpdir} -name quota.pc -o -name libquota.a | xargs rm
> -
> ifeq ($(DEB_BUILD_GNU_SYSTEM), gnu)
> ${INSTALL} -m 0644 misc/mke2fs-hurd.conf ${tmpdir}/etc/mke2fs.conf
> endif
> diff --git a/e2fsck/Makefile.in b/e2fsck/Makefile.in
> index 77017ef..4b10f6f 100644
> --- a/e2fsck/Makefile.in
> +++ b/e2fsck/Makefile.in
> @@ -297,10 +297,9 @@ e2fsck.o: $(srcdir)/e2fsck.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> crc32.o: $(srcdir)/crc32.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -308,10 +307,9 @@ crc32.o: $(srcdir)/crc32.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/crc32defs.h crc32table.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/crc32defs.h crc32table.h
> gen_crc32table.o: $(srcdir)/gen_crc32table.c $(srcdir)/crc32defs.h
> dict.o: $(srcdir)/dict.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/dict.h
> @@ -322,10 +320,9 @@ super.o: $(srcdir)/super.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> pass1.o: $(srcdir)/pass1.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -333,10 +330,9 @@ pass1.o: $(srcdir)/pass1.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> pass1b.o: $(srcdir)/pass1b.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
> $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> @@ -344,10 +340,9 @@ pass1b.o: $(srcdir)/pass1b.c $(top_builddir)/lib/config.h \
> $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h $(srcdir)/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/dict.h
> pass2.o: $(srcdir)/pass2.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -355,10 +350,9 @@ pass2.o: $(srcdir)/pass2.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h $(srcdir)/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/dict.h
> pass3.o: $(srcdir)/pass3.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -366,10 +360,9 @@ pass3.o: $(srcdir)/pass3.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> pass4.o: $(srcdir)/pass4.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -377,10 +370,9 @@ pass4.o: $(srcdir)/pass4.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> pass5.o: $(srcdir)/pass5.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -388,10 +380,9 @@ pass5.o: $(srcdir)/pass5.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -399,11 +390,11 @@ journal.o: $(srcdir)/journal.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/ext2fs/kernel-list.h $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
> + $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h \
> + $(srcdir)/problem.h
> recovery.o: $(srcdir)/recovery.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -411,11 +402,10 @@ recovery.o: $(srcdir)/recovery.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/ext2fs/kernel-list.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
> + $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
> revoke.o: $(srcdir)/revoke.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/jfs_user.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -423,11 +413,10 @@ revoke.o: $(srcdir)/revoke.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/ext2fs/kernel-list.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
> + $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
> badblocks.o: $(srcdir)/badblocks.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
> $(srcdir)/e2fsck.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> @@ -435,9 +424,9 @@ badblocks.o: $(srcdir)/badblocks.c $(top_builddir)/lib/config.h \
> $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -445,9 +434,9 @@ util.o: $(srcdir)/util.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> unix.o: $(srcdir)/unix.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/e2p/e2p.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -455,10 +444,10 @@ unix.o: $(srcdir)/unix.c $(top_builddir)/lib/config.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h $(top_srcdir)/version.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h \
> + $(top_srcdir)/version.h
> dirinfo.o: $(srcdir)/dirinfo.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -466,10 +455,9 @@ dirinfo.o: $(srcdir)/dirinfo.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(top_srcdir)/lib/ext2fs/tdb.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/lib/ext2fs/tdb.h
> dx_dirinfo.o: $(srcdir)/dx_dirinfo.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -477,9 +465,9 @@ dx_dirinfo.o: $(srcdir)/dx_dirinfo.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> ehandler.o: $(srcdir)/ehandler.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -487,9 +475,9 @@ ehandler.o: $(srcdir)/ehandler.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> problem.o: $(srcdir)/problem.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -497,10 +485,9 @@ problem.o: $(srcdir)/problem.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h $(srcdir)/problemP.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h $(srcdir)/problemP.h
> message.o: $(srcdir)/message.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -508,10 +495,9 @@ message.o: $(srcdir)/message.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> ea_refcount.o: $(srcdir)/ea_refcount.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -519,9 +505,9 @@ ea_refcount.o: $(srcdir)/ea_refcount.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> rehash.o: $(srcdir)/rehash.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -529,10 +515,9 @@ rehash.o: $(srcdir)/rehash.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/problem.h
> region.o: $(srcdir)/region.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -540,9 +525,9 @@ region.o: $(srcdir)/region.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> profile.o: $(srcdir)/profile.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/et/com_err.h \
> $(srcdir)/profile.h prof_err.h
> @@ -553,9 +538,9 @@ sigcatcher.o: $(srcdir)/sigcatcher.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> logfile.o: $(srcdir)/logfile.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> @@ -563,18 +548,7 @@ logfile.o: $(srcdir)/logfile.c $(top_builddir)/lib/config.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> + $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> prof_err.o: prof_err.c
> -quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
> - $(top_builddir)/lib/dirpaths.h $(srcdir)/e2fsck.h \
> - $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> - $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
> - $(srcdir)/profile.h prof_err.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/problem.h $(top_srcdir)/lib/quota/quotaio.h
> diff --git a/e2fsck/e2fsck.h b/e2fsck/e2fsck.h
> index 8fc9993..c71a0a5 100644
> --- a/e2fsck/e2fsck.h
> +++ b/e2fsck/e2fsck.h
> @@ -67,7 +67,7 @@
> #define E2FSCK_ATTR(x)
> #endif
>
> -#include "quota/mkquota.h"
> +#include "quota/quotaio.h"
>
> /*
> * Exit codes used by fsck-type programs
> diff --git a/e2fsck/quota.c b/e2fsck/quota.c
> index 42569bb..c6bbb9a 100644
> --- a/e2fsck/quota.c
> +++ b/e2fsck/quota.c
> @@ -15,7 +15,6 @@
>
> #include "e2fsck.h"
> #include "problem.h"
> -#include "quota/mkquota.h"
> #include "quota/quotaio.h"
>
> static void move_quota_inode(ext2_filsys fs, ext2_ino_t from_ino,
> diff --git a/lib/quota/Makefile.in b/lib/quota/Makefile.in
> index dc3eae0..92df268 100644
> --- a/lib/quota/Makefile.in
> +++ b/lib/quota/Makefile.in
> @@ -12,9 +12,6 @@ INSTALL = @INSTALL@
>
> all::
>
> -SMANPAGES=
> -
> -
> OBJS= mkquota.o quotaio.o quotaio_v2.o quotaio_tree.o dict.o
>
> SRCS= $(srcdir)/mkquota.c \
> @@ -53,12 +50,6 @@ LIBDIR= quota
> #ELF_CMT# $(Q) $(CC) $(ALL_CFLAGS) -fPIC -o elfshared/$*.o -c $<
> #BSDLIB_CMT# $(Q) $(CC) $(ALL_CFLAGS) $(BSDLIB_PIC_FLAG) -o pic/$*.o -c $<
>
> -all:: $(SMANPAGES) quota.pc
> -
> -quota.pc: $(srcdir)/quota.pc.in $(top_builddir)/config.status
> - $(E) " CONFIG.STATUS $@"
> - $(Q) cd $(top_builddir); CONFIG_FILES=lib/quota/quota.pc ./config.status
> -
> dict.o:
> $(E) " CC $<"
> $(Q) $(CC) -c $(ALL_CFLAGS) $(top_srcdir)/e2fsck/dict.c -o $@
> @@ -72,32 +63,10 @@ dict.o:
> #BSDLIB_CMT# $(top_srcdir)/e2fsck/dict.c
>
> installdirs::
> - $(E) " MKINSTALLDIRS $(libdir) $(includedir)/quota $(man3dir)"
> - $(Q) $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
> - $(DESTDIR)$(includedir)/quota $(DESTDIR)$(man3dir) \
> - $(DESTDIR)$(pkgconfigdir)
> -
> -install:: all installdirs
> - $(E) " INSTALL_DATA $(libdir)/libquota.a"
> - $(Q) $(INSTALL_DATA) libquota.a $(DESTDIR)$(libdir)/libquota.a
> - -$(Q) $(RANLIB) $(DESTDIR)$(libdir)/libquota.a
> - $(Q) $(CHMOD) $(LIBMODE) $(DESTDIR)$(libdir)/libquota.a
> - $(E) " INSTALL_DATA $(includedir)/quota/mkquota.h"
> - $(Q) $(INSTALL_DATA) $(srcdir)/mkquota.h $(DESTDIR)$(includedir)/quota/mkquota.h
> - $(Q) for i in $(SMANPAGES); do \
> - $(RM) -f $(DESTDIR)$(man3dir)/$$i.gz; \
> - echo " INSTALL_DATA $(man3dir)/$$i"; \
> - $(INSTALL_DATA) $$i $(DESTDIR)$(man3dir)/$$i; \
> - done
> - $(E) " INSTALL_DATA $(pkgconfigdir)/quota.pc"
> - $(Q) $(INSTALL_DATA) quota.pc $(DESTDIR)$(pkgconfigdir)/quota.pc
> +
> +install:: all
>
> uninstall::
> - $(RM) -f $(DESTDIR)$(libdir)/libquota.a \
> - $(DESTDIR)$(pkgconfigdir)/quota.pc
> - for i in $(SMANPAGES); do \
> - $(RM) -f $(DESTDIR)$(man3dir)/$$i; \
> - done
>
> clean::
> $(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
> @@ -108,7 +77,7 @@ clean::
>
> mostlyclean:: clean
> distclean:: clean
> - $(RM) -f .depend Makefile quota.pc \
> + $(RM) -f .depend Makefile \
> $(srcdir)/TAGS $(srcdir)/Makefile.in.old
>
> #
> @@ -132,33 +101,35 @@ mkquota.o: $(srcdir)/mkquota.c $(top_builddir)/lib/config.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/bitops.h \
> $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/quotaio.h $(srcdir)/dqblk_v2.h \
> - $(srcdir)/quotaio_tree.h $(srcdir)/quotaio_v2.h $(srcdir)/mkquota.h \
> - $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/common.h
> + $(srcdir)/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> + $(srcdir)/quotaio_v2.h $(srcdir)/common.h
> quotaio.o: $(srcdir)/quotaio.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio.h \
> - $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
> - $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h
> + $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> quotaio_tree.o: $(srcdir)/quotaio_tree.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio_tree.h \
> - $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
> - $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
> + $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
> - $(srcdir)/dqblk_v2.h
> + $(srcdir)/dqblk_v2.h $(top_srcdir)/lib/../e2fsck/dict.h
> quotaio_v2.o: $(srcdir)/quotaio_v2.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/common.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(srcdir)/quotaio_v2.h \
> - $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
> - $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.h \
> + $(srcdir)/quotaio.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
> - $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h
> + $(srcdir)/dqblk_v2.h $(srcdir)/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h
> dict.o: $(srcdir)/../../e2fsck/dict.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(srcdir)/../../e2fsck/dict.h
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index ed10890..bb8482b 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -18,7 +18,6 @@
> #include "quotaio.h"
> #include "quotaio_v2.h"
> #include "quotaio_tree.h"
> -#include "mkquota.h"
> #include "common.h"
>
> /* Needed for architectures where sizeof(int) != sizeof(void *) */
> diff --git a/lib/quota/mkquota.h b/lib/quota/mkquota.h
> deleted file mode 100644
> index ee15071..0000000
> --- a/lib/quota/mkquota.h
> +++ /dev/null
> @@ -1,64 +0,0 @@
> -/** mkquota.h
> - *
> - * Interface to the quota library.
> - *
> - * The quota library provides interface for creating and updating the quota
> - * files and the ext4 superblock fields. It supports the new VFS_V1 quota
> - * format. The quota library also provides support for keeping track of quotas
> - * in memory.
> - * The typical way to use the quota library is as follows:
> - * {
> - * quota_ctx_t qctx;
> - *
> - * quota_init_context(&qctx, fs, -1);
> - * {
> - * quota_compute_usage(qctx, -1);
> - * AND/OR
> - * quota_data_add/quota_data_sub/quota_data_inodes();
> - * }
> - * quota_write_inode(qctx, USRQUOTA);
> - * quota_write_inode(qctx, GRPQUOTA);
> - * quota_release_context(&qctx);
> - * }
> - *
> - * This initial version does not support reading the quota files. This support
> - * will be added in near future.
> - *
> - * Aditya Kali <[email protected]>
> - */
> -
> -#ifndef __QUOTA_QUOTAIO_H__
> -#define __QUOTA_QUOTAIO_H__
> -
> -#include "ext2fs/ext2_fs.h"
> -#include "ext2fs/ext2fs.h"
> -#include "quotaio.h"
> -#include "../e2fsck/dict.h"
> -
> -typedef struct quota_ctx *quota_ctx_t;
> -
> -struct quota_ctx {
> - ext2_filsys fs;
> - dict_t *quota_dict[MAXQUOTAS];
> -};
> -
> -/* In mkquota.c */
> -errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype);
> -void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> - int adjust);
> -void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> - qsize_t space);
> -void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> - qsize_t space);
> -errcode_t quota_write_inode(quota_ctx_t qctx, int qtype);
> -errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type);
> -errcode_t quota_compute_usage(quota_ctx_t qctx);
> -void quota_release_context(quota_ctx_t *qctx);
> -
> -errcode_t quota_remove_inode(ext2_filsys fs, int qtype);
> -int quota_file_exists(ext2_filsys fs, int qtype, int fmt);
> -void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype);
> -errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> - int *usage_inconsistent);
> -
> -#endif /* __QUOTA_QUOTAIO_H__ */
> diff --git a/lib/quota/quota.pc.in b/lib/quota/quota.pc.in
> deleted file mode 100644
> index 1e4b887..0000000
> --- a/lib/quota/quota.pc.in
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -prefix=@prefix@
> -exec_prefix=@exec_prefix@
> -libdir=@libdir@
> -includedir=@includedir@
> -
> -Name: quota
> -Description: Quota management library
> -Version: @E2FSPROGS_VERSION@
> -Requires:
> -Cflags: -I${includedir}/quota -I${includedir}
> -Libs: -L${libdir} -lquota
> diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
> index 55e6eb0..d3820a4 100644
> --- a/lib/quota/quotaio.h
> +++ b/lib/quota/quotaio.h
> @@ -1,6 +1,32 @@
> /** quotaio.h
> *
> + * Interface to the quota library.
> + *
> + * The quota library provides interface for creating and updating the quota
> + * files and the ext4 superblock fields. It supports the new VFS_V1 quota
> + * format. The quota library also provides support for keeping track of quotas
> + * in memory.
> + * The typical way to use the quota library is as follows:
> + * {
> + * quota_ctx_t qctx;
> + *
> + * quota_init_context(&qctx, fs, -1);
> + * {
> + * quota_compute_usage(qctx, -1);
> + * AND/OR
> + * quota_data_add/quota_data_sub/quota_data_inodes();
> + * }
> + * quota_write_inode(qctx, USRQUOTA);
> + * quota_write_inode(qctx, GRPQUOTA);
> + * quota_release_context(&qctx);
> + * }
> + *
> + * This initial version does not support reading the quota files. This support
> + * will be added in near future.
> + *
> + * Aditya Kali <[email protected]>
> * Header of IO operations for quota utilities
> + *
> * Jan Kara <[email protected]>
> */
>
> @@ -11,8 +37,10 @@
> #include <sys/types.h>
> #include <sys/stat.h>
>
> +#include "ext2fs/ext2_fs.h"
> #include "ext2fs/ext2fs.h"
> #include "dqblk_v2.h"
> +#include "../e2fsck/dict.h"
>
> typedef int64_t qsize_t; /* Type in which we store size limitations */
>
> @@ -20,6 +48,13 @@ typedef int64_t qsize_t; /* Type in which we store size limitations */
> #define USRQUOTA 0
> #define GRPQUOTA 1
>
> +typedef struct quota_ctx *quota_ctx_t;
> +
> +struct quota_ctx {
> + ext2_filsys fs;
> + dict_t *quota_dict[MAXQUOTAS];
> +};
> +
> /*
> * Definitions of magics and versions of current quota files
> */
> @@ -164,4 +199,25 @@ const char *quota_get_qf_name(int type, int fmt, char *buf);
> const char *quota_get_qf_path(const char *mntpt, int qtype, int fmt,
> char *path_buf, size_t path_buf_size);
>
> +/* In mkquota.c */
> +errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype);
> +void quota_data_inodes(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> + int adjust);
> +void quota_data_add(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> + qsize_t space);
> +void quota_data_sub(quota_ctx_t qctx, struct ext2_inode *inode, ext2_ino_t ino,
> + qsize_t space);
> +errcode_t quota_write_inode(quota_ctx_t qctx, int qtype);
> +errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type);
> +errcode_t quota_compute_usage(quota_ctx_t qctx);
> +void quota_release_context(quota_ctx_t *qctx);
> +
> +errcode_t quota_remove_inode(ext2_filsys fs, int qtype);
> +int quota_file_exists(ext2_filsys fs, int qtype, int fmt);
> +void quota_set_sb_inum(ext2_filsys fs, ext2_ino_t ino, int qtype);
> +errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> + int *usage_inconsistent);
> +
> +
> +
> #endif /* GUARD_QUOTAIO_H */
> diff --git a/misc/Makefile.in b/misc/Makefile.in
> index 29b6aab..8d3318b 100644
> --- a/misc/Makefile.in
> +++ b/misc/Makefile.in
> @@ -629,10 +629,9 @@ tune2fs.o: $(srcdir)/tune2fs.c $(top_builddir)/lib/config.h \
> $(top_srcdir)/lib/e2p/e2p.h $(srcdir)/jfs_user.h \
> $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> $(top_srcdir)/lib/ext2fs/kernel-list.h $(srcdir)/util.h \
> - $(top_srcdir)/lib/quota/mkquota.h $(top_srcdir)/lib/quota/quotaio.h \
> - $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> - $(top_srcdir)/lib/../e2fsck/dict.h $(top_srcdir)/version.h \
> - $(srcdir)/nls-enable.h
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> + $(top_srcdir)/version.h $(srcdir)/nls-enable.h
> mklost+found.o: $(srcdir)/mklost+found.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/version.h \
> @@ -646,10 +645,9 @@ mke2fs.o: $(srcdir)/mke2fs.c $(top_builddir)/lib/config.h \
> $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
> $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
> $(srcdir)/util.h profile.h prof_err.h $(top_srcdir)/version.h \
> - $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/mkquota.h \
> - $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> - $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> - $(srcdir)/mke2fs.h
> + $(srcdir)/nls-enable.h $(top_srcdir)/lib/quota/quotaio.h \
> + $(top_srcdir)/lib/quota/dqblk_v2.h $(top_srcdir)/lib/quota/quotaio_tree.h \
> + $(top_srcdir)/lib/../e2fsck/dict.h $(srcdir)/mke2fs.h
> mk_hugefiles.o: $(srcdir)/mk_hugefiles.c $(top_builddir)/lib/config.h \
> $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fsP.h \
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index 51532ef..e1fd40e 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -62,7 +62,7 @@ extern int optind;
> #include "prof_err.h"
> #include "../version.h"
> #include "nls-enable.h"
> -#include "quota/mkquota.h"
> +#include "quota/quotaio.h"
> #include "mke2fs.h"
>
> #define STRIDE_LENGTH 8
> diff --git a/misc/tune2fs.c b/misc/tune2fs.c
> index 7b3723b..37f0b56 100644
> --- a/misc/tune2fs.c
> +++ b/misc/tune2fs.c
> @@ -60,7 +60,7 @@ extern int optind;
> #include "jfs_user.h"
> #include "util.h"
> #include "blkid/blkid.h"
> -#include "quota/mkquota.h"
> +#include "quota/quotaio.h"
>
> #include "../version.h"
> #include "nls-enable.h"
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> This makes memory management easier because when the quota context is
> released, all of the quota file handles get released automatically.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> lib/quota/mkquota.c | 26 ++++++++++++++++---------
> lib/quota/quotaio.c | 55 +++++++++++++++++++++++++++++++++++++++++++----------
> lib/quota/quotaio.h | 6 ++++--
> 3 files changed, 66 insertions(+), 21 deletions(-)
>
> diff --git a/lib/quota/mkquota.c b/lib/quota/mkquota.c
> index bb8482b..58803d0 100644
> --- a/lib/quota/mkquota.c
> +++ b/lib/quota/mkquota.c
> @@ -183,7 +183,7 @@ errcode_t quota_write_inode(quota_ctx_t qctx, int qtype)
> }
>
> write_dquots(dict, h);
> - retval = quota_file_close(h);
> + retval = quota_file_close(qctx, h);
> if (retval < 0) {
> log_err("Cannot finish IO on new quotafile: %s",
> strerror(errno));
> @@ -251,9 +251,10 @@ static void quota_dnode_free(dnode_t *node,
> */
> errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
> {
> - int i, err = 0;
> + errcode_t err;
> dict_t *dict;
> quota_ctx_t ctx;
> + int i;
>
> err = ext2fs_get_mem(sizeof(struct quota_ctx), &ctx);
> if (err) {
> @@ -263,6 +264,7 @@ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
>
> memset(ctx, 0, sizeof(struct quota_ctx));
> for (i = 0; i < MAXQUOTAS; i++) {
> + ctx->quota_file[i] = NULL;
> if ((qtype != -1) && (i != qtype))
> continue;
> err = ext2fs_get_mem(sizeof(dict_t), &dict);
> @@ -283,6 +285,7 @@ errcode_t quota_init_context(quota_ctx_t *qctx, ext2_filsys fs, int qtype)
>
> void quota_release_context(quota_ctx_t *qctx)
> {
> + errcode_t err;
> dict_t *dict;
> int i;
> quota_ctx_t ctx;
> @@ -298,6 +301,14 @@ void quota_release_context(quota_ctx_t *qctx)
> dict_free_nodes(dict);
> free(dict);
> }
> + if (ctx->quota_file[i]) {
> + err = quota_file_close(ctx, ctx->quota_file[i]);
> + if (err) {
> + log_err("Cannot close quotafile: %s",
> + strerror(errno));
> + ext2fs_free_mem(&ctx->quota_file[i]);
> + }
> + }
> }
> *qctx = NULL;
> free(ctx);
> @@ -541,7 +552,7 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type)
> return err;
> }
>
> - err = quota_file_open(qh, qctx->fs, qf_ino, type, -1, 0);
> + err = quota_file_open(qctx, qh, qf_ino, type, -1, 0);
> if (err) {
> log_err("Open quota file failed");
> goto out;
> @@ -549,7 +560,7 @@ errcode_t quota_update_limits(quota_ctx_t qctx, ext2_ino_t qf_ino, int type)
>
> quota_read_all_dquots(qh, qctx, 1);
>
> - err = quota_file_close(qh);
> + err = quota_file_close(qctx, qh);
> if (err) {
> log_err("Cannot finish IO on new quotafile: %s",
> strerror(errno));
> @@ -575,15 +586,12 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> struct dquot *dq;
> dnode_t *n;
> dict_t *dict = qctx->quota_dict[qtype];
> - ext2_ino_t qf_ino;
> errcode_t err = 0;
>
> if (!dict)
> goto out;
>
> - qf_ino = qtype == USRQUOTA ? fs->super->s_usr_quota_inum :
> - fs->super->s_grp_quota_inum;
> - err = quota_file_open(&qh, fs, qf_ino, qtype, -1, 0);
> + err = quota_file_open(qctx, &qh, 0, qtype, -1, 0);
> if (err) {
> log_err("Open quota file failed");
> goto out;
> @@ -612,7 +620,7 @@ errcode_t quota_compare_and_update(quota_ctx_t qctx, int qtype,
> *usage_inconsistent = scan_data.usage_is_inconsistent;
>
> out_close_qh:
> - err = quota_file_close(&qh);
> + err = quota_file_close(qctx, &qh);
> if (err) {
> log_err("Cannot close quotafile: %s", error_message(errno));
> if (qh.qh_qf.e2_file)
> diff --git a/lib/quota/quotaio.c b/lib/quota/quotaio.c
> index a95a1f9..65fccaa 100644
> --- a/lib/quota/quotaio.c
> +++ b/lib/quota/quotaio.c
> @@ -197,11 +197,16 @@ static unsigned int quota_read_nomount(struct quota_file *qf,
> /*
> * Detect quota format and initialize quota IO
> */
> -errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
> +errcode_t quota_file_open(quota_ctx_t qctx, struct quota_handle *h,
> ext2_ino_t qf_ino, int type, int fmt, int flags)
> {
> + ext2_filsys fs = qctx->fs;
> ext2_file_t e2_file;
> errcode_t err;
> + int allocated_handle = 0;
> +
> + if (type >= MAXQUOTAS)
> + return EINVAL;
>
> if (fmt == -1)
> fmt = QFMT_VFS_V1;
> @@ -210,18 +215,42 @@ errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
> if (err)
> return err;
>
> + if (qf_ino == 0) {
> + if (type == USRQUOTA)
> + qf_ino = fs->super->s_usr_quota_inum;
> + else
> + qf_ino = fs->super->s_grp_quota_inum;
> + }
> +
> log_debug("Opening quota ino=%lu, type=%d", qf_ino, type);
> err = ext2fs_file_open(fs, qf_ino, flags, &e2_file);
> if (err) {
> log_err("ext2fs_file_open failed: %s", error_message(err));
> return err;
> }
> - h->qh_qf.e2_file = e2_file;
>
> + if (!h) {
> + if (qctx->quota_file[type]) {
> + h = qctx->quota_file[type];
> + if (((flags & EXT2_FILE_WRITE) == 0) ||
> + (h->qh_file_flags & EXT2_FILE_WRITE))
> + return 0;
> + (void) quota_file_close(qctx, h);
> + }
> + err = ext2fs_get_mem(sizeof(struct quota_handle), &h);
> + if (err) {
> + log_err("Unable to allocate quota handle");
> + return err;
> + }
> + allocated_handle = 1;
> + }
> +
> + h->qh_qf.e2_file = e2_file;
> h->qh_qf.fs = fs;
> h->qh_qf.ino = qf_ino;
> h->e2fs_write = quota_write_nomount;
> h->e2fs_read = quota_read_nomount;
> + h->qh_file_flags = flags;
> h->qh_io_flags = 0;
> h->qh_type = type;
> h->qh_fmt = fmt;
> @@ -231,17 +260,22 @@ errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
> if (h->qh_ops->check_file &&
> (h->qh_ops->check_file(h, type, fmt) == 0)) {
> log_err("qh_ops->check_file failed");
> - ext2fs_file_close(e2_file);
> - return -1;
> + goto errout;
> }
>
> if (h->qh_ops->init_io && (h->qh_ops->init_io(h) < 0)) {
> log_err("qh_ops->init_io failed");
> - ext2fs_file_close(e2_file);
> - return -1;
> + goto errout;
> }
> + if (allocated_handle)
> + qctx->quota_file[type] = h;
>
> return 0;
> +errout:
> + ext2fs_file_close(e2_file);
> + if (allocated_handle)
> + ext2fs_free_mem(&h);
> + return -1;
> }
>
> static errcode_t quota_inode_init_new(ext2_filsys fs, ext2_ino_t ino)
> @@ -307,12 +341,12 @@ errcode_t quota_file_create(struct quota_handle *h, ext2_filsys fs, int type, in
> goto out_err;
> }
> h->qh_qf.ino = qf_inum;
> + h->qh_file_flags = EXT2_FILE_WRITE | EXT2_FILE_CREATE;
> h->e2fs_write = quota_write_nomount;
> h->e2fs_read = quota_read_nomount;
>
> log_debug("Creating quota ino=%lu, type=%d", qf_inum, type);
> - err = ext2fs_file_open(fs, qf_inum,
> - EXT2_FILE_WRITE | EXT2_FILE_CREATE, &e2_file);
> + err = ext2fs_file_open(fs, qf_inum, h->qh_file_flags, &e2_file);
> if (err) {
> log_err("ext2fs_file_open failed: %d", err);
> goto out_err;
> @@ -345,7 +379,7 @@ out_err:
> /*
> * Close quotafile and release handle
> */
> -errcode_t quota_file_close(struct quota_handle *h)
> +errcode_t quota_file_close(quota_ctx_t qctx, struct quota_handle *h)
> {
> if (h->qh_io_flags & IOFL_INFODIRTY) {
> if (h->qh_ops->write_info && h->qh_ops->write_info(h) < 0)
> @@ -366,7 +400,8 @@ errcode_t quota_file_close(struct quota_handle *h)
> ext2fs_file_set_size2(h->qh_qf.e2_file, new_size);
> ext2fs_file_close(h->qh_qf.e2_file);
> }
> -
> + if (qctx->quota_file[h->qh_type] == h)
> + ext2fs_free_mem(&qctx->quota_file[h->qh_type]);
> return 0;
> }
>
> diff --git a/lib/quota/quotaio.h b/lib/quota/quotaio.h
> index d3820a4..7ca7830 100644
> --- a/lib/quota/quotaio.h
> +++ b/lib/quota/quotaio.h
> @@ -53,6 +53,7 @@ typedef struct quota_ctx *quota_ctx_t;
> struct quota_ctx {
> ext2_filsys fs;
> dict_t *quota_dict[MAXQUOTAS];
> + struct quota_handle *quota_file[MAXQUOTAS];
> };
>
> /*
> @@ -105,6 +106,7 @@ struct quota_file {
> struct quota_handle {
> int qh_type; /* Type of quotafile */
> int qh_fmt; /* Quotafile format */
> + int qh_file_flags;
> int qh_io_flags; /* IO flags for file */
> struct quota_file qh_qf;
> unsigned int (*e2fs_read)(struct quota_file *qf, ext2_loff_t offset,
> @@ -171,7 +173,7 @@ extern struct quotafile_ops quotafile_ops_meta;
>
> /* Open existing quotafile of given type (and verify its format) on given
> * filesystem. */
> -errcode_t quota_file_open(struct quota_handle *h, ext2_filsys fs,
> +errcode_t quota_file_open(quota_ctx_t qctx, struct quota_handle *h,
> ext2_ino_t qf_ino, int type, int fmt, int flags);
>
>
> @@ -180,7 +182,7 @@ errcode_t quota_file_create(struct quota_handle *h, ext2_filsys fs,
> int type, int fmt);
>
> /* Close quotafile */
> -errcode_t quota_file_close(struct quota_handle *h);
> +errcode_t quota_file_close(quota_ctx_t qctx, struct quota_handle *h);
>
> /* Get empty quota structure */
> struct dquot *get_empty_dquot(void);
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> This allows us to verify quota information in an ext4 file systems
> with the quota feature.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> debugfs/Makefile.in | 177 ++++++++++++++++++++++++++++++++++-------------
> debugfs/debug_cmds.ct | 6 ++
> debugfs/debugfs.c | 3 +
> debugfs/debugfs.h | 6 ++
> debugfs/quota.c | 170 +++++++++++++++++++++++++++++++++++++++++++++
> debugfs/ro_debug_cmds.ct | 7 +-
> 6 files changed, 319 insertions(+), 50 deletions(-)
> create mode 100644 debugfs/quota.c
>
> diff --git a/debugfs/Makefile.in b/debugfs/Makefile.in
> index 5ddeab7..3dd06f0 100644
> --- a/debugfs/Makefile.in
> +++ b/debugfs/Makefile.in
> @@ -18,25 +18,27 @@ MK_CMDS= _SS_DIR_OVERRIDE=../lib/ss ../lib/ss/mk_cmds
>
> DEBUG_OBJS= debug_cmds.o debugfs.o util.o ncheck.o icheck.o ls.o \
> lsdel.o dump.o set_fields.o logdump.o htree.o unused.o e2freefrag.o \
> - filefrag.o extent_cmds.o extent_inode.o zap.o
> + filefrag.o extent_cmds.o extent_inode.o zap.o quota.o
>
> RO_DEBUG_OBJS= ro_debug_cmds.o ro_debugfs.o util.o ncheck.o icheck.o ls.o \
> lsdel.o logdump.o htree.o e2freefrag.o filefrag.o extent_cmds.o \
> - extent_inode.o
> + extent_inode.o quota.o
>
> SRCS= debug_cmds.c $(srcdir)/debugfs.c $(srcdir)/util.c $(srcdir)/ls.c \
> $(srcdir)/ncheck.c $(srcdir)/icheck.c $(srcdir)/lsdel.c \
> $(srcdir)/dump.c $(srcdir)/set_fields.c ${srcdir}/logdump.c \
> $(srcdir)/htree.c $(srcdir)/unused.c ${srcdir}/../misc/e2freefrag.c \
> - $(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c
> + $(srcdir)/filefrag.c $(srcdir)/extent_inode.c $(srcdir)/zap.c \
> + $(srcdir)/quota.c
>
> -LIBS= $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
> +LIBS= $(LIBQUOTA) $(LIBEXT2FS) $(LIBE2P) $(LIBSS) $(LIBCOM_ERR) $(LIBBLKID) \
> $(LIBUUID) $(SYSLIBS)
> -DEPLIBS= $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
> +DEPLIBS= $(DEPLIBQUOTA) $(LIBEXT2FS) $(LIBE2P) $(DEPLIBSS) $(DEPLIBCOM_ERR) \
> $(DEPLIBBLKID) $(DEPLIBUUID)
>
> -STATIC_LIBS= $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) $(STATIC_LIBCOM_ERR) \
> - $(STATIC_LIBBLKID) $(STATIC_LIBUUID) $(STATIC_LIBE2P) $(SYSLIBS)
> +STATIC_LIBS= $(STATIC_LIBQUOTA) $(STATIC_LIBEXT2FS) $(STATIC_LIBSS) \
> + $(STATIC_LIBCOM_ERR) $(STATIC_LIBBLKID) $(STATIC_LIBUUID) \
> + $(STATIC_LIBE2P) $(SYSLIBS)
> STATIC_DEPLIBS= $(STATIC_LIBEXT2FS) $(DEPSTATIC_LIBSS) \
> $(DEPSTATIC_LIBCOM_ERR) $(DEPSTATIC_LIBUUID) \
> $(DEPSTATIC_LIBE2P)
> @@ -133,76 +135,153 @@ distclean: clean
> #
> debug_cmds.o: debug_cmds.c $(top_srcdir)/lib/ss/ss.h \
> $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h
> -debugfs.o: $(srcdir)/debugfs.c $(top_srcdir)/lib/et/com_err.h \
> - $(top_srcdir)/lib/ss/ss.h $(top_builddir)/lib/ss/ss_err.h \
> +debugfs.o: $(srcdir)/debugfs.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> + $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
> + $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> + $(top_srcdir)/lib/ext2fs/kernel-list.h
> +util.o: $(srcdir)/util.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.h \
> $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> - $(top_srcdir)/lib/e2p/e2p.h $(top_srcdir)/version.h $(srcdir)/jfs_user.h \
> - $(top_srcdir)/lib/ext2fs/kernel-jbd.h $(top_srcdir)/lib/ext2fs/jfs_compat.h \
> - $(top_srcdir)/lib/ext2fs/kernel-list.h
> -util.o: $(srcdir)/util.c $(srcdir)/debugfs.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +ls.o: $(srcdir)/ls.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -ls.o: $(srcdir)/ls.c $(srcdir)/debugfs.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> - $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -ncheck.o: $(srcdir)/ncheck.c $(srcdir)/debugfs.h \
> + $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +ncheck.o: $(srcdir)/ncheck.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -icheck.o: $(srcdir)/icheck.c $(srcdir)/debugfs.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +icheck.o: $(srcdir)/icheck.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -lsdel.o: $(srcdir)/lsdel.c $(srcdir)/debugfs.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +lsdel.o: $(srcdir)/lsdel.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -dump.o: $(srcdir)/dump.c $(srcdir)/debugfs.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +dump.o: $(srcdir)/dump.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h
> -set_fields.o: $(srcdir)/set_fields.c $(srcdir)/debugfs.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +set_fields.o: $(srcdir)/set_fields.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> $(top_srcdir)/lib/e2p/e2p.h
> -logdump.o: $(srcdir)/logdump.c $(srcdir)/debugfs.h \
> +logdump.o: $(srcdir)/logdump.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> $(srcdir)/jfs_user.h $(top_srcdir)/lib/ext2fs/kernel-jbd.h \
> $(top_srcdir)/lib/ext2fs/jfs_compat.h $(top_srcdir)/lib/ext2fs/kernel-list.h
> -htree.o: $(srcdir)/htree.c $(srcdir)/debugfs.h \
> +htree.o: $(srcdir)/htree.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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_io.h $(top_builddir)/lib/ext2fs/ext2_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_ext_attr.h $(top_srcdir)/lib/ext2fs/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h \
> $(top_srcdir)/lib/e2p/e2p.h
> -unused.o: $(srcdir)/unused.c $(srcdir)/debugfs.h \
> +unused.o: $(srcdir)/unused.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +e2freefrag.o: $(srcdir)/../misc/e2freefrag.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(top_srcdir)/lib/ext2fs/ext2_fs.h \
> + $(top_builddir)/lib/ext2fs/ext2_types.h $(top_srcdir)/lib/ext2fs/ext2fs.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/bitops.h \
> + $(srcdir)/../misc/e2freefrag.h
> +filefrag.o: $(srcdir)/filefrag.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +extent_inode.o: $(srcdir)/extent_inode.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +zap.o: $(srcdir)/zap.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> +quota.o: $(srcdir)/quota.c $(top_builddir)/lib/config.h \
> + $(top_builddir)/lib/dirpaths.h $(srcdir)/debugfs.h $(top_srcdir)/lib/ss/ss.h \
> + $(top_builddir)/lib/ss/ss_err.h $(top_srcdir)/lib/et/com_err.h \
> + $(top_srcdir)/lib/ext2fs/ext2_fs.h $(top_builddir)/lib/ext2fs/ext2_types.h \
> + $(top_srcdir)/lib/ext2fs/ext2fs.h $(top_srcdir)/lib/ext2fs/ext3_extents.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/bitops.h \
> + $(top_srcdir)/lib/quota/quotaio.h $(top_srcdir)/lib/quota/dqblk_v2.h \
> + $(top_srcdir)/lib/quota/quotaio_tree.h $(top_srcdir)/lib/../e2fsck/dict.h
> diff --git a/debugfs/debug_cmds.ct b/debugfs/debug_cmds.ct
> index 96ff00f..6a18df6 100644
> --- a/debugfs/debug_cmds.ct
> +++ b/debugfs/debug_cmds.ct
> @@ -190,5 +190,11 @@ request do_zap_block, "Zap block: fill with 0, pattern, flip bits etc.",
> request do_block_dump, "Dump contents of a block",
> block_dump, bd;
>
> +request do_list_quota, "List quota",
> + list_quota, lq;
> +
> +request do_get_quota, "Get quota",
> + get_quota, gq;
> +
> end;
>
> diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
> index 0e56ead..326f41e 100644
> --- a/debugfs/debugfs.c
> +++ b/debugfs/debugfs.c
> @@ -56,6 +56,7 @@ const char *debug_prog_name;
> int sci_idx;
>
> ext2_filsys current_fs = NULL;
> +quota_ctx_t current_qctx;
> ext2_ino_t root, cwd;
>
> static void open_filesystem(char *device, int open_flags, blk64_t superblock,
> @@ -238,6 +239,8 @@ static void close_filesystem(NOARGS)
> if (retval)
> com_err("ext2fs_write_block_bitmap", retval, 0);
> }
> + if (current_qctx)
> + quota_release_context(¤t_qctx);
> retval = ext2fs_close(current_fs);
> if (retval)
> com_err("ext2fs_close", retval, 0);
> diff --git a/debugfs/debugfs.h b/debugfs/debugfs.h
> index 33389fa..9b67f69 100644
> --- a/debugfs/debugfs.h
> +++ b/debugfs/debugfs.h
> @@ -5,6 +5,7 @@
> #include "ss/ss.h"
> #include "ext2fs/ext2_fs.h"
> #include "ext2fs/ext2fs.h"
> +#include "quota/quotaio.h"
>
> #ifdef __STDC__
> #define NOARGS void
> @@ -21,6 +22,7 @@
> #define CHECK_FS_NOTOPEN 0x0004
>
> extern ext2_filsys current_fs;
> +extern quota_ctx_t current_qctx;
> extern ext2_ino_t root, cwd;
> extern int sci_idx;
> extern ss_request_table debug_cmds, extent_cmds;
> @@ -171,6 +173,10 @@ extern void do_set_mmp_value(int argc, char **argv);
> extern void do_freefrag(int argc, char **argv);
> extern void do_filefrag(int argc, char *argv[]);
>
> +/* quota.c */
> +extern void do_list_quota(int argc, char *argv[]);
> +extern void do_get_quota(int argc, char *argv[]);
> +
> /* util.c */
> extern time_t string_to_time(const char *arg);
>
> diff --git a/debugfs/quota.c b/debugfs/quota.c
> new file mode 100644
> index 0000000..cbf237a
> --- /dev/null
> +++ b/debugfs/quota.c
> @@ -0,0 +1,170 @@
> +/*
> + * quota.c --- debugfs quota commands
> + *
> + * Copyright (C) 2014 Theodore Ts'o. This file may be redistributed
> + * under the terms of the GNU Public License.
> + */
> +
> +#include "config.h"
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <stdlib.h>
> +#include <ctype.h>
> +#include <string.h>
> +#include <time.h>
> +#ifdef HAVE_ERRNO_H
> +#include <errno.h>
> +#endif
> +#include <sys/types.h>
> +#ifdef HAVE_GETOPT_H
> +#include <getopt.h>
> +#else
> +extern int optind;
> +extern char *optarg;
> +#endif
> +
> +#include "debugfs.h"
> +
> +const char *quota_type[] = { "user", "group", NULL };
> +
> +static int load_quota_ctx(char *progname)
> +{
> + errcode_t retval;
> +
> + if (check_fs_open(progname))
> + return 1;
> +
> + if (!EXT2_HAS_RO_COMPAT_FEATURE(current_fs->super,
> + EXT4_FEATURE_RO_COMPAT_QUOTA)) {
> + com_err(progname, 0, "quota feature not eanbled");
> + return 1;
> + }
> +
> + if (current_qctx)
> + return 0;
> +
> + retval = quota_init_context(¤t_qctx, current_fs, -1);
> + if (retval) {
> + com_err(current_fs->device_name, retval,
> + "while trying to load quota information");
> + return 1;
> + }
> + return 0;
> +}
> +
> +static int parse_quota_type(const char *cmdname, const char *str)
> +{
> + errcode_t retval;
> + char *t;
> + int flags = 0;
> + int i;
> +
> + for (i = 0; i < MAXQUOTAS; i++) {
> + if (strcasecmp(str, quota_type[i]) == 0)
> + break;
> + }
> + if (i >= MAXQUOTAS) {
> + i = strtol(str, &t, 0);
> + if (*t)
> + i = -1;
> + }
> + if (i < 0 || i >= MAXQUOTAS) {
> + com_err(0, 0, "Invalid quota type: %s", str);
> + printf("Valid quota types are: ");
> + for (i = 0; i < MAXQUOTAS; i++)
> + printf("%s ", quota_type[i]);
> + printf("\n");
> + return -1;
> + }
> +
> + if (current_fs->flags & EXT2_FLAG_RW)
> + flags |= EXT2_FILE_WRITE;
> +
> + retval = quota_file_open(current_qctx, NULL, 0, i, -1, flags);
> + if (retval) {
> + com_err(cmdname, retval,
> + "while opening quota inode (type %d)", i);
> + return -1;
> + }
> + return i;
> +}
> +
> +
> +static int list_quota_callback(struct dquot *dq, void *cb_data)
> +{
> + printf("%8u %8lld %8lld %8lld %8lld %8lld %8lld\n",
> + dq->dq_id, dq->dq_dqb.dqb_curspace,
> + dq->dq_dqb.dqb_bsoftlimit, dq->dq_dqb.dqb_bhardlimit,
> + dq->dq_dqb.dqb_curinodes,
> + dq->dq_dqb.dqb_isoftlimit, dq->dq_dqb.dqb_ihardlimit);
> +}
> +
> +void do_list_quota(int argc, char *argv[])
> +{
> + errcode_t retval;
> + int i, type;
> + int flags = 0;
> + struct quota_handle *qh;
> +
> + if (load_quota_ctx(argv[0]))
> + return;
> +
> + if (argc != 2) {
> + com_err(0, 0, "Usage: list_quota <quota_type>\n");
> + return;
> + }
> +
> + type = parse_quota_type(argv[0], argv[1]);
> + if (type < 0)
> + return;
> +
> + printf("%8s %8s %8s %8s %8s %8s %8s\n",
> + (type == 0) ? "user id" : "group id",
> + "blocks", "quota", "limit", "inodes", "quota", "limit");
> + qh = current_qctx->quota_file[type];
> + retval = qh->qh_ops->scan_dquots(qh, list_quota_callback, NULL);
> + if (retval) {
> + com_err(argv[0], retval, "while scanning dquots");
> + return;
> + }
> +}
> +
> +void do_get_quota(int argc, char *argv[])
> +{
> + errcode_t retval;
> + int i, err, type;
> + int flags = 0;
> + struct quota_handle *qh;
> + struct dquot *dq;
> + qid_t id;
> +
> + if (load_quota_ctx(argv[0]))
> + return;
> +
> + if (argc != 3) {
> + com_err(0, 0, "Usage: get_quota <quota_type> <id>\n");
> + return;
> + }
> +
> + type = parse_quota_type(argv[0], argv[1]);
> + if (type < 0)
> + return;
> +
> + id = parse_ulong(argv[2], argv[0], "id", &err);
> + if (err)
> + return;
> +
> + printf("%8s %8s %8s %8s %8s %8s %8s\n",
> + (type == 0) ? "user id" : "group id",
> + "blocks", "quota", "limit", "inodes", "quota", "limit");
> +
> + qh = current_qctx->quota_file[type];
> +
> + dq = qh->qh_ops->read_dquot(qh, id);
> + if (dq) {
> + list_quota_callback(dq, NULL);
> + ext2fs_free_mem(&dq);
> + } else
> + com_err(argv[0], 0, "couldn't read quota record");
> +
> +}
> diff --git a/debugfs/ro_debug_cmds.ct b/debugfs/ro_debug_cmds.ct
> index 8226d1a..736ade6 100644
> --- a/debugfs/ro_debug_cmds.ct
> +++ b/debugfs/ro_debug_cmds.ct
> @@ -90,5 +90,10 @@ request do_dump_mmp, "Dump MMP information",
> request do_extent_open, "Open inode for extent manipulation",
> extent_open, eo;
>
> -end;
> +request do_list_quota, "List quota",
> + lost_quota, lq;
> +
> +request do_get_quota, "Get quota",
> + get_quota, gq;
>
> +end;
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> tests/f_quota/debugfs-cmds | 7 +++++++
> tests/f_quota/expect.0 | 21 +++++++++++++++++++++
> tests/f_quota/expect.1 | 13 +++++++++++++
> tests/f_quota/expect.2 | 7 +++++++
> tests/f_quota/image.gz | Bin 0 -> 1046 bytes
> tests/f_quota/name | 1 +
> tests/f_quota/script | 4 ++++
> 7 files changed, 53 insertions(+)
> create mode 100644 tests/f_quota/debugfs-cmds
> create mode 100644 tests/f_quota/expect.0
> create mode 100644 tests/f_quota/expect.1
> create mode 100644 tests/f_quota/expect.2
> create mode 100644 tests/f_quota/image.gz
> create mode 100644 tests/f_quota/name
> create mode 100644 tests/f_quota/script
>
> diff --git a/tests/f_quota/debugfs-cmds b/tests/f_quota/debugfs-cmds
> new file mode 100644
> index 0000000..112a3ff
> --- /dev/null
> +++ b/tests/f_quota/debugfs-cmds
> @@ -0,0 +1,7 @@
> +list_quota user
> +list_quota group
> +get_quota user 0
> +get_quota user 100
> +get_quota user 34
> +get_quota group 0
> +
> diff --git a/tests/f_quota/expect.0 b/tests/f_quota/expect.0
> new file mode 100644
> index 0000000..c0ad63d
> --- /dev/null
> +++ b/tests/f_quota/expect.0
> @@ -0,0 +1,21 @@
> +debugfs: list_quota user
> + user id blocks quota limit inodes quota limit
> + 0 13312 0 0 2 0 0
> + 34 1024 0 0 1 0 0
> + 100 2048 32 50 2 20 30
> +debugfs: list_quota group
> +group id blocks quota limit inodes quota limit
> + 0 16384 0 0 5 0 0
> +debugfs: get_quota user 0
> + user id blocks quota limit inodes quota limit
> + 0 13312 0 0 2 0 0
> +debugfs: get_quota user 100
> + user id blocks quota limit inodes quota limit
> + 100 2048 32 50 2 20 30
> +debugfs: get_quota user 34
> + user id blocks quota limit inodes quota limit
> + 34 1024 0 0 1 0 0
> +debugfs: get_quota group 0
> +group id blocks quota limit inodes quota limit
> + 0 16384 0 0 5 0 0
> +debugfs:
> diff --git a/tests/f_quota/expect.1 b/tests/f_quota/expect.1
> new file mode 100644
> index 0000000..0b3b4cf
> --- /dev/null
> +++ b/tests/f_quota/expect.1
> @@ -0,0 +1,13 @@
> +Pass 1: Checking inodes, blocks, and sizes
> +Pass 2: Checking directory structure
> +Pass 3: Checking directory connectivity
> +Pass 4: Checking reference counts
> +Pass 5: Checking group summary information
> +[QUOTA WARNING] Usage inconsistent for ID 0:actual (13312, 2) != expected (14336, 3)
> +[QUOTA WARNING] Usage inconsistent for ID 100:actual (2048, 2) != expected (1024, 1)
> +Update quota info for quota type 0? yes
> +
> +
> +test_filesys: ***** FILE SYSTEM WAS MODIFIED *****
> +test_filesys: 14/16 files (14.3% non-contiguous), 36/100 blocks
> +Exit status is 1
> diff --git a/tests/f_quota/expect.2 b/tests/f_quota/expect.2
> new file mode 100644
> index 0000000..bfc558d
> --- /dev/null
> +++ b/tests/f_quota/expect.2
> @@ -0,0 +1,7 @@
> +Pass 1: Checking inodes, blocks, and sizes
> +Pass 2: Checking directory structure
> +Pass 3: Checking directory connectivity
> +Pass 4: Checking reference counts
> +Pass 5: Checking group summary information
> +test_filesys: 14/16 files (14.3% non-contiguous), 36/100 blocks
> +Exit status is 0
> diff --git a/tests/f_quota/image.gz b/tests/f_quota/image.gz
> new file mode 100644
> index 0000000000000000000000000000000000000000..9cea6556e941fb0e3fb2bf09a29895ca246cad50
> GIT binary patch
> literal 1046
> zc-o!F{WF^f0KoBdZspF1-D*lrSk+5+=nz^>MD?0oJL0vO3C%`l6v@;wr3l-3tD%~?
> zzGRWMMx?1^&PXhr%sb7Cmj-$B49Sp)h}T6l&vyG0_PzW3@`csfKw9?*32#~HRWX@3
> zk}G7(Gj~kbmczDY#KKO6Eue#tb%hIIj*ow|o40q~c;Lm+%?A5U)Z)IZ(z}mu`9vY_
> z%(UEzKYq`?uX<Tj`=`q8T`0!k(sBS<D~Bu2Qq!};>D&73?b1R3|1Veohm+-H_0EfE
> zk4X=7q^nJ%ZDXq3U5n<c)?m_!hDdc_$DEod!|)5(SZ^n)e>mZCb-u@b<@u8#JO^xX
> zaTWlG==RYiCMkYIf+uTgPMPB#vD(0c{1WpN)zA;BhBeR`nlTiAv!UC}@8l8=nskyC
> z!sLE0k%#opz6m;OkuW#qJn_?NJ?&6Z!O?Lt{CAG#(Kd5zEUO#LF|49+0{010eR)@}
> zaj_E|jq(o-Uqn{IMC$ye<kKp6LN@l5DqU0ecxfZW&kv<6G@N@7?NXQFT3YHk-1>~9
> zQb-<swsh&&rOLyBkk=jLFCxyDTWMjjVA-MdYt&QAu{~%zIpWQK3nD1V-Jv`r=aA7O
> zy(Li6^W0RTs(Ps$-q8&J5kpU10^j~Vfh-U>PeVD@Rz#V(jGNqnW8-fTLB4|S`?IaW
> zS*LQ-`#GVY2eQS$-$mu)J=9%qUD@%?B(Z})An%kKKtUerTxMTt<sX`pu%x1Jq++$$
> z9KBj&HEQpcC<d({5Qsp|HD4p${&@4NMZ9+)t=3_*l!+m%Unvm98kFioG5ned=z7Jz
> zKAy2D?zUYOR}mZb?pkDG@FH+x`|B`M6;@6DjVt^vbb6i07p);D2S`^foo7ri?nRJm
> z1cDGs;*nuj`FF<9U4XA_ChzaE22vPpLEs#)ZDOQS3s&ScP|3rf^k-!Om3=@JkCz7G
> z0H&dI2S{KEjT2mh<r~(KVrY9%s#T}G3;}0Z!U5feBmh8wJs8V=AIy&m66xfzvpa^P
> zjX}o#u4Ox+D=!$&p}lZgb%~4jyZ%JObERQsWIlGR8`TU-8oX$I+&H-OiyZMD{C$@!
> zgp;E#FF2uLr9F;%HKqzD(I`YKK_l@lO%!x;OdB;To`udzf#RB((iUFQlT@Kp7IA^_
> zQzZX>0JEn{L%DUK@U(AeZBwQfb69VGr6Qx{My9ZGzv6aB;=<=X(!ZRv6HM8+2s(bc
> zKR(wV@pAS}%@34MpfGxoajRx+e0oh<lRoBEA4OaEptZYQAq{4?nM_mtp3#?KZBEaZ
> zkBZOuIx;@WOZ07alPFM03harg?7Wu7;R<woJqFuCY3lnBvIm9y{{-%b)+I!f5pw?+
> F<R3nT9HRgL
>
> literal 0
> Hc-jL100001
>
> diff --git a/tests/f_quota/name b/tests/f_quota/name
> new file mode 100644
> index 0000000..27ea8ba
> --- /dev/null
> +++ b/tests/f_quota/name
> @@ -0,0 +1 @@
> +fix incorrect usage stats in quota
> diff --git a/tests/f_quota/script b/tests/f_quota/script
> new file mode 100644
> index 0000000..bf25e07
> --- /dev/null
> +++ b/tests/f_quota/script
> @@ -0,0 +1,4 @@
> +AFTER_CMD='$DEBUGFS -f $test_dir/debugfs-cmds $TMPFILE 2>&1 | sed -f $cmd_dir/filter.sed > $test_name.0.log'
> +PASS_ZERO=true
> +
> +. $cmd_dir/run_e2fsck
> --
> 1.9.0
>
--
Aditya
On Sat, May 10, 2014 at 9:32 PM, Theodore Ts'o <[email protected]> wrote:
> We no longer need to reference https://ext4.wiki.kernel.org/index.php/Quota
> since we've fixed the nasty bugs associated with e2fsck and the quota
> feature. The wiki page will be updated once we've done a release that
> includes these fixes indicated the verison which these problems have
> been fixed.
>
> Signed-off-by: "Theodore Ts'o" <[email protected]>
> Cc: [email protected]
Reviewed-by: Aditya Kali <[email protected]>
Thanks!
> ---
> misc/ext4.5.in | 7 -------
> misc/mke2fs.c | 7 -------
> misc/tune2fs.c | 4 ----
> tests/m_quota/expect.1 | 4 ----
> 4 files changed, 22 deletions(-)
>
> diff --git a/misc/ext4.5.in b/misc/ext4.5.in
> index 5ec39f5..134c19f 100644
> --- a/misc/ext4.5.in
> +++ b/misc/ext4.5.in
> @@ -210,13 +210,6 @@ shared storage environments.
> @QUOTA_MAN_COMMENT@Causes the quota files (i.e., user.quota and
> @[email protected] which existed
> @QUOTA_MAN_COMMENT@in the older quota design) to be hidden inodes.
> -@[email protected]
> -@[email protected] Warning:
> -@QUOTA_MAN_COMMENT@The quota feature is still under development,
> -@QUOTA_MAN_COMMENT@and may not be fully supported with your kernel
> -@QUOTA_MAN_COMMENT@or may have various bugs. Please
> -@QUOTA_MAN_COMMENT@see https://ext4.wiki.kernel.org/index.php/Quota
> -@QUOTA_MAN_COMMENT@for more details.
> .TP
> .B resize_inode
> .br
> diff --git a/misc/mke2fs.c b/misc/mke2fs.c
> index e1fd40e..9c4b0b2 100644
> --- a/misc/mke2fs.c
> +++ b/misc/mke2fs.c
> @@ -2162,13 +2162,6 @@ profile_error:
> "See https://ext4.wiki.kernel.org/"
> "index.php/Bigalloc for more information\n\n"));
>
> - if (!quiet &&
> - (fs_param.s_feature_ro_compat & EXT4_FEATURE_RO_COMPAT_QUOTA))
> - fprintf(stderr, "%s", _("\nWarning: the quota feature is "
> - "still under development\n"
> - "See https://ext4.wiki.kernel.org/"
> - "index.php/Quota for more information\n\n"));
> -
> /* Since sparse_super is the default, we would only have a problem
> * here if it was explicitly disabled.
> */
> diff --git a/misc/tune2fs.c b/misc/tune2fs.c
> index 37f0b56..9ba32a1 100644
> --- a/misc/tune2fs.c
> +++ b/misc/tune2fs.c
> @@ -776,10 +776,6 @@ static void handle_quota_options(ext2_filsys fs)
> quota_release_context(&qctx);
>
> if ((usrquota == QOPT_ENABLE) || (grpquota == QOPT_ENABLE)) {
> - fprintf(stderr, "%s", _("\nWarning: the quota feature is still "
> - "under development\n"
> - "See https://ext4.wiki.kernel.org/"
> - "index.php/Quota for more information\n\n"));
> fs->super->s_feature_ro_compat |= EXT4_FEATURE_RO_COMPAT_QUOTA;
> ext2fs_mark_super_dirty(fs);
> } else if (!fs->super->s_usr_quota_inum &&
> diff --git a/tests/m_quota/expect.1 b/tests/m_quota/expect.1
> index a0f6501..787871c 100644
> --- a/tests/m_quota/expect.1
> +++ b/tests/m_quota/expect.1
> @@ -1,7 +1,3 @@
> -
> -Warning: the quota feature is still under development
> -See https://ext4.wiki.kernel.org/index.php/Quota for more information
> -
> Creating filesystem with 131072 1k blocks and 32768 inodes
> Superblock backups stored on blocks:
> 8193, 24577, 40961, 57345, 73729
> --
> 1.9.0
>
--
Aditya