diff options
author | Christoph Hellwig <hch@infradead.org> | 2011-12-06 21:58:22 +0000 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2011-12-15 14:37:32 -0600 |
commit | 78e55892d65ea69fbf252e086375d0d8f081b6c8 (patch) | |
tree | 7f115cdcd97b5dfa6826f8c27427d4061a97591f /fs/xfs/xfs_dquot.h | |
parent | ab680bb739ca0e969148951c2e127f6683dcb933 (diff) | |
download | linux-78e55892d65ea69fbf252e086375d0d8f081b6c8.tar.gz linux-78e55892d65ea69fbf252e086375d0d8f081b6c8.tar.bz2 linux-78e55892d65ea69fbf252e086375d0d8f081b6c8.zip |
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 { XFS_QLOCK_NESTED, }; -#define XFS_DQHOLD(dqp) ((dqp)->q_nrefs++) - /* * Manage the q_flush completion queue embedded in the dquot. This completion * 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 *); extern void xfs_dqunlock(struct xfs_dquot *); extern void xfs_dqflock_pushbuf_wait(struct xfs_dquot *dqp); +static inline struct xfs_dquot *xfs_qm_dqhold(struct xfs_dquot *dqp) +{ + xfs_dqlock(dqp); + dqp->q_nrefs++; + xfs_dqunlock(dqp); + return dqp; +} + #endif /* __XFS_DQUOT_H__ */ |