From: Christoph Hellwig <hch@infradead.org>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] loop: use BIO list management functions
Date: Fri, 17 Apr 2009 02:37:02 -0400 [thread overview]
Message-ID: <20090417063702.GA16744@infradead.org> (raw)
In-Reply-To: <20090417063217.GA3515@localhost.localdomain>
On Fri, Apr 17, 2009 at 03:32:17PM +0900, Akinobu Mita wrote:
> Impact: cleanup
I though we had pretty broad agreement that these lines are utter crap?
:)
> static void loop_add_bio(struct loop_device *lo, struct bio *bio)
> {
> - if (lo->lo_biotail) {
> - lo->lo_biotail->bi_next = bio;
> - lo->lo_biotail = bio;
> - } else
> - lo->lo_bio = lo->lo_biotail = bio;
> + bio_list_add(&lo->lo_bio_list, bio);
> }
This function only has one caller, no need to keep it.
> static struct bio *loop_get_bio(struct loop_device *lo)
> {
> - struct bio *bio;
> -
> - if ((bio = lo->lo_bio)) {
> - if (bio == lo->lo_biotail)
> - lo->lo_biotail = NULL;
> - lo->lo_bio = bio->bi_next;
> - bio->bi_next = NULL;
> - }
> -
> - return bio;
> + return bio_list_pop(&lo->lo_bio_list);
> }
Same here.
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -505,7 +505,7 @@ static inline int bio_has_data(struct bio *bio)
> }
>
> /*
> - * BIO list managment for use by remapping drivers (e.g. DM or MD).
> + * BIO list management for use by remapping drivers (e.g. DM or MD) and loop.
> *
I don't think this needs changing, that was just examples.
next prev parent reply other threads:[~2009-04-17 6:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-17 6:32 [PATCH] loop: use BIO list management functions Akinobu Mita
2009-04-17 6:37 ` Christoph Hellwig [this message]
2009-04-17 7:14 ` Jens Axboe
2009-04-17 7:32 ` Akinobu Mita
2009-04-17 6:40 ` Jens Axboe
2009-04-17 7:30 ` Akinobu Mita
2009-04-17 7:33 ` Jens Axboe
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=20090417063702.GA16744@infradead.org \
--to=hch@infradead.org \
--cc=akinobu.mita@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.