All of lore.kernel.org
 help / color / mirror / Atom feed
From: business1 <coreyu@bsgteamsite.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 2/8] rqbased-dm: add block layer hook
Date: Thu, 21 Dec 2006 14:53:47 -0800 (PST)	[thread overview]
Message-ID: <8016520.post@talk.nabble.com> (raw)
In-Reply-To: <20061219.171150.75425661.k-ueda@ct.jp.nec.com>




Kiyoshi Ueda wrote:
> 
> This patch adds new "end_io_first" hook in __end_that_request_first()
> for request-based device-mapper.
> 
> 
> Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
> 
> diff -rupN 1-blk-get-request-irqrestore/block/ll_rw_blk.c
> 2-add-generic-hook/block/ll_rw_blk.c
> --- 1-blk-get-request-irqrestore/block/ll_rw_blk.c	2006-12-15
> 10:21:29.000000000 -0500
> +++ 2-add-generic-hook/block/ll_rw_blk.c	2006-12-15 10:23:30.000000000
> -0500
> @@ -260,6 +260,7 @@ static void rq_init(request_queue_t *q, 
>  	rq->data = NULL;
>  	rq->nr_phys_segments = 0;
>  	rq->sense = NULL;
> +	rq->end_io_first = NULL;
>  	rq->end_io = NULL;
>  	rq->end_io_data = NULL;
>  	rq->completion_data = NULL;
> @@ -3216,6 +3217,22 @@ static int __end_that_request_first(stru
>  
>  	blk_add_trace_rq(req->q, req, BLK_TA_COMPLETE);
>  
> +	if (!uptodate) {
> +		if (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))
> +			printk("end_request: I/O error, dev %s, sector %llu\n",
> +				req->rq_disk ? req->rq_disk->disk_name : "?",
> +				(unsigned long long)req->sector);
> +	}
> +
> +	if (blk_fs_request(req) && req->rq_disk) {
> +		const int rw = rq_data_dir(req);
> +
> +		disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9);
> +	}
> +
> +	if (req->end_io_first)
> +		return req->end_io_first(req, uptodate, nr_bytes);
> +
>  	/*
>  	 * extend uptodate bool to allow < 0 value to be direct io error
>  	 */
> @@ -3230,19 +3247,6 @@ static int __end_that_request_first(stru
>  	if (!blk_pc_request(req))
>  		req->errors = 0;
>  
> -	if (!uptodate) {
> -		if (blk_fs_request(req) && !(req->cmd_flags & REQ_QUIET))
> -			printk("end_request: I/O error, dev %s, sector %llu\n",
> -				req->rq_disk ? req->rq_disk->disk_name : "?",
> -				(unsigned long long)req->sector);
> -	}
> -
> -	if (blk_fs_request(req) && req->rq_disk) {
> -		const int rw = rq_data_dir(req);
> -
> -		disk_stat_add(req->rq_disk, sectors[rw], nr_bytes >> 9);
> -	}
> -
>  	total_bytes = bio_nbytes = 0;
>  	while ((bio = req->bio) != NULL) {
>  		int nbytes;
> diff -rupN 1-blk-get-request-irqrestore/include/linux/blkdev.h
> 2-add-generic-hook/include/linux/blkdev.h
> --- 1-blk-get-request-irqrestore/include/linux/blkdev.h	2006-12-11
> 14:32:53.000000000 -0500
> +++ 2-add-generic-hook/include/linux/blkdev.h	2006-12-15
> 10:23:30.000000000 -0500
> @@ -126,6 +126,7 @@ void copy_io_context(struct io_context *
>  void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
>  
>  struct request;
> +typedef int (rq_end_first_fn)(struct request *, int, int);
>  typedef void (rq_end_io_fn)(struct request *, int);
>  
>  struct request_list {
> @@ -312,6 +313,7 @@ struct request {
>  	/*
>  	 * completion callback.
>  	 */
> +	rq_end_first_fn *end_io_first;
>  	rq_end_io_fn *end_io;
>  	void *end_io_data;
>  };
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 
> 

-- 
View this message in context: http://www.nabble.com/-RFC-PATCH-2-8--rqbased-dm%3A-add-block-layer-hook-tf2848786.html#a8016520
Sent from the linux-kernel mailing list archive at Nabble.com.


      parent reply	other threads:[~2006-12-21 22:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-19 22:11 [RFC PATCH 2/8] rqbased-dm: add block layer hook Kiyoshi Ueda
2006-12-19 22:11 ` Kiyoshi Ueda
2006-12-20 13:49 ` Jens Axboe
2006-12-20 13:49   ` Jens Axboe
2006-12-20 21:52   ` Kiyoshi Ueda
2006-12-20 21:52     ` Kiyoshi Ueda
2006-12-21  7:49     ` Jens Axboe
2006-12-21  7:49       ` Jens Axboe
2006-12-21 22:22       ` Kiyoshi Ueda
2006-12-21 22:22         ` Kiyoshi Ueda
2006-12-21 22:56         ` business1
2006-12-22  7:18         ` Mike Christie
2006-12-22  7:18           ` [dm-devel] " Mike Christie
2006-12-22 19:55           ` Kiyoshi Ueda
2006-12-22 19:55             ` [dm-devel] " Kiyoshi Ueda
2006-12-21 23:00     ` business1
2006-12-21 22:56   ` business1
2006-12-21 22:53 ` business1 [this message]

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=8016520.post@talk.nabble.com \
    --to=coreyu@bsgteamsite.com \
    --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.