diff options
-rw-r--r-- | Changelog | 2 | ||||
-rw-r--r-- | common.h | 2 | ||||
-rw-r--r-- | rquota_client.c | 22 | ||||
-rw-r--r-- | rquota_server.c | 6 |
4 files changed, 9 insertions, 23 deletions
@@ -1,4 +1,6 @@ Changes in quota-tools from 3.17 to 4.00-pre1 +* convert quota limits using rq_bsize from RPC request (Jan Kara) +* added noreturn attribute to die to avoid false warnings (Jan Kara) * 64-bit quota support, rewritten some code to allow clean integration (Jan Kara) * 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) @@ -19,7 +19,7 @@ extern char *progname; /* Finish programs being */ -void die(int, char *, ...) __attribute__ ((__format__ (__printf__, 2, 3))); +void __attribute ((noreturn)) die(int, char *, ...) __attribute__ ((__format__ (__printf__, 2, 3))); /* Print an error */ void errstr(char *, ...) __attribute__ ((__format__ (__printf__, 1, 2))); diff --git a/rquota_client.c b/rquota_client.c index 883df40..c2e3ed3 100644 --- a/rquota_client.c +++ b/rquota_client.c @@ -9,7 +9,7 @@ * * This part does the rpc-communication with the rquotad. * - * Version: $Id: rquota_client.c,v 1.11 2007/08/23 19:58:14 jkar8572 Exp $ + * Version: $Id: rquota_client.c,v 1.12 2009/12/14 22:27:33 jkar8572 Exp $ * * Author: Marco van Wieringen <mvw@planets.elm.net> * @@ -45,8 +45,8 @@ static inline void clinet2utildqblk(struct util_dqblk *u, struct rquota *n) time_t now; /* Copy the quota */ - u->dqb_bhardlimit = n->rq_bhardlimit; - u->dqb_bsoftlimit = n->rq_bsoftlimit; + u->dqb_bhardlimit = toqb(((qsize_t)n->rq_bhardlimit) * n->rq_bsize); + u->dqb_bsoftlimit = toqb(((qsize_t)n->rq_bsoftlimit) * n->rq_bsize); u->dqb_ihardlimit = n->rq_fhardlimit; u->dqb_isoftlimit = n->rq_fsoftlimit; u->dqb_curinodes = n->rq_curfiles; @@ -60,22 +60,6 @@ static inline void clinet2utildqblk(struct util_dqblk *u, struct rquota *n) u->dqb_itime = n->rq_ftimeleft + now; else u->dqb_itime = 0; - /* Convert from remote block size */ - if (n->rq_bsize != RPC_DQBLK_SIZE) { - int conversion_unit; - - conversion_unit = n->rq_bsize >> RPC_DQBLK_SIZE_BITS; - if (conversion_unit == 0) { - conversion_unit = RPC_DQBLK_SIZE / n->rq_bsize; - - u->dqb_bhardlimit /= conversion_unit; - u->dqb_bsoftlimit /= conversion_unit; - } - else { - u->dqb_bhardlimit *= conversion_unit; - u->dqb_bsoftlimit *= conversion_unit; - } - } } /* Convert utils format of quotas to network one */ diff --git a/rquota_server.c b/rquota_server.c index ae45da3..21d3176 100644 --- a/rquota_server.c +++ b/rquota_server.c @@ -9,7 +9,7 @@ * * This part does the lookup of the info. * - * Version: $Id: rquota_server.c,v 1.20 2009/09/21 15:14:48 jkar8572 Exp $ + * Version: $Id: rquota_server.c,v 1.21 2009/12/14 22:27:33 jkar8572 Exp $ * * Author: Marco van Wieringen <mvw@planets.elm.net> * @@ -95,8 +95,8 @@ static inline void servutil2netdqblk(struct rquota *n, struct util_dqblk *u) time_t now; time(&now); - n->rq_bhardlimit = u->dqb_bhardlimit; - n->rq_bsoftlimit = u->dqb_bsoftlimit; + n->rq_bhardlimit = (u->dqb_bhardlimit << QUOTABLOCK_BITS) >> RPC_DQBLK_SIZE_BITS; + n->rq_bsoftlimit = (u->dqb_bsoftlimit << QUOTABLOCK_BITS) >> RPC_DQBLK_SIZE_BITS; n->rq_fhardlimit = u->dqb_ihardlimit; n->rq_fsoftlimit = u->dqb_isoftlimit; n->rq_curblocks = (u->dqb_curspace + RPC_DQBLK_SIZE - 1) >> RPC_DQBLK_SIZE_BITS; |