提交 d03e1292 编写于 作者: Z Zheng Liu 提交者: Jan Kara

ext3: replace ll_rw_block with other functions

ll_rw_block() is deprecated. Thus we replace it with other functions.

CC: Jan Kara <jack@suse.cz>
Signed-off-by: NZheng Liu <wenqing.lz@taobao.com>
Signed-off-by: NJan Kara <jack@suse.cz>
上级 bcdd0c16
...@@ -1136,9 +1136,11 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode, ...@@ -1136,9 +1136,11 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode,
bh = ext3_getblk(handle, inode, block, create, err); bh = ext3_getblk(handle, inode, block, create, err);
if (!bh) if (!bh)
return bh; return bh;
if (buffer_uptodate(bh)) if (bh_uptodate_or_lock(bh))
return bh; return bh;
ll_rw_block(READ | REQ_META | REQ_PRIO, 1, &bh); get_bh(bh);
bh->b_end_io = end_buffer_read_sync;
submit_bh(READ | REQ_META | REQ_PRIO, bh);
wait_on_buffer(bh); wait_on_buffer(bh);
if (buffer_uptodate(bh)) if (buffer_uptodate(bh))
return bh; return bh;
...@@ -2068,12 +2070,10 @@ static int ext3_block_truncate_page(struct inode *inode, loff_t from) ...@@ -2068,12 +2070,10 @@ static int ext3_block_truncate_page(struct inode *inode, loff_t from)
if (PageUptodate(page)) if (PageUptodate(page))
set_buffer_uptodate(bh); set_buffer_uptodate(bh);
if (!buffer_uptodate(bh)) { if (!bh_uptodate_or_lock(bh)) {
err = -EIO; err = bh_submit_read(bh);
ll_rw_block(READ, 1, &bh);
wait_on_buffer(bh);
/* Uhhuh. Read error. Complain and punt. */ /* Uhhuh. Read error. Complain and punt. */
if (!buffer_uptodate(bh)) if (err)
goto unlock; goto unlock;
} }
......
...@@ -921,9 +921,12 @@ static struct buffer_head *ext3_find_entry(struct inode *dir, ...@@ -921,9 +921,12 @@ static struct buffer_head *ext3_find_entry(struct inode *dir,
num++; num++;
bh = ext3_getblk(NULL, dir, b++, 0, &err); bh = ext3_getblk(NULL, dir, b++, 0, &err);
bh_use[ra_max] = bh; bh_use[ra_max] = bh;
if (bh) if (bh && !bh_uptodate_or_lock(bh)) {
ll_rw_block(READ | REQ_META | REQ_PRIO, get_bh(bh);
1, &bh); bh->b_end_io = end_buffer_read_sync;
submit_bh(READ | REQ_META | REQ_PRIO,
bh);
}
} }
} }
if ((bh = bh_use[ra_ptr++]) == NULL) if ((bh = bh_use[ra_ptr++]) == NULL)
......
...@@ -2231,11 +2231,11 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb, ...@@ -2231,11 +2231,11 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
goto out_bdev; goto out_bdev;
} }
journal->j_private = sb; journal->j_private = sb;
ll_rw_block(READ, 1, &journal->j_sb_buffer); if (!bh_uptodate_or_lock(journal->j_sb_buffer)) {
wait_on_buffer(journal->j_sb_buffer); if (bh_submit_read(journal->j_sb_buffer)) {
if (!buffer_uptodate(journal->j_sb_buffer)) { ext3_msg(sb, KERN_ERR, "I/O error on journal device");
ext3_msg(sb, KERN_ERR, "I/O error on journal device"); goto out_journal;
goto out_journal; }
} }
if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) { if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) {
ext3_msg(sb, KERN_ERR, ext3_msg(sb, KERN_ERR,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册