diff options
author | jkar8572 <jkar8572> | 2009-10-20 01:15:39 +0000 |
---|---|---|
committer | jkar8572 <jkar8572> | 2009-10-20 01:15:39 +0000 |
commit | fafc3de3d0a002e8e1a02df12f2788602de6bb60 (patch) | |
tree | dd490d1d8dd58af3349babdb3a86c0480379e723 | |
parent | 5244d768e5f9f4b245ca269ecc976cbc7aaba266 (diff) |
Improved header of quota and repquota headers in case -s option is used.
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | quota.c | 11 | ||||
-rw-r--r-- | quotasys.c | 5 | ||||
-rw-r--r-- | repquota.c | 8 |
4 files changed, 21 insertions, 4 deletions
@@ -1,4 +1,5 @@ Changes in quota-tools from 3.16 to 3.18 +* Improved header of quota an repquota output when -s option is used (Jan Kara) * Fixed mountpoint scanning when NFS mountpoint is specified on command line (Jan Kara) * Updated manpage of quotactl(2) (Jan Kara) @@ -34,7 +34,7 @@ #ident "$Copyright: (c) 1980, 1990 Regents of the University of California. $" #ident "$Copyright: All rights reserved. $" -#ident "$Id: quota.c,v 1.27 2008/04/21 15:37:42 jkar8572 Exp $" +#ident "$Id: quota.c,v 1.28 2009/10/20 01:15:39 jkar8572 Exp $" /* * Disk quota reporting program. @@ -112,11 +112,18 @@ void usage(void) void heading(int type, qid_t id, char *name, char *tag) { + char *spacehdr; + + if (flags & FL_SMARTSIZE) + spacehdr = _("space"); + else + spacehdr = _("blocks"); + printf(_("Disk quotas for %s %s (%cid %u): %s\n"), type2name(type), name, *type2name(type), (uint) id, tag); if (!(flags & FL_QUIET) && !tag[0]) { printf("%15s%8s %7s%8s%8s%8s %7s%8s%8s\n", _("Filesystem"), - _("blocks"), _("quota"), _("limit"), _("grace"), + spacehdr,_("quota"), _("limit"), _("grace"), _("files"), _("quota"), _("limit"), _("grace")); } } @@ -379,12 +379,15 @@ void space2str(qsize_t space, char *buf, int format) char suffix[8] = " MGT"; space = qb2kb(space); - if (format) + if (format) { for (i = 3; i > 0; i--) if (space >= (1LL << (QUOTABLOCK_BITS*i))*100) { sprintf(buf, "%llu%c", (unsigned long long)(space+(1 << (QUOTABLOCK_BITS*i))-1) >> (QUOTABLOCK_BITS*i), suffix[i]); return; } + sprintf(buf, "%lluK", (unsigned long long)space); + return; + } sprintf(buf, "%llu", (unsigned long long)space); } @@ -284,12 +284,18 @@ static int output(struct dquot *dquot, char *name) static void report_it(struct quota_handle *h, int type) { char bgbuf[MAXTIMELEN], igbuf[MAXTIMELEN]; + char *spacehdr; + + if (flags & FL_SHORTNUMS) + spacehdr = _("Space"); + else + spacehdr = _("Block"); printf(_("*** Report for %s quotas on device %s\n"), type2name(type), h->qh_quotadev); time2str(h->qh_info.dqi_bgrace, bgbuf, TF_ROUND); time2str(h->qh_info.dqi_igrace, igbuf, TF_ROUND); printf(_("Block grace time: %s; Inode grace time: %s\n"), bgbuf, igbuf); - printf(_(" Block limits File limits\n")); + printf(_(" %s limits File limits\n"), spacehdr); printf(_("%-9s used soft hard grace used soft hard grace\n"), (type == USRQUOTA)?_("User"):_("Group")); printf("----------------------------------------------------------------------\n"); |