Skip to contentSkip to conversation

btrfs: don't include '<linux/rwlock_types.h>' directly

PATCH In review Wolfram Sang 3 participants 4 messages Dec 17, 2024 – Dec 23, 2024 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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
index 79a1a3d6f04d..78e558652908 100644
@@ -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
#1 lore raw
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.

---
  fs/btrfs/fs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/fs.h +0 -0
index 79a1a3d6f04d..78e558652908 100644

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>
#2 lore raw

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.h will include linux/rwlock.h, and spinlock_types.h unconditionally.

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

#3 lore raw
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.h is enough.

I've updated the fix to drop rwlock_types.h as spinlock.h is already there. Added to for-next, thanks.