|
@@ -460,32 +460,6 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-/*
|
|
|
|
- * For background writeback the caller does not have the sb pinned
|
|
|
|
- * before calling writeback. So make sure that we do pin it, so it doesn't
|
|
|
|
- * go away while we are writing inodes from it.
|
|
|
|
- */
|
|
|
|
-static bool pin_sb_for_writeback(struct super_block *sb)
|
|
|
|
-{
|
|
|
|
- spin_lock(&sb_lock);
|
|
|
|
- if (list_empty(&sb->s_instances)) {
|
|
|
|
- spin_unlock(&sb_lock);
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- sb->s_count++;
|
|
|
|
- spin_unlock(&sb_lock);
|
|
|
|
-
|
|
|
|
- if (down_read_trylock(&sb->s_umount)) {
|
|
|
|
- if (sb->s_root)
|
|
|
|
- return true;
|
|
|
|
- up_read(&sb->s_umount);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- put_super(sb);
|
|
|
|
- return false;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* Write a portion of b_io inodes which belong to @sb.
|
|
* Write a portion of b_io inodes which belong to @sb.
|
|
*
|
|
*
|
|
@@ -585,7 +559,7 @@ void writeback_inodes_wb(struct bdi_writeback *wb,
|
|
struct inode *inode = wb_inode(wb->b_io.prev);
|
|
struct inode *inode = wb_inode(wb->b_io.prev);
|
|
struct super_block *sb = inode->i_sb;
|
|
struct super_block *sb = inode->i_sb;
|
|
|
|
|
|
- if (!pin_sb_for_writeback(sb)) {
|
|
|
|
|
|
+ if (!grab_super_passive(sb)) {
|
|
requeue_io(inode);
|
|
requeue_io(inode);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|