down_trylock -> down_try in xfs

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: xfs@oss.sgi.com
---
 fs/xfs/linux-2.6/sema.h    |    8 +++-----
 fs/xfs/linux-2.6/xfs_buf.c |    4 ++--
 2 files changed, 5 insertions(+), 7 deletions(-)

diff -r c4dfb28595bc fs/xfs/linux-2.6/sema.h
--- a/fs/xfs/linux-2.6/sema.h	Mon May 05 10:27:58 2008 +1000
+++ b/fs/xfs/linux-2.6/sema.h	Mon May 05 10:32:36 2008 +1000
@@ -36,17 +36,15 @@ typedef struct semaphore sema_t;
 
 static inline int issemalocked(sema_t *sp)
 {
-	return down_trylock(sp) || (up(sp), 0);
+	return !down_try(sp) || (up(sp), 0);
 }
 
 /*
- * Map cpsema (try to get the sema) to down_trylock. We need to switch
- * the return values since cpsema returns 1 (acquired) 0 (failed) and
- * down_trylock returns the reverse 0 (acquired) 1 (failed).
+ * Map cpsema (try to get the sema) to down_try.
  */
 static inline int cpsema(sema_t *sp)
 {
-	return down_trylock(sp) ? 0 : 1;
+	return down_try(sp);
 }
 
 #endif /* __XFS_SUPPORT_SEMA_H__ */
diff -r c4dfb28595bc fs/xfs/linux-2.6/xfs_buf.c
--- a/fs/xfs/linux-2.6/xfs_buf.c	Mon May 05 10:27:58 2008 +1000
+++ b/fs/xfs/linux-2.6/xfs_buf.c	Mon May 05 10:32:36 2008 +1000
@@ -530,7 +530,7 @@ found:
 	 * if this does not work then we need to drop the
 	 * spinlock and do a hard attempt on the semaphore.
 	 */
-	if (down_trylock(&bp->b_sema)) {
+	if (!down_try(&bp->b_sema)) {
 		if (!(flags & XBF_TRYLOCK)) {
 			/* wait for buffer ownership */
 			XB_TRACE(bp, "get_lock", 0);
@@ -873,7 +873,7 @@ xfs_buf_cond_lock(
 {
 	int			locked;
 
-	locked = down_trylock(&bp->b_sema) == 0;
+	locked = down_try(&bp->b_sema);
 	if (locked) {
 		XB_SET_OWNER(bp);
 	}
