diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-12-06 16:58:22 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2011-12-15 15:37:32 -0500 |
commit | 78e55892d65ea69fbf252e086375d0d8f081b6c8 (patch) | |
tree | 7f115cdcd97b5dfa6826f8c27427d4061a97591f /fs/xfs/xfs_dquot.h | |
parent | ab680bb739ca0e969148951c2e127f6683dcb933 (diff) |
xfs: add a xfs_dqhold helper
Factor the common pattern of:
xfs_dqlock(dqp);
XFS_DQHOLD(dqp);
xfs_dqunlock(dqp);
into a new helper, and remove XFS_DQHOLD now that only one other caller
is left.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dquot.h')
-rw-r--r-- | fs/xfs/xfs_dquot.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h index 98488dfe442f..cc0149d217ba 100644 --- a/fs/xfs/xfs_dquot.h +++ b/fs/xfs/xfs_dquot.h | |||
@@ -80,8 +80,6 @@ enum { | |||
80 | XFS_QLOCK_NESTED, | 80 | XFS_QLOCK_NESTED, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #define XFS_DQHOLD(dqp) ((dqp)->q_nrefs++) | ||
84 | |||
85 | /* | 83 | /* |
86 | * Manage the q_flush completion queue embedded in the dquot. This completion | 84 | * Manage the q_flush completion queue embedded in the dquot. This completion |
87 | * queue synchronizes processes attempting to flush the in-core dquot back to | 85 | * queue synchronizes processes attempting to flush the in-core dquot back to |
@@ -147,4 +145,12 @@ extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *); | |||
147 | extern void xfs_dqunlock(struct xfs_dquot *); | 145 | extern void xfs_dqunlock(struct xfs_dquot *); |
148 | extern void xfs_dqflock_pushbuf_wait(struct xfs_dquot *dqp); | 146 | extern void xfs_dqflock_pushbuf_wait(struct xfs_dquot *dqp); |
149 | 147 | ||
148 | static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) | ||
149 | { | ||
150 | xfs_dqlock(dqp); | ||
151 | dqp->q_nrefs++; | ||
152 | xfs_dqunlock(dqp); | ||
153 | return dqp; | ||
154 | } | ||
155 | |||
150 | #endif /* __XFS_DQUOT_H__ */ | 156 | #endif /* __XFS_DQUOT_H__ */ |