Commit 3711d86a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux

Pull writeback fix from Wu Fengguang:
 "A trivial writeback fix"

* tag 'writeback-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
  writeback: Do not sort b_io list only because of block device inode
parents 89dc77bc a8855990
...@@ -592,7 +592,7 @@ static struct block_device *bd_acquire(struct inode *inode) ...@@ -592,7 +592,7 @@ static struct block_device *bd_acquire(struct inode *inode)
return bdev; return bdev;
} }
static inline int sb_is_blkdev_sb(struct super_block *sb) int sb_is_blkdev_sb(struct super_block *sb)
{ {
return sb == blockdev_superblock; return sb == blockdev_superblock;
} }
......
...@@ -69,7 +69,7 @@ static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) ...@@ -69,7 +69,7 @@ static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
{ {
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
if (strcmp(sb->s_type->name, "bdev") == 0) if (sb_is_blkdev_sb(sb))
return inode->i_mapping->backing_dev_info; return inode->i_mapping->backing_dev_info;
return sb->s_bdi; return sb->s_bdi;
...@@ -251,11 +251,13 @@ static int move_expired_inodes(struct list_head *delaying_queue, ...@@ -251,11 +251,13 @@ static int move_expired_inodes(struct list_head *delaying_queue,
if (work->older_than_this && if (work->older_than_this &&
inode_dirtied_after(inode, *work->older_than_this)) inode_dirtied_after(inode, *work->older_than_this))
break; break;
list_move(&inode->i_wb_list, &tmp);
moved++;
if (sb_is_blkdev_sb(inode->i_sb))
continue;
if (sb && sb != inode->i_sb) if (sb && sb != inode->i_sb)
do_sb_sort = 1; do_sb_sort = 1;
sb = inode->i_sb; sb = inode->i_sb;
list_move(&inode->i_wb_list, &tmp);
moved++;
} }
/* just one sb in list, splice to dispatch_queue and we're done */ /* just one sb in list, splice to dispatch_queue and we're done */
......
...@@ -2069,6 +2069,7 @@ extern struct super_block *freeze_bdev(struct block_device *); ...@@ -2069,6 +2069,7 @@ extern struct super_block *freeze_bdev(struct block_device *);
extern void emergency_thaw_all(void); extern void emergency_thaw_all(void);
extern int thaw_bdev(struct block_device *bdev, struct super_block *sb); extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
extern int fsync_bdev(struct block_device *); extern int fsync_bdev(struct block_device *);
extern int sb_is_blkdev_sb(struct super_block *sb);
#else #else
static inline void bd_forget(struct inode *inode) {} static inline void bd_forget(struct inode *inode) {}
static inline int sync_blockdev(struct block_device *bdev) { return 0; } 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,6 +2089,11 @@ static inline int thaw_bdev(struct block_device *bdev, struct super_block *sb)
static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg) static inline void iterate_bdevs(void (*f)(struct block_device *, void *), void *arg)
{ {
} }
static inline int sb_is_blkdev_sb(struct super_block *sb)
{
return 0;
}
#endif #endif
extern int sync_filesystem(struct super_block *); extern int sync_filesystem(struct super_block *);
extern const struct file_operations def_blk_fops; extern const struct file_operations def_blk_fops;
......
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