aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dquot.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2011-12-06 16:58:14 -0500
committerBen Myers <bpm@sgi.com>2011-12-12 18:28:20 -0500
commit800b484ec0262946262ad20561a8081fd31f4a6f (patch)
tree41bc447ef77f21546e03d975017c11cb3d1a1a4d /fs/xfs/xfs_dquot.h
parenta7ef9bd79f488c643edfda7dedcbdb0a1b8e7552 (diff)
xfs: cleanup dquot locking helpers
Mark the trivial lock wrappers as inline, and make the naming consistent for all of them. 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.h25
1 files changed, 19 insertions, 6 deletions
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index 34b7e945dbfa..0b5d2ae92028 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -102,6 +102,21 @@ static inline void xfs_dqfunlock(xfs_dquot_t *dqp)
102 complete(&dqp->q_flush); 102 complete(&dqp->q_flush);
103} 103}
104 104
105static inline int xfs_dqlock_nowait(struct xfs_dquot *dqp)
106{
107 return mutex_trylock(&dqp->q_qlock);
108}
109
110static inline void xfs_dqlock(struct xfs_dquot *dqp)
111{
112 mutex_lock(&dqp->q_qlock);
113}
114
115static inline void xfs_dqunlock_nonotify(struct xfs_dquot *dqp)
116{
117 mutex_unlock(&dqp->q_qlock);
118}
119
105#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock))) 120#define XFS_DQ_IS_LOCKED(dqp) (mutex_is_locked(&((dqp)->q_qlock)))
106#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) 121#define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY)
107#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER) 122#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
@@ -120,8 +135,6 @@ extern void xfs_qm_dqdestroy(xfs_dquot_t *);
120extern int xfs_qm_dqflush(xfs_dquot_t *, uint); 135extern int xfs_qm_dqflush(xfs_dquot_t *, uint);
121extern int xfs_qm_dqpurge(xfs_dquot_t *); 136extern int xfs_qm_dqpurge(xfs_dquot_t *);
122extern void xfs_qm_dqunpin_wait(xfs_dquot_t *); 137extern void xfs_qm_dqunpin_wait(xfs_dquot_t *);
123extern int xfs_qm_dqlock_nowait(xfs_dquot_t *);
124extern void xfs_qm_dqflock_pushbuf_wait(xfs_dquot_t *dqp);
125extern void xfs_qm_adjust_dqtimers(xfs_mount_t *, 138extern void xfs_qm_adjust_dqtimers(xfs_mount_t *,
126 xfs_disk_dquot_t *); 139 xfs_disk_dquot_t *);
127extern void xfs_qm_adjust_dqlimits(xfs_mount_t *, 140extern void xfs_qm_adjust_dqlimits(xfs_mount_t *,
@@ -129,9 +142,9 @@ extern void xfs_qm_adjust_dqlimits(xfs_mount_t *,
129extern int xfs_qm_dqget(xfs_mount_t *, xfs_inode_t *, 142extern int xfs_qm_dqget(xfs_mount_t *, xfs_inode_t *,
130 xfs_dqid_t, uint, uint, xfs_dquot_t **); 143 xfs_dqid_t, uint, uint, xfs_dquot_t **);
131extern void xfs_qm_dqput(xfs_dquot_t *); 144extern void xfs_qm_dqput(xfs_dquot_t *);
132extern void xfs_dqlock(xfs_dquot_t *); 145
133extern void xfs_dqlock2(xfs_dquot_t *, xfs_dquot_t *); 146extern void xfs_dqlock2(struct xfs_dquot *, struct xfs_dquot *);
134extern void xfs_dqunlock(xfs_dquot_t *); 147extern void xfs_dqunlock(struct xfs_dquot *);
135extern void xfs_dqunlock_nonotify(xfs_dquot_t *); 148extern void xfs_dqflock_pushbuf_wait(struct xfs_dquot *dqp);
136 149
137#endif /* __XFS_DQUOT_H__ */ 150#endif /* __XFS_DQUOT_H__ */