• Home
  • Raw
  • Download

Lines Matching refs:mp

64 	struct xfs_mount	*mp,  in xfs_qm_dquot_walk()  argument
69 struct xfs_quotainfo *qi = mp->m_quotainfo; in xfs_qm_dquot_walk()
137 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqpurge() local
138 struct xfs_quotainfo *qi = mp->m_quotainfo; in xfs_qm_dqpurge()
165 xfs_warn(mp, "%s: dquot %p flush failed", in xfs_qm_dqpurge()
175 ASSERT(XFS_FORCED_SHUTDOWN(mp) || in xfs_qm_dqpurge()
191 XFS_STATS_DEC(mp, xs_qm_dquot_unused); in xfs_qm_dqpurge()
202 struct xfs_mount *mp, in xfs_qm_dqpurge_all() argument
206 xfs_qm_dquot_walk(mp, XFS_DQ_USER, xfs_qm_dqpurge, NULL); in xfs_qm_dqpurge_all()
208 xfs_qm_dquot_walk(mp, XFS_DQ_GROUP, xfs_qm_dqpurge, NULL); in xfs_qm_dqpurge_all()
210 xfs_qm_dquot_walk(mp, XFS_DQ_PROJ, xfs_qm_dqpurge, NULL); in xfs_qm_dqpurge_all()
218 struct xfs_mount *mp) in xfs_qm_unmount() argument
220 if (mp->m_quotainfo) { in xfs_qm_unmount()
221 xfs_qm_dqpurge_all(mp, XFS_QMOPT_QUOTALL); in xfs_qm_unmount()
222 xfs_qm_destroy_quotainfo(mp); in xfs_qm_unmount()
231 xfs_mount_t *mp) in xfs_qm_unmount_quotas() argument
237 ASSERT(mp->m_rootip); in xfs_qm_unmount_quotas()
238 xfs_qm_dqdetach(mp->m_rootip); in xfs_qm_unmount_quotas()
239 if (mp->m_rbmip) in xfs_qm_unmount_quotas()
240 xfs_qm_dqdetach(mp->m_rbmip); in xfs_qm_unmount_quotas()
241 if (mp->m_rsumip) in xfs_qm_unmount_quotas()
242 xfs_qm_dqdetach(mp->m_rsumip); in xfs_qm_unmount_quotas()
247 if (mp->m_quotainfo) { in xfs_qm_unmount_quotas()
248 if (mp->m_quotainfo->qi_uquotaip) { in xfs_qm_unmount_quotas()
249 IRELE(mp->m_quotainfo->qi_uquotaip); in xfs_qm_unmount_quotas()
250 mp->m_quotainfo->qi_uquotaip = NULL; in xfs_qm_unmount_quotas()
252 if (mp->m_quotainfo->qi_gquotaip) { in xfs_qm_unmount_quotas()
253 IRELE(mp->m_quotainfo->qi_gquotaip); in xfs_qm_unmount_quotas()
254 mp->m_quotainfo->qi_gquotaip = NULL; in xfs_qm_unmount_quotas()
256 if (mp->m_quotainfo->qi_pquotaip) { in xfs_qm_unmount_quotas()
257 IRELE(mp->m_quotainfo->qi_pquotaip); in xfs_qm_unmount_quotas()
258 mp->m_quotainfo->qi_pquotaip = NULL; in xfs_qm_unmount_quotas()
314 struct xfs_mount *mp = ip->i_mount; in xfs_qm_need_dqattach() local
316 if (!XFS_IS_QUOTA_RUNNING(mp)) in xfs_qm_need_dqattach()
318 if (!XFS_IS_QUOTA_ON(mp)) in xfs_qm_need_dqattach()
320 if (!XFS_NOT_DQATTACHED(mp, ip)) in xfs_qm_need_dqattach()
322 if (xfs_is_quota_inode(&mp->m_sb, ip->i_ino)) in xfs_qm_need_dqattach()
339 xfs_mount_t *mp = ip->i_mount; in xfs_qm_dqattach_locked() local
347 if (XFS_IS_UQUOTA_ON(mp) && !ip->i_udquot) { in xfs_qm_dqattach_locked()
356 if (XFS_IS_GQUOTA_ON(mp) && !ip->i_gdquot) { in xfs_qm_dqattach_locked()
365 if (XFS_IS_PQUOTA_ON(mp) && !ip->i_pdquot) { in xfs_qm_dqattach_locked()
569 xfs_mount_t *mp, in xfs_qm_set_defquota() argument
577 error = xfs_qm_dqread(mp, 0, type, XFS_QMOPT_DOWARN, &dqp); in xfs_qm_set_defquota()
604 xfs_mount_t *mp) in xfs_qm_init_quotainfo() argument
610 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_init_quotainfo()
612 qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP); in xfs_qm_init_quotainfo()
622 error = xfs_qm_init_quotainos(mp); in xfs_qm_init_quotainfo()
635 qinf->qi_dqchunklen = XFS_FSB_TO_BB(mp, XFS_DQUOT_CLUSTER_SIZE_FSB); in xfs_qm_init_quotainfo()
638 mp->m_qflags |= (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_CHKD); in xfs_qm_init_quotainfo()
651 error = xfs_qm_dqread(mp, 0, in xfs_qm_init_quotainfo()
652 XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER : in xfs_qm_init_quotainfo()
653 (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP : in xfs_qm_init_quotainfo()
687 if (XFS_IS_UQUOTA_RUNNING(mp)) in xfs_qm_init_quotainfo()
688 xfs_qm_set_defquota(mp, XFS_DQ_USER, qinf); in xfs_qm_init_quotainfo()
689 if (XFS_IS_GQUOTA_RUNNING(mp)) in xfs_qm_init_quotainfo()
690 xfs_qm_set_defquota(mp, XFS_DQ_GROUP, qinf); in xfs_qm_init_quotainfo()
691 if (XFS_IS_PQUOTA_RUNNING(mp)) in xfs_qm_init_quotainfo()
692 xfs_qm_set_defquota(mp, XFS_DQ_PROJ, qinf); in xfs_qm_init_quotainfo()
713 mp->m_quotainfo = NULL; in xfs_qm_init_quotainfo()
724 xfs_mount_t *mp) in xfs_qm_destroy_quotainfo() argument
728 qi = mp->m_quotainfo; in xfs_qm_destroy_quotainfo()
737 mp->m_quotainfo = NULL; in xfs_qm_destroy_quotainfo()
746 xfs_mount_t *mp, in xfs_qm_qino_alloc() argument
763 if (!xfs_sb_version_has_pquotino(&mp->m_sb) && in xfs_qm_qino_alloc()
768 (mp->m_sb.sb_gquotino != NULLFSINO)) { in xfs_qm_qino_alloc()
769 ino = mp->m_sb.sb_gquotino; in xfs_qm_qino_alloc()
770 ASSERT(mp->m_sb.sb_pquotino == NULLFSINO); in xfs_qm_qino_alloc()
772 (mp->m_sb.sb_pquotino != NULLFSINO)) { in xfs_qm_qino_alloc()
773 ino = mp->m_sb.sb_pquotino; in xfs_qm_qino_alloc()
774 ASSERT(mp->m_sb.sb_gquotino == NULLFSINO); in xfs_qm_qino_alloc()
777 error = xfs_iget(mp, NULL, ino, 0, 0, ip); in xfs_qm_qino_alloc()
780 mp->m_sb.sb_gquotino = NULLFSINO; in xfs_qm_qino_alloc()
781 mp->m_sb.sb_pquotino = NULLFSINO; in xfs_qm_qino_alloc()
786 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_create, in xfs_qm_qino_alloc()
787 XFS_QM_QINOCREATE_SPACE_RES(mp), 0, 0, &tp); in xfs_qm_qino_alloc()
805 spin_lock(&mp->m_sb_lock); in xfs_qm_qino_alloc()
807 ASSERT(!xfs_sb_version_hasquota(&mp->m_sb)); in xfs_qm_qino_alloc()
809 xfs_sb_version_addquota(&mp->m_sb); in xfs_qm_qino_alloc()
810 mp->m_sb.sb_uquotino = NULLFSINO; in xfs_qm_qino_alloc()
811 mp->m_sb.sb_gquotino = NULLFSINO; in xfs_qm_qino_alloc()
812 mp->m_sb.sb_pquotino = NULLFSINO; in xfs_qm_qino_alloc()
815 mp->m_sb.sb_qflags = mp->m_qflags & XFS_ALL_QUOTA_ACCT; in xfs_qm_qino_alloc()
818 mp->m_sb.sb_uquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
820 mp->m_sb.sb_gquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
822 mp->m_sb.sb_pquotino = (*ip)->i_ino; in xfs_qm_qino_alloc()
823 spin_unlock(&mp->m_sb_lock); in xfs_qm_qino_alloc()
828 ASSERT(XFS_FORCED_SHUTDOWN(mp)); in xfs_qm_qino_alloc()
829 xfs_alert(mp, "%s failed (error %d)!", __func__, error); in xfs_qm_qino_alloc()
839 xfs_mount_t *mp, in xfs_qm_reset_dqcounts() argument
854 j = (int)XFS_FSB_TO_B(mp, XFS_DQUOT_CLUSTER_SIZE_FSB) / in xfs_qm_reset_dqcounts()
856 ASSERT(mp->m_quotainfo->qi_dqperchunk == j); in xfs_qm_reset_dqcounts()
859 for (j = 0; j < mp->m_quotainfo->qi_dqperchunk; j++) { in xfs_qm_reset_dqcounts()
869 xfs_dqcheck(mp, ddq, id+j, type, XFS_QMOPT_DQREPAIR, in xfs_qm_reset_dqcounts()
886 if (xfs_sb_version_hascrc(&mp->m_sb)) { in xfs_qm_reset_dqcounts()
896 struct xfs_mount *mp, in xfs_qm_dqiter_bufs() argument
922 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, in xfs_qm_dqiter_bufs()
923 XFS_FSB_TO_DADDR(mp, bno), in xfs_qm_dqiter_bufs()
924 mp->m_quotainfo->qi_dqchunklen, 0, &bp, in xfs_qm_dqiter_bufs()
935 error = xfs_trans_read_buf(mp, NULL, mp->m_ddev_targp, in xfs_qm_dqiter_bufs()
936 XFS_FSB_TO_DADDR(mp, bno), in xfs_qm_dqiter_bufs()
937 mp->m_quotainfo->qi_dqchunklen, 0, &bp, in xfs_qm_dqiter_bufs()
950 xfs_qm_reset_dqcounts(mp, bp, firstid, type); in xfs_qm_dqiter_bufs()
956 firstid += mp->m_quotainfo->qi_dqperchunk; in xfs_qm_dqiter_bufs()
968 struct xfs_mount *mp, in xfs_qm_dqiterate() argument
994 maxlblkcnt = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes); in xfs_qm_dqiterate()
1023 mp->m_quotainfo->qi_dqperchunk; in xfs_qm_dqiterate()
1032 xfs_buf_readahead(mp->m_ddev_targp, in xfs_qm_dqiterate()
1033 XFS_FSB_TO_DADDR(mp, rablkno), in xfs_qm_dqiterate()
1034 mp->m_quotainfo->qi_dqchunklen, in xfs_qm_dqiterate()
1043 error = xfs_qm_dqiter_bufs(mp, firstid, in xfs_qm_dqiterate()
1073 struct xfs_mount *mp = ip->i_mount; in xfs_qm_quotacheck_dqadjust() local
1077 error = xfs_qm_dqget(mp, ip, id, type, in xfs_qm_quotacheck_dqadjust()
1111 xfs_qm_adjust_dqlimits(mp, dqp); in xfs_qm_quotacheck_dqadjust()
1112 xfs_qm_adjust_dqtimers(mp, &dqp->q_core); in xfs_qm_quotacheck_dqadjust()
1127 xfs_mount_t *mp, /* mount point for filesystem */ in xfs_qm_dqusage_adjust() argument
1139 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_dqusage_adjust()
1145 if (xfs_is_quota_inode(&mp->m_sb, ino)) { in xfs_qm_dqusage_adjust()
1156 error = xfs_iget(mp, NULL, ino, XFS_IGET_DONTCACHE, XFS_ILOCK_EXCL, in xfs_qm_dqusage_adjust()
1191 if (XFS_IS_UQUOTA_ON(mp)) { in xfs_qm_dqusage_adjust()
1198 if (XFS_IS_GQUOTA_ON(mp)) { in xfs_qm_dqusage_adjust()
1205 if (XFS_IS_PQUOTA_ON(mp)) { in xfs_qm_dqusage_adjust()
1229 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_flush_one() local
1251 mp->m_quotainfo->qi_dqchunklen); in xfs_qm_flush_one()
1252 bp = _xfs_buf_find(mp->m_ddev_targp, &map, 1, 0, NULL); in xfs_qm_flush_one()
1283 xfs_mount_t *mp) in xfs_qm_quotacheck() argument
1290 struct xfs_inode *uip = mp->m_quotainfo->qi_uquotaip; in xfs_qm_quotacheck()
1291 struct xfs_inode *gip = mp->m_quotainfo->qi_gquotaip; in xfs_qm_quotacheck()
1292 struct xfs_inode *pip = mp->m_quotainfo->qi_pquotaip; in xfs_qm_quotacheck()
1300 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_quotacheck()
1302 xfs_notice(mp, "Quotacheck needed: Please wait."); in xfs_qm_quotacheck()
1310 error = xfs_qm_dqiterate(mp, uip, XFS_QMOPT_UQUOTA, in xfs_qm_quotacheck()
1318 error = xfs_qm_dqiterate(mp, gip, XFS_QMOPT_GQUOTA, in xfs_qm_quotacheck()
1326 error = xfs_qm_dqiterate(mp, pip, XFS_QMOPT_PQUOTA, in xfs_qm_quotacheck()
1338 error = xfs_bulkstat(mp, &lastino, &count, in xfs_qm_quotacheck()
1350 if (XFS_IS_UQUOTA_ON(mp)) { in xfs_qm_quotacheck()
1351 error = xfs_qm_dquot_walk(mp, XFS_DQ_USER, xfs_qm_flush_one, in xfs_qm_quotacheck()
1354 if (XFS_IS_GQUOTA_ON(mp)) { in xfs_qm_quotacheck()
1355 error2 = xfs_qm_dquot_walk(mp, XFS_DQ_GROUP, xfs_qm_flush_one, in xfs_qm_quotacheck()
1360 if (XFS_IS_PQUOTA_ON(mp)) { in xfs_qm_quotacheck()
1361 error2 = xfs_qm_dquot_walk(mp, XFS_DQ_PROJ, xfs_qm_flush_one, in xfs_qm_quotacheck()
1379 xfs_qm_dqpurge_all(mp, XFS_QMOPT_QUOTALL); in xfs_qm_quotacheck()
1388 mp->m_qflags &= ~XFS_ALL_QUOTA_CHKD; in xfs_qm_quotacheck()
1389 mp->m_qflags |= flags; in xfs_qm_quotacheck()
1395 xfs_warn(mp, in xfs_qm_quotacheck()
1401 ASSERT(mp->m_quotainfo != NULL); in xfs_qm_quotacheck()
1402 xfs_qm_destroy_quotainfo(mp); in xfs_qm_quotacheck()
1403 if (xfs_mount_reset_sbqflags(mp)) { in xfs_qm_quotacheck()
1404 xfs_warn(mp, in xfs_qm_quotacheck()
1408 xfs_notice(mp, "Quotacheck: Done."); in xfs_qm_quotacheck()
1423 struct xfs_mount *mp) in xfs_qm_mount_quotas() argument
1432 if (mp->m_sb.sb_rextents) { in xfs_qm_mount_quotas()
1433 xfs_notice(mp, "Cannot turn on quotas for realtime filesystem"); in xfs_qm_mount_quotas()
1434 mp->m_qflags = 0; in xfs_qm_mount_quotas()
1438 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_mount_quotas()
1444 error = xfs_qm_init_quotainfo(mp); in xfs_qm_mount_quotas()
1449 ASSERT(mp->m_quotainfo == NULL); in xfs_qm_mount_quotas()
1450 mp->m_qflags = 0; in xfs_qm_mount_quotas()
1456 if (XFS_QM_NEED_QUOTACHECK(mp)) { in xfs_qm_mount_quotas()
1457 error = xfs_qm_quotacheck(mp); in xfs_qm_mount_quotas()
1468 if (!XFS_IS_UQUOTA_ON(mp)) in xfs_qm_mount_quotas()
1469 mp->m_qflags &= ~XFS_UQUOTA_CHKD; in xfs_qm_mount_quotas()
1470 if (!XFS_IS_GQUOTA_ON(mp)) in xfs_qm_mount_quotas()
1471 mp->m_qflags &= ~XFS_GQUOTA_CHKD; in xfs_qm_mount_quotas()
1472 if (!XFS_IS_PQUOTA_ON(mp)) in xfs_qm_mount_quotas()
1473 mp->m_qflags &= ~XFS_PQUOTA_CHKD; in xfs_qm_mount_quotas()
1480 spin_lock(&mp->m_sb_lock); in xfs_qm_mount_quotas()
1481 sbf = mp->m_sb.sb_qflags; in xfs_qm_mount_quotas()
1482 mp->m_sb.sb_qflags = mp->m_qflags & XFS_MOUNT_QUOTA_ALL; in xfs_qm_mount_quotas()
1483 spin_unlock(&mp->m_sb_lock); in xfs_qm_mount_quotas()
1485 if (sbf != (mp->m_qflags & XFS_MOUNT_QUOTA_ALL)) { in xfs_qm_mount_quotas()
1486 if (xfs_sync_sb(mp, false)) { in xfs_qm_mount_quotas()
1493 ASSERT(!(XFS_IS_QUOTA_RUNNING(mp))); in xfs_qm_mount_quotas()
1494 xfs_alert(mp, "%s: Superblock update failed!", in xfs_qm_mount_quotas()
1500 xfs_warn(mp, "Failed to initialize disk quotas."); in xfs_qm_mount_quotas()
1511 xfs_mount_t *mp) in xfs_qm_init_quotainos() argument
1519 ASSERT(mp->m_quotainfo); in xfs_qm_init_quotainos()
1524 if (xfs_sb_version_hasquota(&mp->m_sb)) { in xfs_qm_init_quotainos()
1525 if (XFS_IS_UQUOTA_ON(mp) && in xfs_qm_init_quotainos()
1526 mp->m_sb.sb_uquotino != NULLFSINO) { in xfs_qm_init_quotainos()
1527 ASSERT(mp->m_sb.sb_uquotino > 0); in xfs_qm_init_quotainos()
1528 error = xfs_iget(mp, NULL, mp->m_sb.sb_uquotino, in xfs_qm_init_quotainos()
1533 if (XFS_IS_GQUOTA_ON(mp) && in xfs_qm_init_quotainos()
1534 mp->m_sb.sb_gquotino != NULLFSINO) { in xfs_qm_init_quotainos()
1535 ASSERT(mp->m_sb.sb_gquotino > 0); in xfs_qm_init_quotainos()
1536 error = xfs_iget(mp, NULL, mp->m_sb.sb_gquotino, in xfs_qm_init_quotainos()
1541 if (XFS_IS_PQUOTA_ON(mp) && in xfs_qm_init_quotainos()
1542 mp->m_sb.sb_pquotino != NULLFSINO) { in xfs_qm_init_quotainos()
1543 ASSERT(mp->m_sb.sb_pquotino > 0); in xfs_qm_init_quotainos()
1544 error = xfs_iget(mp, NULL, mp->m_sb.sb_pquotino, in xfs_qm_init_quotainos()
1559 if (XFS_IS_UQUOTA_ON(mp) && uip == NULL) { in xfs_qm_init_quotainos()
1560 error = xfs_qm_qino_alloc(mp, &uip, in xfs_qm_init_quotainos()
1567 if (XFS_IS_GQUOTA_ON(mp) && gip == NULL) { in xfs_qm_init_quotainos()
1568 error = xfs_qm_qino_alloc(mp, &gip, in xfs_qm_init_quotainos()
1575 if (XFS_IS_PQUOTA_ON(mp) && pip == NULL) { in xfs_qm_init_quotainos()
1576 error = xfs_qm_qino_alloc(mp, &pip, in xfs_qm_init_quotainos()
1582 mp->m_quotainfo->qi_uquotaip = uip; in xfs_qm_init_quotainos()
1583 mp->m_quotainfo->qi_gquotaip = gip; in xfs_qm_init_quotainos()
1584 mp->m_quotainfo->qi_pquotaip = pip; in xfs_qm_init_quotainos()
1620 struct xfs_mount *mp = dqp->q_mount; in xfs_qm_dqfree_one() local
1621 struct xfs_quotainfo *qi = mp->m_quotainfo; in xfs_qm_dqfree_one()
1657 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_dqalloc() local
1664 if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp)) in xfs_qm_vop_dqalloc()
1677 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_dqalloc()
1685 if ((flags & XFS_QMOPT_UQUOTA) && XFS_IS_UQUOTA_ON(mp)) { in xfs_qm_vop_dqalloc()
1697 error = xfs_qm_dqget(mp, NULL, uid, in xfs_qm_vop_dqalloc()
1721 if ((flags & XFS_QMOPT_GQUOTA) && XFS_IS_GQUOTA_ON(mp)) { in xfs_qm_vop_dqalloc()
1724 error = xfs_qm_dqget(mp, NULL, gid, in xfs_qm_vop_dqalloc()
1741 if ((flags & XFS_QMOPT_PQUOTA) && XFS_IS_PQUOTA_ON(mp)) { in xfs_qm_vop_dqalloc()
1744 error = xfs_qm_dqget(mp, NULL, (xfs_dqid_t)prid, in xfs_qm_vop_dqalloc()
1837 struct xfs_mount *mp = ip->i_mount; in xfs_qm_vop_chown_reserve() local
1849 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_vop_chown_reserve()
1855 if (XFS_IS_UQUOTA_ON(mp) && udqp && in xfs_qm_vop_chown_reserve()
1924 struct xfs_mount *mp = i_tab[0]->i_mount; in xfs_qm_vop_rename_dqattach() local
1927 if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp)) in xfs_qm_vop_rename_dqattach()
1938 if (XFS_NOT_DQATTACHED(mp, ip)) { in xfs_qm_vop_rename_dqattach()
1956 struct xfs_mount *mp = tp->t_mountp; in xfs_qm_vop_create_dqattach() local
1958 if (!XFS_IS_QUOTA_RUNNING(mp) || !XFS_IS_QUOTA_ON(mp)) in xfs_qm_vop_create_dqattach()
1962 ASSERT(XFS_IS_QUOTA_RUNNING(mp)); in xfs_qm_vop_create_dqattach()
1964 if (udqp && XFS_IS_UQUOTA_ON(mp)) { in xfs_qm_vop_create_dqattach()
1971 if (gdqp && XFS_IS_GQUOTA_ON(mp)) { in xfs_qm_vop_create_dqattach()
1977 if (pdqp && XFS_IS_PQUOTA_ON(mp)) { in xfs_qm_vop_create_dqattach()