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_log.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_log.c')
-rw-r--r-- | fs/xfs/xfs_log.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 5b24a71811f8..68e053ea6e78 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -1059,7 +1059,7 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1059 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); | 1059 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); |
1060 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); | 1060 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); |
1061 | ASSERT(XFS_BUF_ISBUSY(bp)); | 1061 | ASSERT(XFS_BUF_ISBUSY(bp)); |
1062 | ASSERT(XFS_BUF_VALUSEMA(bp) <= 0); | 1062 | ASSERT(xfs_buf_islocked(bp)); |
1063 | log->l_xbuf = bp; | 1063 | log->l_xbuf = bp; |
1064 | 1064 | ||
1065 | spin_lock_init(&log->l_icloglock); | 1065 | spin_lock_init(&log->l_icloglock); |
@@ -1090,7 +1090,7 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1090 | log->l_iclog_size, 0); | 1090 | log->l_iclog_size, 0); |
1091 | if (!bp) | 1091 | if (!bp) |
1092 | goto out_free_iclog; | 1092 | goto out_free_iclog; |
1093 | if (!XFS_BUF_CPSEMA(bp)) | 1093 | if (!xfs_buf_trylock(bp)) |
1094 | ASSERT(0); | 1094 | ASSERT(0); |
1095 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); | 1095 | XFS_BUF_SET_IODONE_FUNC(bp, xlog_iodone); |
1096 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); | 1096 | XFS_BUF_SET_FSPRIVATE2(bp, (unsigned long)1); |
@@ -1118,7 +1118,7 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1118 | iclog->ic_datap = (char *)iclog->ic_data + log->l_iclog_hsize; | 1118 | iclog->ic_datap = (char *)iclog->ic_data + log->l_iclog_hsize; |
1119 | 1119 | ||
1120 | ASSERT(XFS_BUF_ISBUSY(iclog->ic_bp)); | 1120 | ASSERT(XFS_BUF_ISBUSY(iclog->ic_bp)); |
1121 | ASSERT(XFS_BUF_VALUSEMA(iclog->ic_bp) <= 0); | 1121 | ASSERT(xfs_buf_islocked(iclog->ic_bp)); |
1122 | init_waitqueue_head(&iclog->ic_force_wait); | 1122 | init_waitqueue_head(&iclog->ic_force_wait); |
1123 | init_waitqueue_head(&iclog->ic_write_wait); | 1123 | init_waitqueue_head(&iclog->ic_write_wait); |
1124 | 1124 | ||