Lines Matching refs:mp

52 	xfs_mount_t		*mp,  in xfs_qm_scall_quotaoff()  argument
55 struct xfs_quotainfo *q = mp->m_quotainfo; in xfs_qm_scall_quotaoff()
66 if ((mp->m_qflags & flags) == 0) in xfs_qm_scall_quotaoff()
85 mp->m_qflags &= ~(flags); in xfs_qm_scall_quotaoff()
87 spin_lock(&mp->m_sb_lock); in xfs_qm_scall_quotaoff()
88 mp->m_sb.sb_qflags = mp->m_qflags; in xfs_qm_scall_quotaoff()
89 spin_unlock(&mp->m_sb_lock); in xfs_qm_scall_quotaoff()
93 return xfs_sync_sb(mp, false); in xfs_qm_scall_quotaoff()
123 if ((mp->m_qflags & flags) == 0) in xfs_qm_scall_quotaoff()
131 error = xfs_qm_log_quotaoff(mp, &qoffstart, flags); in xfs_qm_scall_quotaoff()
146 mp->m_qflags &= ~inactivate_flags; in xfs_qm_scall_quotaoff()
158 xfs_qm_dqrele_all_inodes(mp, flags); in xfs_qm_scall_quotaoff()
165 mp->m_qflags &= ~flags; in xfs_qm_scall_quotaoff()
171 xfs_qm_dqpurge_all(mp, dqtype); in xfs_qm_scall_quotaoff()
184 error = xfs_qm_log_quotaoff_end(mp, qoffstart, flags); in xfs_qm_scall_quotaoff()
187 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE); in xfs_qm_scall_quotaoff()
194 if (mp->m_qflags == 0) { in xfs_qm_scall_quotaoff()
196 xfs_qm_destroy_quotainfo(mp); in xfs_qm_scall_quotaoff()
223 struct xfs_mount *mp, in xfs_qm_scall_trunc_qfile() argument
233 error = xfs_iget(mp, NULL, ino, 0, 0, &ip); in xfs_qm_scall_trunc_qfile()
239 tp = xfs_trans_alloc(mp, XFS_TRANS_TRUNCATE_FILE); in xfs_qm_scall_trunc_qfile()
240 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_itruncate, 0, 0); in xfs_qm_scall_trunc_qfile()
274 xfs_mount_t *mp, in xfs_qm_scall_trunc_qfiles() argument
279 if (!xfs_sb_version_hasquota(&mp->m_sb) || flags == 0 || in xfs_qm_scall_trunc_qfiles()
281 xfs_debug(mp, "%s: flags=%x m_qflags=%x", in xfs_qm_scall_trunc_qfiles()
282 __func__, flags, mp->m_qflags); in xfs_qm_scall_trunc_qfiles()
287 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_uquotino); in xfs_qm_scall_trunc_qfiles()
292 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_gquotino); in xfs_qm_scall_trunc_qfiles()
297 error = xfs_qm_scall_trunc_qfile(mp, mp->m_sb.sb_pquotino); in xfs_qm_scall_trunc_qfiles()
309 xfs_mount_t *mp, in xfs_qm_scall_quotaon() argument
322 xfs_debug(mp, "%s: zero flags, m_qflags=%x", in xfs_qm_scall_quotaon()
323 __func__, mp->m_qflags); in xfs_qm_scall_quotaon()
332 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
334 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
336 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) == 0 && in xfs_qm_scall_quotaon()
338 xfs_debug(mp, in xfs_qm_scall_quotaon()
340 __func__, flags, mp->m_sb.sb_qflags); in xfs_qm_scall_quotaon()
346 if ((mp->m_qflags & flags) == flags) in xfs_qm_scall_quotaon()
353 spin_lock(&mp->m_sb_lock); in xfs_qm_scall_quotaon()
354 qf = mp->m_sb.sb_qflags; in xfs_qm_scall_quotaon()
355 mp->m_sb.sb_qflags = qf | flags; in xfs_qm_scall_quotaon()
356 spin_unlock(&mp->m_sb_lock); in xfs_qm_scall_quotaon()
364 error = xfs_sync_sb(mp, false); in xfs_qm_scall_quotaon()
370 if (((mp->m_sb.sb_qflags & XFS_UQUOTA_ACCT) != in xfs_qm_scall_quotaon()
371 (mp->m_qflags & XFS_UQUOTA_ACCT)) || in xfs_qm_scall_quotaon()
372 ((mp->m_sb.sb_qflags & XFS_PQUOTA_ACCT) != in xfs_qm_scall_quotaon()
373 (mp->m_qflags & XFS_PQUOTA_ACCT)) || in xfs_qm_scall_quotaon()
374 ((mp->m_sb.sb_qflags & XFS_GQUOTA_ACCT) != in xfs_qm_scall_quotaon()
375 (mp->m_qflags & XFS_GQUOTA_ACCT))) in xfs_qm_scall_quotaon()
378 if (! XFS_IS_QUOTA_RUNNING(mp)) in xfs_qm_scall_quotaon()
384 mutex_lock(&mp->m_quotainfo->qi_quotaofflock); in xfs_qm_scall_quotaon()
385 mp->m_qflags |= (flags & XFS_ALL_QUOTA_ENFD); in xfs_qm_scall_quotaon()
386 mutex_unlock(&mp->m_quotainfo->qi_quotaofflock); in xfs_qm_scall_quotaon()
399 struct xfs_mount *mp, in xfs_qm_scall_setqlim() argument
404 struct xfs_quotainfo *q = mp->m_quotainfo; in xfs_qm_scall_setqlim()
430 error = xfs_qm_dqget(mp, NULL, id, type, XFS_QMOPT_DQALLOC, &dqp); in xfs_qm_scall_setqlim()
437 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SETQLIM); in xfs_qm_scall_setqlim()
438 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_setqlim, 0, 0); in xfs_qm_scall_setqlim()
452 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_hardlimit) : in xfs_qm_scall_setqlim()
455 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_spc_softlimit) : in xfs_qm_scall_setqlim()
466 xfs_debug(mp, "blkhard %Ld < blksoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
469 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_hardlimit) : in xfs_qm_scall_setqlim()
472 (xfs_qcnt_t) XFS_B_TO_FSB(mp, newlim->d_rt_spc_softlimit) : in xfs_qm_scall_setqlim()
482 xfs_debug(mp, "rtbhard %Ld < rtbsoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
499 xfs_debug(mp, "ihard %Ld < isoft %Ld", hard, soft); in xfs_qm_scall_setqlim()
546 xfs_qm_adjust_dqtimers(mp, ddq); in xfs_qm_scall_setqlim()
562 xfs_mount_t *mp, in xfs_qm_log_quotaoff_end() argument
570 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF_END); in xfs_qm_log_quotaoff_end()
572 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_equotaoff, 0, 0); in xfs_qm_log_quotaoff_end()
595 xfs_mount_t *mp, in xfs_qm_log_quotaoff() argument
605 tp = xfs_trans_alloc(mp, XFS_TRANS_QM_QUOTAOFF); in xfs_qm_log_quotaoff()
606 error = xfs_trans_reserve(tp, &M_RES(mp)->tr_qm_quotaoff, 0, 0); in xfs_qm_log_quotaoff()
615 spin_lock(&mp->m_sb_lock); in xfs_qm_log_quotaoff()
616 mp->m_sb.sb_qflags = (mp->m_qflags & ~(flags)) & XFS_MOUNT_QUOTA_ALL; in xfs_qm_log_quotaoff()
617 spin_unlock(&mp->m_sb_lock); in xfs_qm_log_quotaoff()
639 struct xfs_mount *mp, in xfs_qm_scall_getquota() argument
652 error = xfs_qm_dqget(mp, NULL, id, type, 0, &dqp); in xfs_qm_scall_getquota()
667 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_hardlimit)); in xfs_qm_scall_getquota()
669 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_blk_softlimit)); in xfs_qm_scall_getquota()
672 dst->d_space = XFS_FSB_TO_B(mp, dqp->q_res_bcount); in xfs_qm_scall_getquota()
679 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_hardlimit)); in xfs_qm_scall_getquota()
681 XFS_FSB_TO_B(mp, be64_to_cpu(dqp->q_core.d_rtb_softlimit)); in xfs_qm_scall_getquota()
682 dst->d_rt_space = XFS_FSB_TO_B(mp, dqp->q_res_rtbcount); in xfs_qm_scall_getquota()
691 if ((!XFS_IS_UQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota()
693 (!XFS_IS_GQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota()
695 (!XFS_IS_PQUOTA_ENFORCED(mp) && in xfs_qm_scall_getquota()
703 if (((XFS_IS_UQUOTA_ENFORCED(mp) && type == XFS_DQ_USER) || in xfs_qm_scall_getquota()
704 (XFS_IS_GQUOTA_ENFORCED(mp) && type == XFS_DQ_GROUP) || in xfs_qm_scall_getquota()
705 (XFS_IS_PQUOTA_ENFORCED(mp) && type == XFS_DQ_PROJ)) && in xfs_qm_scall_getquota()
765 struct xfs_mount *mp, in xfs_qm_dqrele_all_inodes() argument
768 ASSERT(mp->m_quotainfo); in xfs_qm_dqrele_all_inodes()
769 xfs_inode_ag_iterator(mp, xfs_dqrele_inode, flags, NULL); in xfs_qm_dqrele_all_inodes()