Lines Matching refs:dqp
198 struct dquot *dqp; in opendq() local
284 error = getdiskquota((uid_t)0, ufsvfsp, 1, &dqp); in opendq()
286 mutex_enter(&dqp->dq_lock); in opendq()
288 (dqp->dq_btimelimit? dqp->dq_btimelimit: DQ_BTIMELIMIT); in opendq()
290 (dqp->dq_ftimelimit? dqp->dq_ftimelimit: DQ_FTIMELIMIT); in opendq()
294 dqput(dqp); in opendq()
295 mutex_exit(&dqp->dq_lock); in opendq()
321 struct dquot *dqp; in closedq_scan_inode() local
337 if ((dqp = ip->i_dquot) != NULL) { in closedq_scan_inode()
341 mutex_enter(&dqp->dq_lock); in closedq_scan_inode()
342 dqput(dqp); in closedq_scan_inode()
353 if (dqp->dq_flags & DQ_TRANS) { in closedq_scan_inode()
354 dqp->dq_flags &= ~DQ_TRANS; in closedq_scan_inode()
355 dqput(dqp); in closedq_scan_inode()
357 mutex_exit(&dqp->dq_lock); in closedq_scan_inode()
491 struct dquot *dqp; in setquota() local
529 dqp = xdqp; in setquota()
533 mutex_enter(&dqp->dq_lock); in setquota()
535 newlim.dqb_curblocks = dqp->dq_curblocks; in setquota()
536 newlim.dqb_curfiles = dqp->dq_curfiles; in setquota()
551 if (dqp->dq_bsoftlimit == 0 || in setquota()
552 dqp->dq_curblocks < dqp->dq_bsoftlimit) { in setquota()
558 dqp->dq_flags &= ~DQ_BLKS; in setquota()
566 newlim.dqb_btimelimit = dqp->dq_btimelimit; in setquota()
567 dqp->dq_flags |= DQ_BLKS; in setquota()
572 dqp->dq_flags &= ~DQ_BLKS; in setquota()
577 if (dqp->dq_fsoftlimit == 0 || in setquota()
578 dqp->dq_curfiles < dqp->dq_fsoftlimit) { in setquota()
584 dqp->dq_flags &= ~DQ_FILES; in setquota()
592 newlim.dqb_ftimelimit = dqp->dq_ftimelimit; in setquota()
593 dqp->dq_flags |= DQ_FILES; in setquota()
598 dqp->dq_flags &= ~DQ_FILES; in setquota()
607 if ((dqp->dq_fhardlimit == 0 && dqp->dq_fsoftlimit == 0 && in setquota()
608 dqp->dq_bhardlimit == 0 && dqp->dq_bsoftlimit == 0) && in setquota()
619 else if ((dqp->dq_fhardlimit || dqp->dq_fsoftlimit || in setquota()
620 dqp->dq_bhardlimit || dqp->dq_bsoftlimit) && in setquota()
626 dqp->dq_dqb = newlim; in setquota()
627 dqp->dq_flags |= DQ_MOD; in setquota()
636 (void) ufs_rdwri(UIO_WRITE, FWRITE | FSYNC, qip, (caddr_t)&dqp->dq_dqb, in setquota()
641 (void) VOP_PUTPAGE(ITOV(qip), dqoff(dqp->dq_uid) & ~qip->i_fs->fs_bmask, in setquota()
650 error = bmap_read(qip, dqoff(dqp->dq_uid), &bn, &contig); in setquota()
653 dqp->dq_mof = UFS_HOLE; in setquota()
655 dqp->dq_mof = ldbtob(bn) + in setquota()
656 (offset_t)((dqoff(dqp->dq_uid)) & (DEV_BSIZE - 1)); in setquota()
659 dqp->dq_flags &= ~DQ_MOD; in setquota()
660 dqput(dqp); in setquota()
661 mutex_exit(&dqp->dq_lock); in setquota()
680 struct dquot *dqp; in getquota() local
698 dqp = xdqp; in getquota()
699 mutex_enter(&dqp->dq_lock); in getquota()
700 if (dqp->dq_fhardlimit == 0 && dqp->dq_fsoftlimit == 0 && in getquota()
701 dqp->dq_bhardlimit == 0 && dqp->dq_bsoftlimit == 0) { in getquota()
704 bcopy(&dqp->dq_dqb, &dqb, sizeof (struct dqblk)); in getquota()
706 dqput(dqp); in getquota()
707 mutex_exit(&dqp->dq_lock); in getquota()
735 struct dquot *dqp; in quotasync() local
779 for (dqp = dquot; dqp < dquotNDQUOT; dqp++) { in quotasync()
783 if (!mutex_tryenter(&dqp->dq_lock)) { in quotasync()
791 if (dqp->dq_ufsvfsp == ufsvfsp && in quotasync()
792 (dqp->dq_flags & DQ_MOD)) { in quotasync()
794 dqupdate(dqp); in quotasync()
797 mutex_exit(&dqp->dq_lock); in quotasync()
810 for (dqp = dquot; dqp < dquotNDQUOT; dqp++) { in quotasync()
814 if (!mutex_tryenter(&dqp->dq_lock)) { in quotasync()
818 ufsvfsp = dqp->dq_ufsvfsp; /* shorthand */ in quotasync()
824 if ((dqp->dq_flags & DQ_MOD) == 0 || ufsvfsp == NULL) { in quotasync()
825 mutex_exit(&dqp->dq_lock); in quotasync()
845 mutex_exit(&dqp->dq_lock); in quotasync()
876 dqupdate(dqp); in quotasync()
883 mutex_exit(&dqp->dq_lock); in quotasync()