|
44 | 44 | * |
45 | 45 | * ip->i_lock |
46 | 46 | * qi->qi_tree_lock |
47 | | - * qi->qi_dqlist_lock |
48 | | - * dquot->q_qlock (xfs_dqlock() and friends) |
49 | | - * dquot->q_flush (xfs_dqflock() and friends) |
50 | | - * qi->qi_lru_lock |
| 47 | + * dquot->q_qlock (xfs_dqlock() and friends) |
| 48 | + * dquot->q_flush (xfs_dqflock() and friends) |
| 49 | + * qi->qi_lru_lock |
51 | 50 | * |
52 | 51 | * If two dquots need to be locked the order is user before group/project, |
53 | 52 | * otherwise by the lowest id first, see xfs_dqlock2. |
@@ -728,21 +727,13 @@ xfs_qm_dqget( |
728 | 727 | goto restart; |
729 | 728 | } |
730 | 729 |
|
731 | | - /* |
732 | | - * Attach this dquot to this filesystem's list of all dquots, |
733 | | - * kept inside the mount structure in m_quotainfo field |
734 | | - */ |
735 | | - mutex_lock(&qi->qi_dqlist_lock); |
736 | | - |
737 | 730 | /* |
738 | 731 | * We return a locked dquot to the caller, with a reference taken |
739 | 732 | */ |
740 | 733 | xfs_dqlock(dqp); |
741 | 734 | dqp->q_nrefs = 1; |
742 | 735 |
|
743 | | - list_add(&dqp->q_mplist, &qi->qi_dqlist); |
744 | 736 | qi->qi_dquots++; |
745 | | - mutex_unlock(&qi->qi_dqlist_lock); |
746 | 737 | mutex_unlock(&qi->qi_tree_lock); |
747 | 738 |
|
748 | 739 | dqret: |
@@ -1017,86 +1008,6 @@ xfs_dqlock2( |
1017 | 1008 | } |
1018 | 1009 | } |
1019 | 1010 |
|
1020 | | -/* |
1021 | | - * Take a dquot out of the mount's dqlist as well as the hashlist. This is |
1022 | | - * called via unmount as well as quotaoff, and the purge will always succeed. |
1023 | | - */ |
1024 | | -void |
1025 | | -xfs_qm_dqpurge( |
1026 | | - struct xfs_dquot *dqp) |
1027 | | -{ |
1028 | | - struct xfs_mount *mp = dqp->q_mount; |
1029 | | - struct xfs_quotainfo *qi = mp->m_quotainfo; |
1030 | | - |
1031 | | - xfs_dqlock(dqp); |
1032 | | - |
1033 | | - /* |
1034 | | - * If we're turning off quotas, we have to make sure that, for |
1035 | | - * example, we don't delete quota disk blocks while dquots are |
1036 | | - * in the process of getting written to those disk blocks. |
1037 | | - * This dquot might well be on AIL, and we can't leave it there |
1038 | | - * if we're turning off quotas. Basically, we need this flush |
1039 | | - * lock, and are willing to block on it. |
1040 | | - */ |
1041 | | - if (!xfs_dqflock_nowait(dqp)) { |
1042 | | - /* |
1043 | | - * Block on the flush lock after nudging dquot buffer, |
1044 | | - * if it is incore. |
1045 | | - */ |
1046 | | - xfs_dqflock_pushbuf_wait(dqp); |
1047 | | - } |
1048 | | - |
1049 | | - /* |
1050 | | - * If we are turning this type of quotas off, we don't care |
1051 | | - * about the dirty metadata sitting in this dquot. OTOH, if |
1052 | | - * we're unmounting, we do care, so we flush it and wait. |
1053 | | - */ |
1054 | | - if (XFS_DQ_IS_DIRTY(dqp)) { |
1055 | | - int error; |
1056 | | - |
1057 | | - /* |
1058 | | - * We don't care about getting disk errors here. We need |
1059 | | - * to purge this dquot anyway, so we go ahead regardless. |
1060 | | - */ |
1061 | | - error = xfs_qm_dqflush(dqp, SYNC_WAIT); |
1062 | | - if (error) |
1063 | | - xfs_warn(mp, "%s: dquot %p flush failed", |
1064 | | - __func__, dqp); |
1065 | | - xfs_dqflock(dqp); |
1066 | | - } |
1067 | | - |
1068 | | - ASSERT(atomic_read(&dqp->q_pincount) == 0); |
1069 | | - ASSERT(XFS_FORCED_SHUTDOWN(mp) || |
1070 | | - !(dqp->q_logitem.qli_item.li_flags & XFS_LI_IN_AIL)); |
1071 | | - |
1072 | | - xfs_dqfunlock(dqp); |
1073 | | - xfs_dqunlock(dqp); |
1074 | | - |
1075 | | - mutex_lock(&qi->qi_tree_lock); |
1076 | | - radix_tree_delete(XFS_DQUOT_TREE(qi, dqp->q_core.d_flags), |
1077 | | - be32_to_cpu(dqp->q_core.d_id)); |
1078 | | - mutex_unlock(&qi->qi_tree_lock); |
1079 | | - |
1080 | | - mutex_lock(&qi->qi_dqlist_lock); |
1081 | | - list_del_init(&dqp->q_mplist); |
1082 | | - qi->qi_dqreclaims++; |
1083 | | - qi->qi_dquots--; |
1084 | | - mutex_unlock(&qi->qi_dqlist_lock); |
1085 | | - |
1086 | | - /* |
1087 | | - * We move dquots to the freelist as soon as their reference count |
1088 | | - * hits zero, so it really should be on the freelist here. |
1089 | | - */ |
1090 | | - mutex_lock(&qi->qi_lru_lock); |
1091 | | - ASSERT(!list_empty(&dqp->q_lru)); |
1092 | | - list_del_init(&dqp->q_lru); |
1093 | | - qi->qi_lru_count--; |
1094 | | - XFS_STATS_DEC(xs_qm_dquot_unused); |
1095 | | - mutex_unlock(&qi->qi_lru_lock); |
1096 | | - |
1097 | | - xfs_qm_dqdestroy(dqp); |
1098 | | -} |
1099 | | - |
1100 | 1011 | /* |
1101 | 1012 | * Give the buffer a little push if it is incore and |
1102 | 1013 | * wait on the flush lock. |
|
0 commit comments