Skip to contentSkip to conversation

cleanup: use bool as return type for rwsem_is_locked

RFC PATCH In review Pranith Kumar 6 participants 14 messages Jun 5, 2014 – Jun 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 cleanup: use bool as return type for rwsem_is_locked

I see that there are functions like this which basically say:

return 1 if true else return 0. Is it worth cleaning them up? Or is there any reason why this convention is followed?

use bool as the return type. No reason for return type to be int.

---
 include/linux/rwsem-spinlock.h  |    2 +-
 include/linux/rwsem.h           |    2 +-
 kernel/locking/rwsem-spinlock.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
include/linux/rwsem-spinlock.h +1 -1
index d5b13bc..9026d2a 100644
@@ -39,7 +39,7 @@ extern int __down_write_trylock(struct rw_semaphore *sem);
 extern void __up_read(struct rw_semaphore *sem);
 extern void __up_write(struct rw_semaphore *sem);
 extern void __downgrade_write(struct rw_semaphore *sem);
-extern int rwsem_is_locked(struct rw_semaphore *sem);
+extern bool rwsem_is_locked(struct rw_semaphore *sem);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_RWSEM_SPINLOCK_H */
include/linux/rwsem.h +1 -1
index 091d993..04faf87 100644
@@ -49,7 +49,7 @@ extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
 #include <asm/rwsem.h>
 
 /* In all implementations count != 0 means locked */
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
+static inline bool rwsem_is_locked(struct rw_semaphore *sem)
 {
 	return sem->count != 0;
 }
kernel/locking/rwsem-spinlock.c +1 -1
index 9be8a91..7374139 100644
@@ -20,7 +20,7 @@ struct rwsem_waiter {
 	enum rwsem_waiter_type type;
 };
 
