Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 195787
b: refs/heads/master
c: 3a25404
h: refs/heads/master
i:
  195785: 124a2ca
  195783: 78c8a30
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed May 19, 2010
1 parent f57bdfc commit e5ab375
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 113 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9abbc539bf7f299819ad0a235064a1b643ab6407
refs/heads/master: 3a25404b3fccd41d36b2fda18d86011201608c38
21 changes: 12 additions & 9 deletions trunk/fs/xfs/quota/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ xfs_qm_dqinit(
*/
dqp->q_nrefs = 0;
dqp->q_blkno = 0;
dqp->MPL_NEXT = dqp->HL_NEXT = NULL;
dqp->HL_PREVP = dqp->MPL_PREVP = NULL;
INIT_LIST_HEAD(&dqp->q_mplist);
dqp->HL_NEXT = NULL;
dqp->HL_PREVP = NULL;
dqp->q_bufoffset = 0;
dqp->q_fileoffset = 0;
dqp->q_transp = NULL;
Expand Down Expand Up @@ -772,7 +773,7 @@ xfs_qm_dqlookup(
/*
* All in core dquots must be on the dqlist of mp
*/
ASSERT(dqp->MPL_PREVP != NULL);
ASSERT(!list_empty(&dqp->q_mplist));

xfs_dqlock(dqp);
if (dqp->q_nrefs == 0) {
Expand Down Expand Up @@ -1039,17 +1040,17 @@ xfs_qm_dqget(
* Attach this dquot to this filesystem's list of all dquots,
* kept inside the mount structure in m_quotainfo field
*/
xfs_qm_mplist_lock(mp);
mutex_lock(&mp->m_quotainfo->qi_dqlist_lock);

/*
* We return a locked dquot to the caller, with a reference taken
*/
xfs_dqlock(dqp);
dqp->q_nrefs = 1;

XQM_MPLIST_INSERT(&(XFS_QI_MPL_LIST(mp)), dqp);

xfs_qm_mplist_unlock(mp);
list_add(&dqp->q_mplist, &mp->m_quotainfo->qi_dqlist);
mp->m_quotainfo->qi_dquots++;
mutex_unlock(&mp->m_quotainfo->qi_dqlist_lock);
mutex_unlock(&h->qh_lock);
dqret:
ASSERT((ip == NULL) || xfs_isilocked(ip, XFS_ILOCK_EXCL));
Expand Down Expand Up @@ -1389,7 +1390,7 @@ xfs_qm_dqpurge(
xfs_dqhash_t *thishash;
xfs_mount_t *mp = dqp->q_mount;

ASSERT(XFS_QM_IS_MPLIST_LOCKED(mp));
ASSERT(mutex_is_locked(&mp->m_quotainfo->qi_dqlist_lock));
ASSERT(mutex_is_locked(&dqp->q_hash->qh_lock));

xfs_dqlock(dqp);
Expand Down Expand Up @@ -1454,7 +1455,9 @@ xfs_qm_dqpurge(

thishash = dqp->q_hash;
XQM_HASHLIST_REMOVE(thishash, dqp);
XQM_MPLIST_REMOVE(&(XFS_QI_MPL_LIST(mp)), dqp);
list_del_init(&dqp->q_mplist);
mp->m_quotainfo->qi_dqreclaims++;
mp->m_quotainfo->qi_dquots--;
/*
* XXX Move this to the front of the freelist, if we can get the
* freelist lock.
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/quota/xfs_dquot.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ struct xfs_trans;
typedef struct xfs_dqmarker {
struct xfs_dquot*dqm_flnext; /* link to freelist: must be first */
struct xfs_dquot*dqm_flprev;
xfs_dqlink_t dqm_mplist; /* link to mount's list of dquots */
xfs_dqlink_t dqm_hashlist; /* link to the hash chain */
uint dqm_flags; /* various flags (XFS_DQ_*) */
} xfs_dqmarker_t;
Expand All @@ -67,6 +66,7 @@ typedef struct xfs_dqmarker {
*/
typedef struct xfs_dquot {
xfs_dqmarker_t q_lists; /* list ptrs, q_flags (marker) */
struct list_head q_mplist; /* mount's list of dquots */
xfs_dqhash_t *q_hash; /* the hashchain header */
struct xfs_mount*q_mount; /* filesystem this relates to */
struct xfs_trans*q_transp; /* trans this belongs to currently */
Expand Down
Loading

0 comments on commit e5ab375

Please sign in to comment.