* the containing directory.
* %r <blkcount> interpret blkcount as refcount
* %s <str> miscellaneous string
+ * %t time (in <num>)
+ * %T current time
+ * %U quota type (in <num>)
* %S backup superblock
* %X <num> hexadecimal format
*
#include <string.h>
#include <ctype.h>
#include <termios.h>
+#include "support/quotaio.h"
#include "e2fsck.h"
-
#include "problem.h"
#ifdef __GNUC__
case 'T':
print_time(f, e2fsck_ctx ? e2fsck_ctx->now : time(0));
break;
+ case 'U':
+ switch (ctx->num) {
+ case USRQUOTA:
+ m = _("user");
+ break;
+ case GRPQUOTA:
+ m = _("group");
+ break;
+ case PRJQUOTA:
+ m = _("group");
+ break;
+ default:
+ m = _("unknown quota type");
+ break;
+ }
+ if (*first && islower(m[0]))
+ fputc(toupper(*m++), f);
+ fputs(m, f);
+ if (ctx->num > PRJQUOTA)
+ fprintf(f, " %d", (int) ctx->num);
+ break;
case 'x':
fprintf(f, "0x%0*x", width, ctx->csum1);
break;
/* Making quota inode hidden */
{ PR_0_HIDE_QUOTA,
- N_("Making @q @i %i (%Q) hidden.\n"),
+ N_("Hiding %U @q @i %i (%Q).\n"),
PROMPT_NONE, PR_PREEN_OK },
/* Superblock has invalid MMP block. */
return;
for (qtype = 0; qtype < MAXQUOTAS; qtype++) {
+ pctx.dir = 2; /* This is a guess, but it's a good one */
pctx.ino = *quota_sb_inump(sb, qtype);
+ pctx.num = qtype;
quota_ino = quota_type2inum(qtype, fs->super);
if (pctx.ino && (pctx.ino != quota_ino) &&
fix_problem(ctx, PR_0_HIDE_QUOTA, &pctx)) {