From: Jan Kara <jack@suse.cz>
To: Zheng Liu <gnehzuil.liu@gmail.com>
Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>,
Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [PATCH] ext3: replace ll_rw_block with other functions
Date: Thu, 8 Dec 2011 00:24:08 +0100 [thread overview]
Message-ID: <20111207232408.GS4622@quack.suse.cz> (raw)
In-Reply-To: <1323071711-4663-1-git-send-email-wenqing.lz@taobao.com>
On Mon 05-12-11 15:55:11, Zheng Liu wrote:
> From: Zheng Liu <wenqing.lz@taobao.com>
>
> ll_rw_block() is deprecated. Thus we replace it with other functions.
Thanks. I've merged the patch into my tree.
Honza
>
> CC: Jan Kara <jack@suse.cz>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
> Hi Jan,
>
> Sorry for the delay. This patch replaces ll_rw_block() with other functions in
> ext3. Please review it. Thank you.
>
> Regards,
> Zheng
>
> fs/ext3/inode.c | 14 +++++++-------
> fs/ext3/namei.c | 9 ++++++---
> fs/ext3/super.c | 10 +++++-----
> 3 files changed, 18 insertions(+), 15 deletions(-)
>
> diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c
> index 85fe655..7aff502 100644
> --- a/fs/ext3/inode.c
> +++ b/fs/ext3/inode.c
> @@ -1132,9 +1132,11 @@ struct buffer_head *ext3_bread(handle_t *handle, struct inode *inode,
> bh = ext3_getblk(handle, inode, block, create, err);
> if (!bh)
> return bh;
> - if (buffer_uptodate(bh))
> + if (bh_uptodate_or_lock(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);
> if (buffer_uptodate(bh))
> return bh;
> @@ -2064,12 +2066,10 @@ static int ext3_block_truncate_page(struct inode *inode, loff_t from)
> if (PageUptodate(page))
> set_buffer_uptodate(bh);
>
> - if (!buffer_uptodate(bh)) {
> - err = -EIO;
> - ll_rw_block(READ, 1, &bh);
> - wait_on_buffer(bh);
> + if (!bh_uptodate_or_lock(bh)) {
> + err = bh_submit_read(bh);
> /* Uhhuh. Read error. Complain and punt. */
> - if (!buffer_uptodate(bh))
> + if (err)
> goto unlock;
> }
>
> diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
> index 642dc6d..337c3f3 100644
> --- a/fs/ext3/namei.c
> +++ b/fs/ext3/namei.c
> @@ -921,9 +921,12 @@ restart:
> num++;
> bh = ext3_getblk(NULL, dir, b++, 0, &err);
> bh_use[ra_max] = bh;
> - if (bh)
> - ll_rw_block(READ | REQ_META | REQ_PRIO,
> - 1, &bh);
> + if (bh && !bh_uptodate_or_lock(bh)) {
> + get_bh(bh);
> + bh->b_end_io = end_buffer_read_sync;
> + submit_bh(READ | REQ_META | REQ_PRIO,
> + bh);
> + }
> }
> }
> if ((bh = bh_use[ra_ptr++]) == NULL)
> diff --git a/fs/ext3/super.c b/fs/ext3/super.c
> index 922d289..d1aefe9 100644
> --- a/fs/ext3/super.c
> +++ b/fs/ext3/super.c
> @@ -2230,11 +2230,11 @@ static journal_t *ext3_get_dev_journal(struct super_block *sb,
> goto out_bdev;
> }
> journal->j_private = sb;
> - ll_rw_block(READ, 1, &journal->j_sb_buffer);
> - wait_on_buffer(journal->j_sb_buffer);
> - if (!buffer_uptodate(journal->j_sb_buffer)) {
> - ext3_msg(sb, KERN_ERR, "I/O error on journal device");
> - goto out_journal;
> + if (!bh_uptodate_or_lock(journal->j_sb_buffer)) {
> + if (bh_submit_read(journal->j_sb_buffer)) {
> + ext3_msg(sb, KERN_ERR, "I/O error on journal device");
> + goto out_journal;
> + }
> }
> if (be32_to_cpu(journal->j_superblock->s_nr_users) != 1) {
> ext3_msg(sb, KERN_ERR,
> --
> 1.7.4.1
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2011-12-07 23:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-25 3:30 [PATCH] ext4: replace ll_rw_block with other functions Zheng Liu
2011-11-25 23:28 ` Jan Kara
2011-12-05 7:55 ` [PATCH] ext3: " Zheng Liu
2011-12-07 23:24 ` Jan Kara [this message]
2011-12-05 7:56 ` [PATCH] ext4: " Zheng Liu
2011-12-07 23:20 ` Jan Kara
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111207232408.GS4622@quack.suse.cz \
--to=jack@suse.cz \
--cc=gnehzuil.liu@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=wenqing.lz@taobao.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).