diff options
author | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:36:19 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2011-07-08 08:36:19 -0400 |
commit | 0c842ad46a51891ac4420b7285613f4134a65ccd (patch) | |
tree | cf82cc7853821a21998114d20b1297b14061eade /fs/xfs/xfs_buf_item.c | |
parent | bbb4197c73be356a052dac25cce5ed0c157c6c90 (diff) |
xfs: clean up buffer locking helpers
Rename xfs_buf_cond_lock and reverse it's return value to fit most other
trylock operations in the Kernel and XFS (with the exception of down_trylock,
after which xfs_buf_cond_lock was modelled), and replace xfs_buf_lock_val
with an xfs_buf_islocked for use in asserts, or and opencoded variant in
tracing. remove the XFS_BUF_* wrappers for all the locking helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_buf_item.c')
-rw-r--r-- | fs/xfs/xfs_buf_item.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index 7b7e005e3dcc..da399ac4411d 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c | |||
@@ -420,7 +420,7 @@ xfs_buf_item_unpin( | |||
420 | 420 | ||
421 | if (freed && stale) { | 421 | if (freed && stale) { |
422 | ASSERT(bip->bli_flags & XFS_BLI_STALE); | 422 | ASSERT(bip->bli_flags & XFS_BLI_STALE); |
423 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 423 | ASSERT(xfs_buf_islocked(bp)); |
424 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); | 424 | ASSERT(!(XFS_BUF_ISDELAYWRITE(bp))); |
425 | ASSERT(XFS_BUF_ISSTALE(bp)); | 425 | ASSERT(XFS_BUF_ISSTALE(bp)); |
426 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); | 426 | ASSERT(bip->bli_format.blf_flags & XFS_BLF_CANCEL); |
@@ -483,7 +483,7 @@ xfs_buf_item_trylock( | |||
483 | 483 | ||
484 | if (XFS_BUF_ISPINNED(bp)) | 484 | if (XFS_BUF_ISPINNED(bp)) |
485 | return XFS_ITEM_PINNED; | 485 | return XFS_ITEM_PINNED; |
486 | if (!XFS_BUF_CPSEMA(bp)) | 486 | if (!xfs_buf_trylock(bp)) |
487 | return XFS_ITEM_LOCKED; | 487 | return XFS_ITEM_LOCKED; |
488 | 488 | ||
489 | /* take a reference to the buffer. */ | 489 | /* take a reference to the buffer. */ |
@@ -905,7 +905,7 @@ xfs_buf_attach_iodone( | |||
905 | xfs_log_item_t *head_lip; | 905 | xfs_log_item_t *head_lip; |
906 | 906 | ||
907 | ASSERT(XFS_BUF_ISBUSY(bp)); | 907 | ASSERT(XFS_BUF_ISBUSY(bp)); |
908 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 908 | ASSERT(xfs_buf_islocked(bp)); |
909 | 909 | ||
910 | lip->li_cb = cb; | 910 | lip->li_cb = cb; |
911 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { | 911 | if (XFS_BUF_FSPRIVATE(bp, void *) != NULL) { |