• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/xfs/quota/

Lines Matching defs:dqp

80 	xfs_dquot_t	*dqp;
83 brandnewdquot = xfs_qm_dqalloc_incore(&dqp);
84 dqp->dq_flags = type;
85 dqp->q_core.d_id = cpu_to_be32(id);
86 dqp->q_mount = mp;
92 INIT_LIST_HEAD(&dqp->q_freelist);
93 mutex_init(&dqp->q_qlock);
94 init_waitqueue_head(&dqp->q_pinwait);
101 init_completion(&dqp->q_flush);
102 complete(&dqp->q_flush);
104 trace_xfs_dqinit(dqp);
110 dqp->q_nrefs = 0;
111 dqp->q_blkno = 0;
112 INIT_LIST_HEAD(&dqp->q_mplist);
113 INIT_LIST_HEAD(&dqp->q_hashlist);
114 dqp->q_bufoffset = 0;
115 dqp->q_fileoffset = 0;
116 dqp->q_transp = NULL;
117 dqp->q_gdquot = NULL;
118 dqp->q_res_bcount = 0;
119 dqp->q_res_icount = 0;
120 dqp->q_res_rtbcount = 0;
121 atomic_set(&dqp->q_pincount, 0);
122 dqp->q_hash = NULL;
123 ASSERT(list_empty(&dqp->q_freelist));
125 trace_xfs_dqreuse(dqp);
134 lockdep_set_class(&dqp->q_qlock, &xfs_dquot_other_class);
139 return (dqp);
147 xfs_dquot_t *dqp)
149 ASSERT(list_empty(&dqp->q_freelist));
151 mutex_destroy(&dqp->q_qlock);
152 sv_destroy(&dqp->q_pinwait);
153 kmem_zone_free(xfs_Gqm->qm_dqzone, dqp);
351 xfs_dquot_t *dqp,
365 trace_xfs_dqalloc(dqp);
376 if (XFS_IS_THIS_QUOTA_OFF(dqp)) {
399 dqp->q_blkno = XFS_FSB_TO_DADDR(mp, map.br_startblock);
403 dqp->q_blkno,
412 xfs_qm_init_dquot_blk(tp, mp, be32_to_cpu(dqp->q_core.d_id),
413 dqp->dq_flags & XFS_DQ_ALLTYPES, bp);
460 xfs_dquot_t *dqp,
475 mp = dqp->q_mount;
476 id = be32_to_cpu(dqp->q_core.d_id);
483 if (dqp->q_blkno == (xfs_daddr_t) 0) {
485 dqp->q_fileoffset = (xfs_fileoff_t)id /
488 quotip = XFS_DQ_TO_QIP(dqp);
494 if (XFS_IS_THIS_QUOTA_OFF(dqp)) {
501 error = xfs_bmapi(NULL, quotip, dqp->q_fileoffset,
515 dqp->q_bufoffset = (id % mp->m_quotainfo->qi_dqperchunk) *
525 if ((error = xfs_qm_dqalloc(tpp, mp, dqp, quotip,
526 dqp->q_fileoffset, &bp)))
535 dqp->q_blkno = XFS_FSB_TO_DADDR(mp, map.br_startblock);
538 ASSERT(dqp->q_blkno != DELAYSTARTBLOCK);
539 ASSERT(dqp->q_blkno != HOLESTARTBLOCK);
546 trace_xfs_dqtobp_read(dqp);
549 dqp->q_blkno,
561 ddq = (xfs_disk_dquot_t *)((char *)XFS_BUF_PTR(bp) + dqp->q_bufoffset);
566 if (xfs_qm_dqcheck(ddq, id, dqp->dq_flags & XFS_DQ_ALLTYPES,
593 xfs_dquot_t *dqp, /* dquot to get filled in */
603 trace_xfs_dqread(dqp);
607 * dqp already knows its own type (GROUP/USER).
609 if ((error = xfs_qm_dqtobp(tpp, dqp, &ddqp, &bp, flags))) {
615 memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t));
616 ASSERT(be32_to_cpu(dqp->q_core.d_id) == id);
617 xfs_qm_dquot_logitem_init(dqp);
623 dqp->q_res_bcount = be64_to_cpu(ddqp->d_bcount);
624 dqp->q_res_icount = be64_to_cpu(ddqp->d_icount);
625 dqp->q_res_rtbcount = be64_to_cpu(ddqp->d_rtbcount);
664 xfs_dquot_t *dqp;
669 dqp = xfs_qm_dqinit(mp, id, type);
691 if ((error = xfs_qm_dqread(&tp, id, dqp, flags))) {
697 trace_xfs_dqread_fail(dqp);
706 *O_dqpp = dqp;
714 xfs_qm_dqdestroy(dqp);
733 xfs_dquot_t *dqp;
743 list_for_each_entry(dqp, &qh->qh_list, q_hashlist) {
749 if (be32_to_cpu(dqp->q_core.d_id) == id && dqp->q_mount == mp) {
750 trace_xfs_dqlookup_found(dqp);
755 ASSERT(!list_empty(&dqp->q_mplist));
757 xfs_dqlock(dqp);
758 if (dqp->q_nrefs == 0) {
759 ASSERT(!list_empty(&dqp->q_freelist));
761 trace_xfs_dqlookup_want(dqp);
768 dqp->dq_flags |= XFS_DQ_WANT;
769 xfs_dqunlock(dqp);
771 xfs_dqlock(dqp);
772 dqp->dq_flags &= ~(XFS_DQ_WANT);
781 ASSERT(be32_to_cpu(dqp->q_core.d_id) == id);
784 if (dqp->q_nrefs != 0) {
789 trace_xfs_dqlookup_freelist(dqp);
790 list_del_init(&dqp->q_freelist);
795 XFS_DQHOLD(dqp);
803 list_move(&dqp->q_hashlist, &qh->qh_list);
804 trace_xfs_dqlookup_done(dqp);
805 *O_dqpp = dqp;
832 xfs_dquot_t *dqp;
915 &dqp))) {
948 xfs_qm_dqdestroy(dqp);
952 xfs_qm_dqdestroy(dqp);
953 dqp = ip->i_udquot;
954 xfs_dqlock(dqp);
960 xfs_qm_dqdestroy(dqp);
964 xfs_qm_dqdestroy(dqp);
965 dqp = ip->i_gdquot;
966 xfs_dqlock(dqp);
982 * lock order between the two dquots here since dqp isn't
992 xfs_qm_dqdestroy(dqp);
1003 dqp->q_hash = h;
1004 list_add(&dqp->q_hashlist, &h->qh_list);
1016 xfs_dqlock(dqp);
1017 dqp->q_nrefs = 1;
1019 list_add(&dqp->q_mplist, &mp->m_quotainfo->qi_dqlist);
1025 trace_xfs_dqget_miss(dqp);
1026 *O_dqpp = dqp;
1039 xfs_dquot_t *dqp)
1043 ASSERT(dqp->q_nrefs > 0);
1044 ASSERT(XFS_DQ_IS_LOCKED(dqp));
1046 trace_xfs_dqput(dqp);
1048 if (dqp->q_nrefs != 1) {
1049 dqp->q_nrefs--;
1050 xfs_dqunlock(dqp);
1059 trace_xfs_dqput_wait(dqp);
1060 xfs_dqunlock(dqp);
1062 xfs_dqlock(dqp);
1069 if (--dqp->q_nrefs == 0) {
1070 trace_xfs_dqput_free(dqp);
1072 list_add_tail(&dqp->q_freelist, &xfs_Gqm->qm_dqfrlist);
1081 if ((gdqp = dqp->q_gdquot)) {
1086 dqp->q_gdquot = NULL;
1089 xfs_dqunlock(dqp);
1097 dqp = gdqp;
1108 xfs_dquot_t *dqp)
1110 if (!dqp)
1113 trace_xfs_dqrele(dqp);
1115 xfs_dqlock(dqp);
1122 xfs_qm_dqput(dqp);
1138 xfs_dquot_t *dqp = qip->qli_dquot;
1163 xfs_dqfunlock(dqp);
1176 xfs_dquot_t *dqp,
1184 ASSERT(XFS_DQ_IS_LOCKED(dqp));
1185 ASSERT(!completion_done(&dqp->q_flush));
1186 trace_xfs_dqflush(dqp);
1192 if (!XFS_DQ_IS_DIRTY(dqp) ||
1193 (!(flags & SYNC_WAIT) && atomic_read(&dqp->q_pincount) > 0)) {
1194 xfs_dqfunlock(dqp);
1197 xfs_qm_dqunpin_wait(dqp);
1204 if (XFS_FORCED_SHUTDOWN(dqp->q_mount)) {
1205 dqp->dq_flags &= ~(XFS_DQ_DIRTY);
1206 xfs_dqfunlock(dqp);
1215 if ((error = xfs_qm_dqtobp(NULL, dqp, &ddqp, &bp, XFS_QMOPT_DOWARN))) {
1220 xfs_dqfunlock(dqp);
1224 if (xfs_qm_dqcheck(&dqp->q_core, be32_to_cpu(ddqp->d_id),
1226 xfs_force_shutdown(dqp->q_mount, SHUTDOWN_CORRUPT_INCORE);
1231 memcpy(ddqp, &(dqp->q_core), sizeof(xfs_disk_dquot_t));
1236 dqp->dq_flags &= ~(XFS_DQ_DIRTY);
1237 mp = dqp->q_mount;
1239 xfs_trans_ail_copy_lsn(mp->m_ail, &dqp->q_logitem.qli_flush_lsn,
1240 &dqp->q_logitem.qli_item.li_lsn);
1247 &dqp->q_logitem.qli_item);
1254 trace_xfs_dqflush_force(dqp);
1263 trace_xfs_dqflush_done(dqp);
1266 * dqp is still locked, but caller is free to unlock it now.
1274 xfs_dquot_t *dqp)
1276 return mutex_trylock(&dqp->q_qlock);
1281 xfs_dquot_t *dqp)
1283 mutex_lock(&dqp->q_qlock);
1288 xfs_dquot_t *dqp)
1290 mutex_unlock(&(dqp->q_qlock));
1291 if (dqp->q_logitem.qli_dquot == dqp) {
1292 /* Once was dqp->q_mount, but might just have been cleared */
1293 xfs_trans_unlocked_item(dqp->q_logitem.qli_item.li_ailp,
1294 (xfs_log_item_t*)&(dqp->q_logitem));
1301 xfs_dquot_t *dqp)
1303 mutex_unlock(&(dqp->q_qlock));
1347 xfs_dquot_t *dqp)
1349 xfs_dqhash_t *qh = dqp->q_hash;
1350 xfs_mount_t *mp = dqp->q_mount;
1353 ASSERT(mutex_is_locked(&dqp->q_hash->qh_lock));
1355 xfs_dqlock(dqp);
1364 if (dqp->q_nrefs != 0) {
1365 xfs_dqunlock(dqp);
1366 mutex_unlock(&dqp->q_hash->qh_lock);
1370 ASSERT(!list_empty(&dqp->q_freelist));
1380 if (!xfs_dqflock_nowait(dqp)) {
1385 xfs_qm_dqflock_pushbuf_wait(dqp);
1393 if (XFS_DQ_IS_DIRTY(dqp)) {
1405 error = xfs_qm_dqflush(dqp, SYNC_WAIT);
1408 "xfs_qm_dqpurge: dquot %p flush failed", dqp);
1409 xfs_dqflock(dqp);
1411 ASSERT(atomic_read(&dqp->q_pincount) == 0);
1413 !(dqp->q_logitem.qli_item.li_flags & XFS_LI_IN_AIL));
1415 list_del_init(&dqp->q_hashlist);
1417 list_del_init(&dqp->q_mplist);
1420 ASSERT(!list_empty(&dqp->q_freelist));
1422 dqp->q_mount = NULL;
1423 dqp->q_hash = NULL;
1424 dqp->dq_flags = XFS_DQ_INACTIVE;
1425 memset(&dqp->q_core, 0, sizeof(dqp->q_core));
1426 xfs_dqfunlock(dqp);
1427 xfs_dqunlock(dqp);
1435 xfs_qm_dqprint(xfs_dquot_t *dqp)
1439 (int)be32_to_cpu(dqp->q_core.d_id));
1440 cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp));
1441 cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount);
1442 cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno);
1443 cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset);
1445 be64_to_cpu(dqp->q_core.d_blk_hardlimit),
1446 (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit));
1448 be64_to_cpu(dqp->q_core.d_blk_softlimit),
1449 (int)be64_to_cpu(dqp->q_core.d_blk_softlimit));
1451 be64_to_cpu(dqp->q_core.d_ino_hardlimit),
1452 (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit));
1454 be64_to_cpu(dqp->q_core.d_ino_softlimit),
1455 (int)be64_to_cpu(dqp->q_core.d_ino_softlimit));
1457 be64_to_cpu(dqp->q_core.d_bcount),
1458 (int)be64_to_cpu(dqp->q_core.d_bcount));
1460 be64_to_cpu(dqp->q_core.d_icount),
1461 (int)be64_to_cpu(dqp->q_core.d_icount));
1463 (int)be32_to_cpu(dqp->q_core.d_btimer));
1465 (int)be32_to_cpu(dqp->q_core.d_itimer));
1476 xfs_dquot_t *dqp)
1478 xfs_mount_t *mp = dqp->q_mount;
1487 bp = xfs_incore(mp->m_ddev_targp, dqp->q_blkno,
1500 xfs_dqflock(dqp);