Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 294597
b: refs/heads/master
c: 3673141
h: refs/heads/master
i:
  294595: 84da3a0
v: v3
  • Loading branch information
Chandra Seetharaman authored and Ben Myers committed Feb 3, 2012
1 parent 246d09c commit b88b169
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 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: 6967b964c1012231f338445f20f877e680cd4cb8
refs/heads/master: 36731410834e08c7d15c3980abd6cc4c563c2e87
33 changes: 9 additions & 24 deletions trunk/fs/xfs/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ xfs_qm_dqget(
uint flags, /* DQALLOC, DQSUSER, DQREPAIR, DOWARN */
xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */
{
xfs_dquot_t *dqp;
xfs_dquot_t *dqp, *dqp1;
xfs_dqhash_t *h;
uint version;
int error;
Expand All @@ -750,10 +750,7 @@ xfs_qm_dqget(
type == XFS_DQ_GROUP);
if (ip) {
ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
if (type == XFS_DQ_USER)
ASSERT(ip->i_udquot == NULL);
else
ASSERT(ip->i_gdquot == NULL);
ASSERT(xfs_inode_dquot(ip, type) == NULL);
}
#endif

Expand Down Expand Up @@ -819,30 +816,18 @@ xfs_qm_dqget(
* A dquot could be attached to this inode by now, since
* we had dropped the ilock.
*/
if (type == XFS_DQ_USER) {
if (!XFS_IS_UQUOTA_ON(mp)) {
/* inode stays locked on return */
xfs_qm_dqdestroy(dqp);
return XFS_ERROR(ESRCH);
}
if (ip->i_udquot) {
if (xfs_this_quota_on(mp, type)) {
dqp1 = xfs_inode_dquot(ip, type);
if (dqp1) {
xfs_qm_dqdestroy(dqp);
dqp = ip->i_udquot;
dqp = dqp1;
xfs_dqlock(dqp);
goto dqret;
}
} else {
if (!XFS_IS_OQUOTA_ON(mp)) {
/* inode stays locked on return */
xfs_qm_dqdestroy(dqp);
return XFS_ERROR(ESRCH);
}
if (ip->i_gdquot) {
xfs_qm_dqdestroy(dqp);
dqp = ip->i_gdquot;
xfs_dqlock(dqp);
goto dqret;
}
/* inode stays locked on return */
xfs_qm_dqdestroy(dqp);
return XFS_ERROR(ESRCH);
}
}

Expand Down
13 changes: 13 additions & 0 deletions trunk/fs/xfs/xfs_dquot.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@ static inline int xfs_this_quota_on(struct xfs_mount *mp, int type)
}
}

static inline xfs_dquot_t *xfs_inode_dquot(struct xfs_inode *ip, int type)
{
switch (type & XFS_DQ_ALLTYPES) {
case XFS_DQ_USER:
return ip->i_udquot;
case XFS_DQ_GROUP:
case XFS_DQ_PROJ:
return ip->i_gdquot;
default:
return NULL;
}
}

#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock)))
#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY)
#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
Expand Down

0 comments on commit b88b169

Please sign in to comment.