Lines Matching refs:mp
36 xfs_mount_t *mp, in xfs_qm_scall_quotaoff() argument
39 struct xfs_quotainfo *q = mp->m_quotainfo; in xfs_qm_scall_quotaoff()
50 if ((mp->m_qflags & flags) == 0) in xfs_qm_scall_quotaoff()
69 mp->m_qflags &= ~(flags); in xfs_qm_scall_quotaoff()
71 spin_lock(&mp->m_sb_lock); in xfs_qm_scall_quotaoff()
72 mp->m_sb.sb_qflags = mp->m_qflags; in xfs_qm_scall_quotaoff()
73 spin_unlock(&mp->m_sb_lock); in xfs_qm_scall_quotaoff()
77 return xfs_sync_sb(mp, false); in xfs_qm_scall_quotaoff()
107 if ((mp->m_qflags & flags) == 0) in xfs_qm_scall_quotaoff()
115 error = xfs_qm_log_quotaoff(mp, &qoffstart, flags); in xfs_qm_scall_quotaoff()
130 mp->m_qflags &= ~inactivate_flags; in xfs_qm_scall_quotaoff()
142 xfs_qm_dqrele_all_inodes(mp, flags); in xfs_qm_scall_quotaoff()
149 mp->m_qflags &= ~flags; in xfs_qm_scall_quotaoff()
155 xfs_qm_dqpurge_all(mp, dqtype); in xfs_qm_scall_quotaoff()
168 error = xfs_qm_log_quotaoff_end(mp, qoffstart, flags); in xfs_qm_scall_quotaoff()
171 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_qm_scall_quotaoff()
178 if (mp->m_qflags == 0) { in xfs_qm_scall_quotaoff()
180 xfs_qm_destroy_quotainfo(mp); in xfs_qm_scall_quotaoff()
207 struct xfs_mount *mp, in xfs_qm_scall_trunc_qfile() argument
217 error = xfs_iget(mp, NULL, ino, 0, 0, &ip); in xfs_qm_scall_trunc_qfile()
223 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate, 0, 0, 0, &tp); in xfs_qm_scall_trunc_qfile()
255 xfs_mount_t *mp, in xfs_qm_scall_trunc_qfiles() argument
260 if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0 || in xfs_qm_scall_trunc_qfiles()
262 xfs_debug(mp, "%s: flags=%x m_qflags=%x", in xfs_qm_scall_trunc_qfiles()
263 __func__, flags, mp->m_qflags); in xfs_qm_scall_trunc_qfiles()
268 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_uquotino); in xfs_qm_scall_trunc_qfiles()
273 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_gquotino); in xfs_qm_scall_trunc_qfiles()
278 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_pquotino); in xfs_qm_scall_trunc_qfiles()
290 xfs_mount_t *mp, in xfs_qm_scall_quotaon() argument
303 xfs_debug(mp, "%s: zero flags, m_qflags=%x", in xfs_qm_scall_quotaon()
304 __func__, mp->m_qflags); in xfs_qm_scall_quotaon()
313 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
315 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
317 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
319 xfs_debug(mp, in xfs_qm_scall_quotaon()
321 __func__, flags, mp->m_sb.sb_qflags); in xfs_qm_scall_quotaon()
327 if ((mp->m_qflags & flags) == flags) in xfs_qm_scall_quotaon()
334 spin_lock(&mp->m_sb_lock); in xfs_qm_scall_quotaon()
335 qf = mp->m_sb.sb_qflags; in xfs_qm_scall_quotaon()
336 mp->m_sb.sb_qflags = qf | flags; in xfs_qm_scall_quotaon()
337 spin_unlock(&mp->m_sb_lock); in xfs_qm_scall_quotaon()
345 error = xfs_sync_sb(mp, false); in xfs_qm_scall_quotaon()
351 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) != in xfs_qm_scall_quotaon()
352 (mp->m_qflags & XFS_UQUOTA_ACCT)) || in xfs_qm_scall_quotaon()
353 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) != in xfs_qm_scall_quotaon()
354 (mp->m_qflags & XFS_PQUOTA_ACCT)) || in xfs_qm_scall_quotaon()
355 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) != in xfs_qm_scall_quotaon()
356 (mp->m_qflags & XFS_GQUOTA_ACCT))) in xfs_qm_scall_quotaon()
359 if (! XFS_IS_QUOTA_RUNNING(mp)) in xfs_qm_scall_quotaon()
365 mutex_lock(&mp->m_quotainfo->qi_quotaofflock); in xfs_qm_scall_quotaon()
366 mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD); in xfs_qm_scall_quotaon()
367 mutex_unlock(&mp->m_quotainfo->qi_quotaofflock); in xfs_qm_scall_quotaon()
380 struct xfs_mount *mp, in xfs_qm_scall_setqlim() argument
385 struct xfs_quotainfo *q = mp->m_quotainfo; in xfs_qm_scall_setqlim()
412 error = xfs_qm_dqget(mp, id, type, true, &dqp); in xfs_qm_scall_setqlim()
421 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_setqlim, 0, 0, 0, &tp); in xfs_qm_scall_setqlim()
433 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_hardlimit) : in xfs_qm_scall_setqlim()
436 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_softlimit) : in xfs_qm_scall_setqlim()
447 xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
450 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_hardlimit) : in xfs_qm_scall_setqlim()
453 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_softlimit) : in xfs_qm_scall_setqlim()
463 xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
480 xfs_debug(mp, "ihard %Ld < isoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
527 xfs_qm_adjust_dqtimers(mp, ddq); in xfs_qm_scall_setqlim()
543 xfs_mount_t *mp, in xfs_qm_log_quotaoff_end() argument
551 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_equotaoff, 0, 0, 0, &tp); in xfs_qm_log_quotaoff_end()
571 xfs_mount_t *mp, in xfs_qm_log_quotaoff() argument
581 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_qm_quotaoff, 0, 0, 0, &tp); in xfs_qm_log_quotaoff()
588 spin_lock(&mp->m_sb_lock); in xfs_qm_log_quotaoff()
589 mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; in xfs_qm_log_quotaoff()
590 spin_unlock(&mp->m_sb_lock); in xfs_qm_log_quotaoff()
612 struct xfs_mount *mp, in xfs_qm_scall_getquota_fill_qc() argument
619 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); in xfs_qm_scall_getquota_fill_qc()
621 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); in xfs_qm_scall_getquota_fill_qc()
624 dst->d_space = XFS_FSB_TO_B(mp, dqp->q_res_bcount); in xfs_qm_scall_getquota_fill_qc()
631 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); in xfs_qm_scall_getquota_fill_qc()
633 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); in xfs_qm_scall_getquota_fill_qc()
634 dst->d_rt_space = XFS_FSB_TO_B(mp, dqp->q_res_rtbcount); in xfs_qm_scall_getquota_fill_qc()
643 if ((!XFS_IS_UQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota_fill_qc()
645 (!XFS_IS_GQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota_fill_qc()
647 (!XFS_IS_PQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota_fill_qc()
655 if (((XFS_IS_UQUOTA_ENFORCED(mp) && type == XFS_DQ_USER) || in xfs_qm_scall_getquota_fill_qc()
656 (XFS_IS_GQUOTA_ENFORCED(mp) && type == XFS_DQ_GROUP) || in xfs_qm_scall_getquota_fill_qc()
657 (XFS_IS_PQUOTA_ENFORCED(mp) && type == XFS_DQ_PROJ)) && in xfs_qm_scall_getquota_fill_qc()
674 struct xfs_mount *mp, in xfs_qm_scall_getquota() argument
686 error = xfs_qm_dqget(mp, id, type, false, &dqp); in xfs_qm_scall_getquota()
699 xfs_qm_scall_getquota_fill_qc(mp, type, dqp, dst); in xfs_qm_scall_getquota()
712 struct xfs_mount *mp, in xfs_qm_scall_getquota_next() argument
720 error = xfs_qm_dqget_next(mp, *id, type, &dqp); in xfs_qm_scall_getquota_next()
727 xfs_qm_scall_getquota_fill_qc(mp, type, dqp, dst); in xfs_qm_scall_getquota_next()
775 struct xfs_mount *mp, in xfs_qm_dqrele_all_inodes() argument
778 ASSERT(mp->m_quotainfo); in xfs_qm_dqrele_all_inodes()
779 xfs_inode_ag_iterator_flags(mp, xfs_dqrele_inode, flags, NULL, in xfs_qm_dqrele_all_inodes()