History

block: simplify sb_is_blkdev_sb

Just use IS_ENABLED instead of providing a stub for !CONFIG_BLOCK.

Christoph Hellwig committed 6 years ago

Commit dd0dca21 parent 75362a11 file · +6 −12Browse files

Showing the changes to include/linux (1 of 1 file). Show all

Unified · Split

include/linux/fs.h+6−12
@@ -2557,6 +2557,12 @@ extern struct kmem_cache *names_cachep; · 2556 unmodified lines
25572557 #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL)
25582558 #define __putname(name) kmem_cache_free(names_cachep, (void *)(name))
25592559
2560+extern struct super_block *blockdev_superblock;
2561+static inline bool sb_is_blkdev_sb(struct super_block *sb)
2562+{
2563+ return IS_ENABLED(CONFIG_BLOCK) && sb == blockdev_superblock;
2564+}
2565+
25602566 #ifdef CONFIG_BLOCK
25612567 extern int register_blkdev(unsigned int, const char *);
25622568 extern void unregister_blkdev(unsigned int, const char *);
@@ -2572,13 +2578,6 @@ extern struct super_block *freeze_bdev(struct block_device *); · 9 unmodified lines
25722578 extern void emergency_thaw_bdev(struct super_block *sb);
25732579 extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
25742580 extern int fsync_bdev(struct block_device *);
2575−
2576−extern struct super_block *blockdev_superblock;
2577−
2578−static inline bool sb_is_blkdev_sb(struct super_block *sb)
2579−{
2580− return sb == blockdev_superblock;
2581−}
25822581 #else
25832582 static inline void bd_forget(struct inode *inode) {}
25842583 static inline int sync_blockdev(struct block_device *bdev) { return 0; }
@@ -2602,11 +2601,6 @@ static inline int emergency_thaw_bdev(struct super_block *sb) · 17 unmodified lines
26022601 static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
26032602 {
26042603 }
2605−
2606−static inline bool sb_is_blkdev_sb(struct super_block *sb)
2607−{
2608− return false;
2609−}
26102604 #endif
26112605 void emergency_thaw_all(void);
26122606 extern int sync_filesystem(struct super_block *);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t