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
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
2560extern struct super_block *blockdev_superblock;
2561static 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_BLOCK2566#ifdef CONFIG_BLOCK
2561extern int register_blkdev(unsigned int, const char *);2567extern int register_blkdev(unsigned int, const char *);
2562extern void unregister_blkdev(unsigned int, const char *);2568extern void unregister_blkdev(unsigned int, const char *);
@@ -2572,13 +2578,6 @@ extern struct super_block *freeze_bdev(struct block_device *); · 9 unmodified lines
2572extern void emergency_thaw_bdev(struct super_block *sb);2578extern void emergency_thaw_bdev(struct super_block *sb);
2573extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);2579extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
2574extern int fsync_bdev(struct block_device *);2580extern int fsync_bdev(struct block_device *);
2575
2576extern struct super_block *blockdev_superblock;
2577
2578static inline bool sb_is_blkdev_sb(struct super_block *sb)
2579{
2580 return sb == blockdev_superblock;
2581}
2582#else2581#else
2583static inline void bd_forget(struct inode *inode) {}2582static inline void bd_forget(struct inode *inode) {}
2584static inline int sync_blockdev(struct block_device *bdev) { return 0; }2583static 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
2602static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)2601static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
2603{2602{
2604}2603}
2605
2606static inline bool sb_is_blkdev_sb(struct super_block *sb)
2607{
2608 return false;
2609}
2610#endif2604#endif
2611void emergency_thaw_all(void);2605void emergency_thaw_all(void);
2612extern int sync_filesystem(struct super_block *);2606extern 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