Commit 7b0de42d authored by David Howells's avatar David Howells Committed by Jens Axboe

[PATCH] BLOCK: Remove dependence on existence of blockdev_superblock [try #6]

Move blockdev_superblock extern declaration from fs/fs-writeback.c to a
headerfile and remove the dependence on it by wrapping it in a macro.
Signed-Off-By: default avatarDavid Howells <dhowells@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 07f3f05c
...@@ -319,7 +319,7 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) ...@@ -319,7 +319,7 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
if (!bdi_cap_writeback_dirty(bdi)) { if (!bdi_cap_writeback_dirty(bdi)) {
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
if (sb == blockdev_superblock) { if (sb_is_blkdev_sb(sb)) {
/* /*
* Dirty memory-backed blockdev: the ramdisk * Dirty memory-backed blockdev: the ramdisk
* driver does this. Skip just this inode * driver does this. Skip just this inode
...@@ -336,14 +336,14 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) ...@@ -336,14 +336,14 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
if (wbc->nonblocking && bdi_write_congested(bdi)) { if (wbc->nonblocking && bdi_write_congested(bdi)) {
wbc->encountered_congestion = 1; wbc->encountered_congestion = 1;
if (sb != blockdev_superblock) if (!sb_is_blkdev_sb(sb))
break; /* Skip a congested fs */ break; /* Skip a congested fs */
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
continue; /* Skip a congested blockdev */ continue; /* Skip a congested blockdev */
} }
if (wbc->bdi && bdi != wbc->bdi) { if (wbc->bdi && bdi != wbc->bdi) {
if (sb != blockdev_superblock) if (!sb_is_blkdev_sb(sb))
break; /* fs has the wrong queue */ break; /* fs has the wrong queue */
list_move(&inode->i_list, &sb->s_dirty); list_move(&inode->i_list, &sb->s_dirty);
continue; /* blockdev has wrong queue */ continue; /* blockdev has wrong queue */
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
extern struct super_block *blockdev_superblock; extern struct super_block *blockdev_superblock;
extern void __init bdev_cache_init(void); extern void __init bdev_cache_init(void);
#define sb_is_blkdev_sb(sb) ((sb) == blockdev_superblock)
/* /*
* char_dev.c * char_dev.c
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment