• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/xnu-2422.115.4/bsd/hfs/

Lines Matching refs:dq

154 	register struct dquot *dq;
168 if ((dq = cp->c_dquot[i]) == NODQUOT)
170 dqlock(dq);
172 ncurbytes = dq->dq_curbytes + change;
174 dq->dq_curbytes = ncurbytes;
176 dq->dq_curbytes = 0;
177 dq->dq_flags &= ~DQ_BLKS;
178 dq->dq_flags |= DQ_MOD;
180 dqunlock(dq);
193 if ((dq = cp->c_dquot[i]) == NODQUOT)
203 if ((dq = cp->c_dquot[i]) == NODQUOT)
205 dqlock(dq);
207 dq->dq_curbytes += change;
208 dq->dq_flags |= DQ_MOD;
210 dqunlock(dq);
227 register struct dquot *dq = cp->c_dquot[type];
231 dqlock(dq);
233 ncurbytes = dq->dq_curbytes + change;
237 if (ncurbytes >= dq->dq_bhardlimit && dq->dq_bhardlimit) {
238 if ((dq->dq_flags & DQ_BLKS) == 0 &&
244 dq->dq_flags |= DQ_BLKS;
246 dqunlock(dq);
254 if (ncurbytes >= dq->dq_bsoftlimit && dq->dq_bsoftlimit) {
258 if (dq->dq_curbytes < dq->dq_bsoftlimit) {
259 dq->dq_btime = tv.tv_sec +
266 dqunlock(dq);
270 if (tv.tv_sec > (time_t)dq->dq_btime) {
271 if ((dq->dq_flags & DQ_BLKS) == 0 &&
278 dq->dq_flags |= DQ_BLKS;
280 dqunlock(dq);
285 dqunlock(dq);
300 register struct dquot *dq;
313 if ((dq = cp->c_dquot[i]) == NODQUOT)
315 dqlock(dq);
317 ncurinodes = dq->dq_curinodes + change;
319 dq->dq_curinodes = ncurinodes;
321 dq->dq_curinodes = 0;
322 dq->dq_flags &= ~DQ_INODS;
323 dq->dq_flags |= DQ_MOD;
325 dqunlock(dq);
338 if ((dq = cp->c_dquot[i]) == NODQUOT)
348 if ((dq = cp->c_dquot[i]) == NODQUOT)
350 dqlock(dq);
352 dq->dq_curinodes += change;
353 dq->dq_flags |= DQ_MOD;
355 dqunlock(dq);
367 int hfs_isiqchg_allowed(dq, hfsmp, change, cred, type, uid)
368 struct dquot* dq;
377 dqlock(dq);
379 ncurinodes = dq->dq_curinodes + change;
383 if (ncurinodes >= dq->dq_ihardlimit && dq->dq_ihardlimit) {
384 if ((dq->dq_flags & DQ_INODS) == 0 &&
386 dq->dq_flags |= DQ_INODS;
388 dqunlock(dq);
396 if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
400 if (dq->dq_curinodes < dq->dq_isoftlimit) {
401 dq->dq_itime = tv.tv_sec + hfsmp->hfs_qfiles[type].qf_itime;
402 dqunlock(dq);
405 if (tv.tv_sec > (time_t)dq->dq_itime) {
406 if (((dq->dq_flags & DQ_INODS) == 0) &&
408 dq->dq_flags |= DQ_INODS;
410 dqunlock(dq);
415 dqunlock(dq);
432 register struct dquot *dq = cp->c_dquot[type];
436 dqlock(dq);
438 ncurinodes = dq->dq_curinodes + change;
442 if (ncurinodes >= dq->dq_ihardlimit && dq->dq_ihardlimit) {
443 if ((dq->dq_flags & DQ_INODS) == 0 &&
449 dq->dq_flags |= DQ_INODS;
451 dqunlock(dq);
459 if (ncurinodes >= dq->dq_isoftlimit && dq->dq_isoftlimit) {
463 if (dq->dq_curinodes < dq->dq_isoftlimit) {
464 dq->dq_itime = tv.tv_sec +
471 dqunlock(dq);
475 if (tv.tv_sec > (time_t)dq->dq_itime) {
476 if ((dq->dq_flags & DQ_INODS) == 0 &&
483 dq->dq_flags |= DQ_INODS;
485 dqunlock(dq);
490 dqunlock(dq);
638 struct dquot *dq;
644 dq = cp->c_dquot[args->type];
647 dqrele(dq);
732 struct dquot *dq = NULL;
752 error = dqget(id, &hfsmp->hfs_qfiles[i], i, &dq);
757 if (dq == NODQUOT)
761 error = hfs_isiqchg_allowed(dq, hfsmp, change, cred, i, id);
763 dqrele(dq);
767 dqlock(dq);
769 dq->dq_curinodes += change;
770 dqunlock(dq);
771 dqrele(dq);
789 struct dquot *dq;
792 error = dqget(id, &VFSTOHFS(mp)->hfs_qfiles[type], type, &dq);
795 dqlock(dq);
797 bcopy(&dq->dq_dqb, datap, sizeof(dq->dq_dqb));
799 dqunlock(dq);
800 dqrele(dq);
815 struct dquot *dq;
821 error = dqget(id, &hfsmp->hfs_qfiles[type], type, &dq);
824 dqlock(dq);
831 newlimp->dqb_curbytes = dq->dq_curbytes;
832 newlimp->dqb_curinodes = dq->dq_curinodes;
833 if (dq->dq_id != 0) {
834 newlimp->dqb_btime = dq->dq_btime;
835 newlimp->dqb_itime = dq->dq_itime;
838 dq->dq_curbytes >= newlimp->dqb_bsoftlimit &&
839 (dq->dq_bsoftlimit == 0 || dq->dq_curbytes < dq->dq_bsoftlimit)) {
844 dq->dq_curinodes >= newlimp->dqb_isoftlimit &&
845 (dq->dq_isoftlimit == 0 || dq->dq_curinodes < dq->dq_isoftlimit)) {
849 bcopy(newlimp, &dq->dq_dqb, sizeof(dq->dq_dqb));
850 if (dq->dq_curbytes < dq->dq_bsoftlimit)
851 dq->dq_flags &= ~DQ_BLKS;
852 if (dq->dq_curinodes < dq->dq_isoftlimit)
853 dq->dq_flags &= ~DQ_INODS;
854 if (dq->dq_isoftlimit == 0 && dq->dq_bsoftlimit == 0 &&
855 dq->dq_ihardlimit == 0 && dq->dq_bhardlimit == 0)
856 dq->dq_flags |= DQ_FAKE;
858 dq->dq_flags &= ~DQ_FAKE;
859 dq->dq_flags |= DQ_MOD;
861 dqunlock(dq);
862 dqrele(dq);
878 struct dquot *dq;
883 error = dqget(id, &hfsmp->hfs_qfiles[type], type, &dq);
886 dqlock(dq);
892 if (dq->dq_bsoftlimit && dq->dq_curbytes < dq->dq_bsoftlimit &&
893 quotablkp->dqb_curbytes >= dq->dq_bsoftlimit) {
895 dq->dq_btime = tv.tv_sec + hfsmp->hfs_qfiles[type].qf_btime;
897 if (dq->dq_isoftlimit && dq->dq_curinodes < dq->dq_isoftlimit &&
898 quotablkp->dqb_curinodes >= dq->dq_isoftlimit) {
900 dq->dq_itime = tv.tv_sec + hfsmp->hfs_qfiles[type].qf_itime;
902 dq->dq_curbytes = quotablkp->dqb_curbytes;
903 dq->dq_curinodes = quotablkp->dqb_curinodes;
904 if (dq->dq_curbytes < dq->dq_bsoftlimit)
905 dq->dq_flags &= ~DQ_BLKS;
906 if (dq->dq_curinodes < dq->dq_isoftlimit)
907 dq->dq_flags &= ~DQ_INODS;
908 dq->dq_flags |= DQ_MOD;
910 dqunlock(dq);
911 dqrele(dq);
924 struct dquot *dq;
930 dq = cp->c_dquot[i];
931 if (dq != NODQUOT && (dq->dq_flags & DQ_MOD))
932 dqsync(dq);