The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: Andrew Morton <akpm@osdl.org>, Andi Kleen <ak@muc.de>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jens Axboe <jens.axboe@oracle.com>
Subject: Re: [PATCH 1/9] lguest: block device speedup
Date: Fri, 9 Mar 2007 07:51:23 +0000	[thread overview]
Message-ID: <20070309075123.GC8798@infradead.org> (raw)
In-Reply-To: <1173409524.32234.67.camel@localhost.localdomain>

On Fri, Mar 09, 2007 at 02:05:24PM +1100, Rusty Russell wrote:
> diff -r fdc8cbc1fd61 drivers/block/lguest_blk.c
> --- a/drivers/block/lguest_blk.c	Thu Mar 08 13:35:39 2007 +1100
> +++ b/drivers/block/lguest_blk.c	Thu Mar 08 15:51:55 2007 +1100
> @@ -45,6 +45,16 @@ struct blockdev
>  	struct request *req;
>  };
>  
> +/* Jens gave me this nice helper to end all chunks of a request. */
> +static void end_entire_request(struct request *req, int uptodate)
> +{
> +	if (end_that_request_first(req, uptodate, req->hard_nr_sectors))
> +		BUG();
> +	add_disk_randomness(req->rq_disk);
> +	blkdev_dequeue_request(req);
> +	end_that_request_last(req, uptodate);
> +}

I think we really want this in common code, ll_rw_blk.c should have:

static int __end_request(struct request *req, int uptodate,
		unsigned int sectors)
{
        if (!end_that_request_first(req, uptodate, sectors)) {
		add_disk_randomness(req->rq_disk);
		blkdev_dequeue_request(req);
		end_that_request_last(req, uptodate);
		return 1;
	}
	return 0;
}

/* TODO: add kerneldoc comment */
/* XXX: should be called end_partial_request */
void end_request(struct request *req, int uptodate)
{
	__end_request(req, uptodate, req->hard_cur_sectors);
}

/* TODO: add kerneldoc comment */
void end_entired_request(struct request *req, int uptodate)
{
	if (!__end_request(req, uptodate, req->hard_nr_sectors))
		BUG();
}

the latter two maybe as inlines

  parent reply	other threads:[~2007-03-09  7:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09  3:05 [PATCH 1/9] lguest: block device speedup Rusty Russell
2007-03-09  3:08 ` [PATCH 2/9] lguest: bridging support in example code Rusty Russell
2007-03-09  3:12   ` [PATCH 3/9] lguest: cleanup: allocate separate pages for switcher code Rusty Russell
2007-03-09  3:16     ` [PATCH 4/9] lguest: cleanup: clean up regs save/restore Rusty Russell
2007-03-09  3:17       ` [PATCH 5/9] lguest: documentation fixes Rusty Russell
2007-03-09  3:19         ` [PATCH 6/9] lguest: pin stack page optimization Rusty Russell
2007-03-09  3:23           ` [PATCH 7/9] lguest: use read-only pages rather than segments to protect high-mapped switcher Rusty Russell
2007-03-09  3:30             ` [PATCH 8/9] lguest: Optimize away copy in and out of per-cpu guest pages Rusty Russell
2007-03-09  3:32               ` [PATCH 9/9] lguest: don't crash host on NMI Rusty Russell
2007-03-09  7:51 ` Christoph Hellwig [this message]
2007-03-09  8:09   ` [PATCH 1/9] lguest: block device speedup 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=20070309075123.GC8798@infradead.org \
    --to=hch@infradead.org \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    /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