public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Michael Zhu <mylinuxk@yahoo.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: About block device request function.
Date: Fri, 11 Jan 2002 07:42:14 +0100	[thread overview]
Message-ID: <20020111074214.N19814@suse.de> (raw)
In-Reply-To: <20020110212718.41819.qmail@web14906.mail.yahoo.com>
In-Reply-To: <20020110212718.41819.qmail@web14906.mail.yahoo.com>

On Thu, Jan 10 2002, Michael Zhu wrote:
> Hi, I have a question of the block device request
> function. I use the following sentences to change the
> request function of a block device.
> 
> spin_lock_irq(&io_request_lock);
> 
> original_make_request_fn =
> blk_dev[i].request_queue.make_request_fn;
> 
> blk_dev[i].request_queue.make_request_fn =
> kti_make_request_fn;
> 
> spin_unlock_irq(&io_request_lock);
> 
> "i" is the major number of a block device.
> 
> You know blk_dev[] is the global block device array.
> When I use those sentences to change the floppy block
> device's request function, it works. The major number
> of the floppy disk is 2. But when I use the same one
> to change the hard disk's request function, it doesn't
> work. I found that the
> blk_dev[3].request_queue.make_request_fn is NULL. Does
> that mean that the make_request_fn() of the hard disk
> is NULL. I can't believe it. Can anyone give me an
> answer?

Read drivers/block/ll_rw_blk.c:blk_get_queue() -- either a driver uses
the statically allocated per-major queue, or it provides its own and
defines a get_queue function to return it.

You are still heading in the wrong direction :/

-- 
Jens Axboe


  reply	other threads:[~2002-01-11  6:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-10 21:27 About block device request function Michael Zhu
2002-01-11  6:42 ` Jens Axboe [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-01-11 13:53 Michael Zhu
2002-01-11 13:57 ` 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=20020111074214.N19814@suse.de \
    --to=axboe@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mylinuxk@yahoo.ca \
    /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