-int rwsem_is_locked(struct rw_semaphore *sem)
+bool rwsem_is_locked(struct rw_semaphore *sem)
 {
 	int ret = 1;
 	unsigned long flags;
Signature · 1 line
1.7.9.5
maintainer
#1 lore raw
Quoted 4 lines · Pranith Kumar

I see that there are functions like this which basically say:

return 1 if true else return 0. Is it worth cleaning them up? Or is there any reason why this convention is followed?

Hysterical raisins, a lot of people learnt C before it grew bool, including me.

Quoted 10 lines

use bool as the return type. No reason for return type to be int.

---

kernel/locking/rwsem-spinlock.c +0 -0
index 9be8a91..7374139 100644

kernel/locking/rwsem-spinlock.c struct rwsem_waiter { · line 26

Quoted 8 lines
kernel/locking/rwsem-spinlock.c +1 -1
@@ -20,7 +20,7 @@ struct rwsem_waiter {
 	enum rwsem_waiter_type type;
 };
 
-int rwsem_is_locked(struct rw_semaphore *sem)
+bool rwsem_is_locked(struct rw_semaphore *sem)
 {
 	int ret = 1;
 	unsigned long flags;

Now, see that's a half arsed change, if you change the function return value, you should also change the value we actually return, @ret above to bool, and you should then also change the values used to 'true' and 'false'.

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

#2 lore raw
In reply to Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

use bool as the return type for rwsem_is_locked() instead of int

---
 include/linux/rwsem-spinlock.h  |    2 +-
 include/linux/rwsem.h           |    2 +-
 kernel/locking/rwsem-spinlock.c |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
include/linux/rwsem-spinlock.h +1 -1
index d5b13bc..9026d2a 100644
@@ -39,7 +39,7 @@ extern int __down_write_trylock(struct rw_semaphore *sem);
 extern void __up_read(struct rw_semaphore *sem);
 extern void __up_write(struct rw_semaphore *sem);
 extern void __downgrade_write(struct rw_semaphore *sem);
-extern int rwsem_is_locked(struct rw_semaphore *sem);
+extern bool rwsem_is_locked(struct rw_semaphore *sem);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_RWSEM_SPINLOCK_H */
include/linux/rwsem.h +1 -1
index 03f3b05..b056780 100644
@@ -40,7 +40,7 @@ extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
 #include <asm/rwsem.h>
 
 /* In all implementations count != 0 means locked */
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
+static inline bool rwsem_is_locked(struct rw_semaphore *sem)
 {
 	return sem->count != 0;
 }
kernel/locking/rwsem-spinlock.c +2 -2
index 9be8a91..3f8adf8 100644
@@ -20,9 +20,9 @@ struct rwsem_waiter {
 	enum rwsem_waiter_type type;
 };
 
-int rwsem_is_locked(struct rw_semaphore *sem)
+bool rwsem_is_locked(struct rw_semaphore *sem)
 {
-	int ret = 1;
+	bool ret = true;
 	unsigned long flags;
 
 	if (raw_spin_trylock_irqsave(&sem->wait_lock, flags)) {
Signature · 1 line
1.7.9.5
maintainer
#3 lore raw
Quoted 7 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

still 2 bytes, so sure.

Which gcc did you use and what arch did you build? That might be useful info for the changelog.

#4 lore raw
Quoted 6 lines · Peter Zijlstra
Quoted 1 line

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

still 2 bytes, so sure.

Which gcc did you use and what arch did you build? That might be useful info for the changelog.

I am using gcc (Ubuntu/Linaro 4.7.3-2ubuntu1~12.04) 4.7.3. I tested this using ARCH=um with a Pentium processor to turn on CONFIG_RWSEM_GENERIC_SPINLOCK.

Signature · 1 line
Pranith
#5 lore raw
In reply to Peter Zijlstra
Quoted 7 lines · Peter Zijlstra
Quoted 6 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Quoted 6 lines
Quoted 1 line

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

still 2 bytes, so sure.

Which gcc did you use and what arch did you build? That might be useful info for the changelog.

Yeah, please attach the output of 'size kernel/locking/rwsem.o' for both before and after. I think there's similar opportunity in other locking code as well.

#6 lore raw
Quoted 10 lines · Davidlohr Bueso
Quoted 9 lines · Peter Zijlstra
Quoted 7 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

Quoted 9 lines
Quoted 4 lines

still 2 bytes, so sure.

Which gcc did you use and what arch did you build? That might be useful info for the changelog.

Yeah, please attach the output of 'size kernel/locking/rwsem.o' for both before and after. I think there's similar opportunity in other locking code as well.

Ok. Here is the data.

size kernel/locking/rwsem-spinlock.o

Before change to bool:

text data bss dec hex
1336 0 0 1336 538

After change to bool:

text data bss dec hex
1334 0 0 1334 536

Signature · 1 line
Pranith
#7 lore raw
In reply to Pranith Kumar
Quoted 50 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

use bool as the return type for rwsem_is_locked() instead of int

---
 include/linux/rwsem-spinlock.h  |    2 +-
 include/linux/rwsem.h           |    2 +-
 kernel/locking/rwsem-spinlock.c |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
include/linux/rwsem-spinlock.h +1 -1
index d5b13bc..9026d2a 100644
@@ -39,7 +39,7 @@ extern int __down_write_trylock(struct rw_semaphore *sem);
 extern void __up_read(struct rw_semaphore *sem);
 extern void __up_write(struct rw_semaphore *sem);
 extern void __downgrade_write(struct rw_semaphore *sem);
-extern int rwsem_is_locked(struct rw_semaphore *sem);
+extern bool rwsem_is_locked(struct rw_semaphore *sem);
 
 #endif /* __KERNEL__ */
 #endif /* _LINUX_RWSEM_SPINLOCK_H */
include/linux/rwsem.h +1 -1
index 03f3b05..b056780 100644
@@ -40,7 +40,7 @@ extern struct rw_semaphore *rwsem_downgrade_wake(struct rw_semaphore *sem);
 #include <asm/rwsem.h>
 
 /* In all implementations count != 0 means locked */
-static inline int rwsem_is_locked(struct rw_semaphore *sem)
+static inline bool rwsem_is_locked(struct rw_semaphore *sem)
 {
 	return sem->count != 0;
 }
kernel/locking/rwsem-spinlock.c +0 -0
index 9be8a91..3f8adf8 100644
@@ -20,9 +20,9 @@ struct rwsem_waiter {
 	enum rwsem_waiter_type type;

kernel/locking/rwsem-spinlock.c struct rwsem_waiter { · line 28

Quoted 10 lines
kernel/locking/rwsem-spinlock.c +2 -2
 };
 
-int rwsem_is_locked(struct rw_semaphore *sem)
+bool rwsem_is_locked(struct rw_semaphore *sem)
 {
-	int ret = 1;
+	bool ret = true;
 	unsigned long flags;
 
 	if (raw_spin_trylock_irqsave(&sem->wait_lock, flags)) {

I observed one other user of rwsem_is_locked() in xfs, change accordingly

---
 fs/xfs/xfs_inode.c |    2 +-
 fs/xfs/xfs_inode.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_inode.c +1 -1
index 768087b..9047eda 100644
@@ -285,7 +285,7 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
fs/xfs/xfs_inode.h +1 -1
index f2fcde5..80649a1 100644
@@ -348,7 +348,7 @@ void		xfs_ilock(xfs_inode_t *, uint);
 int		xfs_ilock_nowait(xfs_inode_t *, uint);
 void		xfs_iunlock(xfs_inode_t *, uint);
 void		xfs_ilock_demote(xfs_inode_t *, uint);
-int		xfs_isilocked(xfs_inode_t *, uint);
+bool		xfs_isilocked(xfs_inode_t *, uint);
 uint		xfs_ilock_data_map_shared(struct xfs_inode *);
 uint		xfs_ilock_attr_map_shared(struct xfs_inode *);
 int		xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
Signature · 1 line
1.7.9.5
#8 lore raw
Quoted 7 lines · Pranith Kumar
Quoted 6 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Quoted 5 lines
Quoted 5 lines

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

use bool as the return type for rwsem_is_locked() instead of int

....

Makes sense to me.

Quoted 13 lines

I observed one other user of rwsem_is_locked() in xfs, change accordingly

---
 fs/xfs/xfs_inode.c |    2 +-
 fs/xfs/xfs_inode.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/xfs/xfs_inode.c +0 -0
index 768087b..9047eda 100644

fs/xfs/xfs_inode.c xfs_ilock_demote( · line 291

Quoted 8 lines
fs/xfs/xfs_inode.c +1 -1
@@ -285,7 +285,7 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#9 lore raw
Quoted 10 lines · Dave Chinner
Quoted 9 lines · Pranith Kumar
Quoted 8 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines

use bool as the return type for rwsem_is_locked() instead of int

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

Agreed, please find patch below:

change return type to bool to follow rwsem_is_locked()

---
 fs/xfs/xfs_inode.c | 8 ++++----
 fs/xfs/xfs_inode.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
fs/xfs/xfs_inode.c +4 -4
index a6115fe..c02ac49 100644
@@ -285,25 +285,25 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return !(ip->i_lock.mr_writer == 0);
 		return rwsem_is_locked(&ip->i_lock.mr_lock);
 	}
 
 	if (lock_flags & (XFS_IOLOCK_EXCL|XFS_IOLOCK_SHARED)) {
 		if (!(lock_flags & XFS_IOLOCK_SHARED))
-			return !!ip->i_iolock.mr_writer;
+			return !(ip->i_iolock.mr_writer == 0);
 		return rwsem_is_locked(&ip->i_iolock.mr_lock);
 	}
 
 	ASSERT(0);
-	return 0;
+	return false;
 }
 #endif
 
fs/xfs/xfs_inode.h +1 -1
index f72bffa..efebed6 100644
@@ -346,7 +346,7 @@ void		xfs_ilock(xfs_inode_t *, uint);
 int		xfs_ilock_nowait(xfs_inode_t *, uint);
 void		xfs_iunlock(xfs_inode_t *, uint);
 void		xfs_ilock_demote(xfs_inode_t *, uint);
-int		xfs_isilocked(xfs_inode_t *, uint);
+bool		xfs_isilocked(xfs_inode_t *, uint);
 uint		xfs_ilock_data_map_shared(struct xfs_inode *);
 uint		xfs_ilock_attr_map_shared(struct xfs_inode *);
 int		xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
Signature · 6 lines
1.9.1

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#10 lore raw
Quoted 15 lines · Pranith Kumar
Quoted 14 lines · Dave Chinner
Quoted 11 lines · Pranith Kumar
Quoted 10 lines · Pranith Kumar
Quoted 4 lines · Peter Zijlstra

Now in general, I don't particularly like such superfluous changes, so unless you can show that GCC actually generates better code, I'd prefer to keep things as they are.

Fixed and checked the assembly. It saves us 2 bytes of code, not much. I am not sure if that is worth it :(

use bool as the return type for rwsem_is_locked() instead of int

Quoted 7 lines
Quoted 4 lines

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

Agreed, please find patch below:

Simplify the "!!" condition. This is much simpler. :)

change return type to bool to follow rwsem_is_locked()

---
 fs/xfs/xfs_inode.c | 8 ++++----
 fs/xfs/xfs_inode.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
fs/xfs/xfs_inode.c +4 -4
index a6115fe..c02ac49 100644
@@ -285,25 +285,25 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return (ip->i_lock.mr_writer != 0);
 		return rwsem_is_locked(&ip->i_lock.mr_lock);
 	}
 
 	if (lock_flags & (XFS_IOLOCK_EXCL|XFS_IOLOCK_SHARED)) {
 		if (!(lock_flags & XFS_IOLOCK_SHARED))
-			return !!ip->i_iolock.mr_writer;
+			return (ip->i_iolock.mr_writer != 0);
 		return rwsem_is_locked(&ip->i_iolock.mr_lock);
 	}
 
 	ASSERT(0);
-	return 0;
+	return false;
 }
 #endif
 
fs/xfs/xfs_inode.h +1 -1
index f72bffa..efebed6 100644
@@ -346,7 +346,7 @@ void		xfs_ilock(xfs_inode_t *, uint);
 int		xfs_ilock_nowait(xfs_inode_t *, uint);
 void		xfs_iunlock(xfs_inode_t *, uint);
 void		xfs_ilock_demote(xfs_inode_t *, uint);
-int		xfs_isilocked(xfs_inode_t *, uint);
+bool		xfs_isilocked(xfs_inode_t *, uint);
 uint		xfs_ilock_data_map_shared(struct xfs_inode *);
 uint		xfs_ilock_attr_map_shared(struct xfs_inode *);
 int		xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
Signature · 1 line
1.9.1
#11 lore raw
Quoted 7 lines · Pranith Kumar
Quoted 5 lines · Pranith Kumar
Quoted 3 lines · Dave Chinner

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

Agreed, please find patch below:

Simplify the "!!" condition. This is much simpler. :)

[]

Quoted 6 lines
fs/xfs/xfs_inode.c +0 -0
@@ -285,25 +285,25 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)

fs/xfs/xfs_inode.c xfs_ilock_demote( · line 295

Quoted 10 lines
fs/xfs/xfs_inode.c +2 -2
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return (ip->i_lock.mr_writer != 0);

simpler still would be just removing the !! completely. I presume in no case would it make an actual difference in emitted code.

ie:

			return ip->i_lock.mr_writer;

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#12 lore raw
Quoted 30 lines · Joe Perches
Quoted 7 lines · Pranith Kumar
Quoted 5 lines · Pranith Kumar
Quoted 3 lines · Dave Chinner

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

Agreed, please find patch below:

Simplify the "!!" condition. This is much simpler. :)

[]

Quoted 6 lines
fs/xfs/xfs_inode.c +0 -0
@@ -285,25 +285,25 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)

fs/xfs/xfs_inode.c xfs_ilock_demote( · line 295

Quoted 10 lines
fs/xfs/xfs_inode.c +2 -2
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return (ip->i_lock.mr_writer != 0);

simpler still would be just removing the !! completely. I presume in no case would it make an actual difference in emitted code.

Quoted 2 lines

ie:

			return ip->i_lock.mr_writer;

Yup, that's exactly what I meant. Casting to a bool type does all the work of squashing all non-zero values to 1...

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#13 lore raw
Quoted 11 lines · Dave Chinner
Quoted 10 lines · Joe Perches
Quoted 5 lines · Pranith Kumar
Quoted 4 lines · Pranith Kumar
Quoted 3 lines · Dave Chinner

If you are going to change the return type to bool, then you should also remove the manual "!!" conversions to a boolean return and let the compiler do it in the most optimal way.

simpler still would be just removing the !! completely. I presume in no case would it make an actual difference in emitted code.

Quoted 6 lines
Quoted 2 lines

ie:

			return ip->i_lock.mr_writer;

Yup, that's exactly what I meant. Casting to a bool type does all the work of squashing all non-zero values to 1...

change return type if xfs_isilocked() to bool to follow rwsem_is_locked()

---
 fs/xfs/xfs_inode.c | 8 ++++----
 fs/xfs/xfs_inode.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
fs/xfs/xfs_inode.c +4 -4
index a6115fe..c02ac49 100644
@@ -285,25 +285,25 @@ xfs_ilock_demote(
 }
 
 #if defined(DEBUG) || defined(XFS_WARN)
-int
+bool
 xfs_isilocked(
 	xfs_inode_t		*ip,
 	uint			lock_flags)
 {
 	if (lock_flags & (XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)) {
 		if (!(lock_flags & XFS_ILOCK_SHARED))
-			return !!ip->i_lock.mr_writer;
+			return ip->i_lock.mr_writer;
 		return rwsem_is_locked(&ip->i_lock.mr_lock);
 	}
 
 	if (lock_flags & (XFS_IOLOCK_EXCL|XFS_IOLOCK_SHARED)) {
 		if (!(lock_flags & XFS_IOLOCK_SHARED))
-			return !!ip->i_iolock.mr_writer;
+			return ip->i_iolock.mr_writer;
 		return rwsem_is_locked(&ip->i_iolock.mr_lock);
 	}
 
 	ASSERT(0);
-	return 0;
+	return false;
 }
 #endif
 
fs/xfs/xfs_inode.h +1 -1
index f72bffa..efebed6 100644
@@ -346,7 +346,7 @@ void		xfs_ilock(xfs_inode_t *, uint);
 int		xfs_ilock_nowait(xfs_inode_t *, uint);
 void		xfs_iunlock(xfs_inode_t *, uint);
 void		xfs_ilock_demote(xfs_inode_t *, uint);
-int		xfs_isilocked(xfs_inode_t *, uint);
+bool		xfs_isilocked(xfs_inode_t *, uint);
 uint		xfs_ilock_data_map_shared(struct xfs_inode *);
 uint		xfs_ilock_attr_map_shared(struct xfs_inode *);
 int		xfs_ialloc(struct xfs_trans *, xfs_inode_t *, umode_t,
Signature · 1 line
1.9.1