btrfs: don't include '<linux/rwlock_types.h>' directly
PATCH 1/1 btrfs: don't include '<linux/rwlock_types.h>' directly
The header clearly states that it does not want to be included directly, only via '<linux/spinlock_types.h>'. Replace the include accordingly.
--- fs/btrfs/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/fs.h +1 -1
@@ -14,7 +14,7 @@#include <linux/lockdep.h> #include <linux/spinlock.h> #include <linux/mutex.h> -#include <linux/rwlock_types.h> +#include <linux/spinlock_types.h> #include <linux/rwsem.h> #include <linux/semaphore.h> #include <linux/list.h>
Signature · 1 line
2.45.2
Quoted 13 lines · Wolfram Sang
The header clearly states that it does not want to be included directly, only via '<
linux/spinlock_types.h>'. Replace the include accordingly.Signed-off-by Wolfram Sang <[email protected]>--- fs/btrfs/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/btrfs/fs.h +0
-0
fs/btrfs/fs.h line 17
Quoted 5 lines
fs/btrfs/fs.h +1
-1@@ -14,7 +14,7 @@#include <linux/lockdep.h> #include <linux/spinlock.h> #include <linux/mutex.h> -#include <linux/rwlock_types.h> +#include <linux/spinlock_types.h>
I think we can just remove the *_type.h include header completely.
For non-RT build, spinlock.h will include linux/rwlock.h, and spinlock_types.h unconditionally.
Thanks,
Qu
Quoted 3 lines
fs/btrfs/fs.h +0
-0#include <linux/rwsem.h> #include <linux/semaphore.h> #include <linux/list.h>
Hi,
Quoted 4 lines
fs/btrfs/fs.h line 17
Quoted 2 lines
fs/btrfs/fs.h +1
-1-#include <linux/rwlock_types.h> +#include <linux/spinlock_types.h> I think we can just remove the *_type.h include header completely.
I agree, spinlock.h is enough.
Quoted 2 lines
For non-RT build,
spinlock.hwill includelinux/rwlock.h, andspinlock_types.hunconditionally.
Yet, isn't it always included unconditionally?
spinlock.h -> spinlock_types.h -> rwlock_types.h
I don't see any conditionals there.
Thanks for the review and happy hacking,
Wolfram
Quoted 8 lines · Wolfram Sang
Hi,
Quoted 4 lines
fs/btrfs/fs.h line 17
Quoted 2 lines
fs/btrfs/fs.h +1
-1-#include <linux/rwlock_types.h> +#include <linux/spinlock_types.h> I think we can just remove the *_type.h include header completely.
I agree,
spinlock.his enough.
I've updated the fix to drop rwlock_types.h as spinlock.h is already there. Added to for-next, thanks.