Skip to content

Commit

Permalink
[PATCH] CONFIG_BLOCK internal.h cleanups
Browse files Browse the repository at this point in the history
- forward declare struct superblock
- use inlines, not macros

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Andrew Morton authored and Jens Axboe committed Sep 30, 2006
1 parent 65934a9 commit 5e6d12b
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions fs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,29 @@

#include <linux/ioctl32.h>

struct super_block;

/*
* block_dev.c
*/
#ifdef CONFIG_BLOCK
extern struct super_block *blockdev_superblock;
extern void __init bdev_cache_init(void);

#define sb_is_blkdev_sb(sb) ((sb) == blockdev_superblock)
static inline int sb_is_blkdev_sb(struct super_block *sb)
{
return sb == blockdev_superblock;
}

#else
static inline void bdev_cache_init(void) {}
static inline void bdev_cache_init(void)
{
}

#define sb_is_blkdev_sb(sb) 0
static inline int sb_is_blkdev_sb(struct super_block *sb)
{
return 0;
}
#endif

/*
Expand Down

0 comments on commit 5e6d12b

Please sign in to comment.