View | Details | Raw Unified | Return to bug 221697 | Differences between
and this patch

Collapse All | Expand All

(-)quota.c (-6 / +23 lines)
Lines 563-568 Link Here
563
	return (1);
563
	return (1);
564
}
564
}
565
565
566
static uint32_t
567
scalenfsquota(uint32_t bsize, uint32_t value)
568
{
569
	uint32_t retval = 0L;
570
571
	if (bsize == 0L)
572
		return(retval);
573
574
	if (bsize > DEV_BSIZE)
575
	{
576
		retval = value * (bsize / DEV_BSIZE);
577
	}
578
	else
579
	{
580
		retval = value / (DEV_BSIZE / bsize);
581
	}
582
583
	return(retval);
584
}
585
566
static int
586
static int
567
getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype)
587
getnfsquota(struct statfs *fst, struct quotause *qup, long id, int quotatype)
568
{
588
{
Lines 619-632 Link Here
619
		gettimeofday(&tv, NULL);
639
		gettimeofday(&tv, NULL);
620
			/* blocks*/
640
			/* blocks*/
621
		dqp->dqb_bhardlimit =
641
		dqp->dqb_bhardlimit =
622
		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit *
642
			scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_bhardlimit);
623
		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
624
		dqp->dqb_bsoftlimit =
643
		dqp->dqb_bsoftlimit =
625
		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit *
644
			scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsoftlimit);
626
		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
627
		dqp->dqb_curblocks =
645
		dqp->dqb_curblocks =
628
		    gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks *
646
			scalenfsquota(gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize, gq_rslt.getquota_rslt_u.gqr_rquota.rq_curblocks);
629
		    (gq_rslt.getquota_rslt_u.gqr_rquota.rq_bsize / DEV_BSIZE);
630
			/* inodes */
647
			/* inodes */
631
		dqp->dqb_ihardlimit =
648
		dqp->dqb_ihardlimit =
632
			gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;
649
			gq_rslt.getquota_rslt_u.gqr_rquota.rq_fhardlimit;

Return to bug 221697