diff options
-rw-r--r-- | fs/block_dev.c | 2 | ||||
-rw-r--r-- | fs/fs-writeback.c | 8 | ||||
-rw-r--r-- | include/linux/fs.h | 6 |
3 files changed, 12 insertions, 4 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c index c3549ed58038..1e86823a9cbd 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -592,7 +592,7 @@ static struct block_device *bd_acquire(struct inode *inode) | |||
592 | return bdev; | 592 | return bdev; |
593 | } | 593 | } |
594 | 594 | ||
595 | static inline int sb_is_blkdev_sb(struct super_block *sb) | 595 | int sb_is_blkdev_sb(struct super_block *sb) |
596 | { | 596 | { |
597 | return sb == blockdev_superblock; | 597 | return sb == blockdev_superblock; |
598 | } | 598 | } |
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 30f6f27d5a59..9f4935b8f208 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -69,7 +69,7 @@ static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) | |||
69 | { | 69 | { |
70 | struct super_block *sb = inode->i_sb; | 70 | struct super_block *sb = inode->i_sb; |
71 | 71 | ||
72 | if (strcmp(sb->s_type->name, "bdev") == 0) | 72 | if (sb_is_blkdev_sb(sb)) |
73 | return inode->i_mapping->backing_dev_info; | 73 | return inode->i_mapping->backing_dev_info; |
74 | 74 | ||
75 | return sb->s_bdi; | 75 | return sb->s_bdi; |
@@ -251,11 +251,13 @@ static int move_expired_inodes(struct list_head *delaying_queue, | |||
251 | if (work->older_than_this && | 251 | if (work->older_than_this && |
252 | inode_dirtied_after(inode, *work->older_than_this)) | 252 | inode_dirtied_after(inode, *work->older_than_this)) |
253 | break; | 253 | break; |
254 | list_move(&inode->i_wb_list, &tmp); | ||
255 | moved++; | ||
256 | if (sb_is_blkdev_sb(inode->i_sb)) | ||
257 | continue; | ||
254 | if (sb && sb != inode->i_sb) | 258 | if (sb && sb != inode->i_sb) |
255 | do_sb_sort = 1; | 259 | do_sb_sort = 1; |
256 | sb = inode->i_sb; | 260 | sb = inode->i_sb; |
257 | list_move(&inode->i_wb_list, &tmp); | ||
258 | moved++; | ||
259 | } | 261 | } |
260 | 262 | ||
261 | /* just one sb in list, splice to dispatch_queue and we're done */ | 263 | /* just one sb in list, splice to dispatch_queue and we're done */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index a4acd3c61190..3f40547ba191 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2069,6 +2069,7 @@ extern struct super_block *freeze_bdev(struct block_device *); | |||
2069 | extern void emergency_thaw_all(void); | 2069 | extern void emergency_thaw_all(void); |
2070 | extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); | 2070 | extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); |
2071 | extern int fsync_bdev(struct block_device *); | 2071 | extern int fsync_bdev(struct block_device *); |
2072 | extern int sb_is_blkdev_sb(struct super_block *sb); | ||
2072 | #else | 2073 | #else |
2073 | static inline void bd_forget(struct inode *inode) {} | 2074 | static inline void bd_forget(struct inode *inode) {} |
2074 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } | 2075 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } |
@@ -2088,6 +2089,11 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb) | |||
2088 | static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) | 2089 | static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) |
2089 | { | 2090 | { |
2090 | } | 2091 | } |
2092 | |||
2093 | static inline int sb_is_blkdev_sb(struct super_block *sb) | ||
2094 | { | ||
2095 | return 0; | ||
2096 | } | ||
2091 | #endif | 2097 | #endif |
2092 | extern int sync_filesystem(struct super_block *); | 2098 | extern int sync_filesystem(struct super_block *); |
2093 | extern const struct file_operations def_blk_fops; | 2099 | extern const struct file_operations def_blk_fops; |