Just use IS_ENABLED instead of providing a stub for !CONFIG_BLOCK.
Showing the changes to include/linux (1 of 1 file). Show all
Unified · Split
| @@ -2557,6 +2557,12 @@ extern struct kmem_cache *names_cachep; · 2556 unmodified lines | |||
| 2557 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) | 2557 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) |
| 2558 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | 2558 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) |
| 2559 | 2559 | ||
| 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 | |||
| 2560 | #ifdef CONFIG_BLOCK | 2566 | #ifdef CONFIG_BLOCK |
| 2561 | extern int register_blkdev(unsigned int, const char *); | 2567 | extern int register_blkdev(unsigned int, const char *); |
| 2562 | extern void unregister_blkdev(unsigned int, const char *); | 2568 | extern void unregister_blkdev(unsigned int, const char *); |
| @@ -2572,13 +2578,6 @@ extern struct super_block *freeze_bdev(struct block_device *); · 9 unmodified lines | |||
| 2572 | extern void emergency_thaw_bdev(struct super_block *sb); | 2578 | extern void emergency_thaw_bdev(struct super_block *sb); |
| 2573 | extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); | 2579 | extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); |
| 2574 | extern int fsync_bdev(struct block_device *); | 2580 | 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 | } | ||
| 2582 | #else | 2581 | #else |
| 2583 | static inline void bd_forget(struct inode *inode) {} | 2582 | static inline void bd_forget(struct inode *inode) {} |
| 2584 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } | 2583 | 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 | |||
| 2602 | static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) | 2601 | static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) |
| 2603 | { | 2602 | { |
| 2604 | } | 2603 | } |
| 2605 | |||
| 2606 | static inline bool sb_is_blkdev_sb(struct super_block *sb) | ||
| 2607 | { | ||
| 2608 | return false; | ||
| 2609 | } | ||
| 2610 | #endif | 2604 | #endif |
| 2611 | void emergency_thaw_all(void); | 2605 | void emergency_thaw_all(void); |
| 2612 | extern int sync_filesystem(struct super_block *); | 2606 | extern int sync_filesystem(struct super_block *); |