303 
 304         zq->dqb_bhardlimit = userquota / DEV_BSIZE;
 305         zq->dqb_bsoftlimit = userquota / DEV_BSIZE;
 306         zq->dqb_curblocks = userused / DEV_BSIZE;
 307         _zfs_close(zhp);
 308         return (0);
 309 }
 310 
 311 void
 312 getquota(rqstp, transp)
 313         register struct svc_req *rqstp;
 314         register SVCXPRT *transp;
 315 {
 316         struct getquota_args gqa;
 317         struct getquota_rslt gqr;
 318         struct dqblk dqblk;
 319         struct fsquot *fsqp;
 320         struct timeval tv;
 321         bool_t qactive;
 322 
 323         gqa.gqa_pathp = NULL;           /* let xdr allocate the storage */
 324         if (!svc_getargs(transp, xdr_getquota_args, (caddr_t)&gqa)) {
 325                 svcerr_decode(transp);
 326                 return;
 327         }
 328         /*
 329          * This authentication is really bogus with the current rpc
 330          * authentication scheme. One day we will have something for real.
 331          */
 332         CTASSERT(sizeof (authp) <= RQCRED_SIZE);
 333         if (rqstp->rq_cred.oa_flavor != AUTH_UNIX ||
 334             (((authp) rqstp->rq_clntcred)->aup_uid != 0 &&
 335                 ((authp) rqstp->rq_clntcred)->aup_uid != (uid_t)gqa.gqa_uid)) {
 336                 gqr.status = Q_EPERM;
 337                 goto sendreply;
 338         }
 339         fsqp = findfsq(gqa.gqa_pathp);
 340         if (fsqp == NULL) {
 341                 gqr.status = Q_NOQUOTA;
 342                 goto sendreply;
 
 | 
 
 
 303 
 304         zq->dqb_bhardlimit = userquota / DEV_BSIZE;
 305         zq->dqb_bsoftlimit = userquota / DEV_BSIZE;
 306         zq->dqb_curblocks = userused / DEV_BSIZE;
 307         _zfs_close(zhp);
 308         return (0);
 309 }
 310 
 311 void
 312 getquota(rqstp, transp)
 313         register struct svc_req *rqstp;
 314         register SVCXPRT *transp;
 315 {
 316         struct getquota_args gqa;
 317         struct getquota_rslt gqr;
 318         struct dqblk dqblk;
 319         struct fsquot *fsqp;
 320         struct timeval tv;
 321         bool_t qactive;
 322 
 323         CTASSERT(sizeof (authp) <= RQCRED_SIZE);
 324 
 325         gqa.gqa_pathp = NULL;           /* let xdr allocate the storage */
 326         if (!svc_getargs(transp, xdr_getquota_args, (caddr_t)&gqa)) {
 327                 svcerr_decode(transp);
 328                 return;
 329         }
 330         /*
 331          * This authentication is really bogus with the current rpc
 332          * authentication scheme. One day we will have something for real.
 333          */
 334         CTASSERT(sizeof (authp) <= RQCRED_SIZE);
 335         if (rqstp->rq_cred.oa_flavor != AUTH_UNIX ||
 336             (((authp) rqstp->rq_clntcred)->aup_uid != 0 &&
 337                 ((authp) rqstp->rq_clntcred)->aup_uid != (uid_t)gqa.gqa_uid)) {
 338                 gqr.status = Q_EPERM;
 339                 goto sendreply;
 340         }
 341         fsqp = findfsq(gqa.gqa_pathp);
 342         if (fsqp == NULL) {
 343                 gqr.status = Q_NOQUOTA;
 344                 goto sendreply;
 
 |