public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: corbet@lwn.net (Jonathan Corbet)
To: Michael Zhu <mylinuxk@yahoo.ca>
Cc: linux-kernel@vger.kernel.org
Subject: Re: The CURRENT macro
Date: Thu, 03 Jan 2002 14:48:39 -0700	[thread overview]
Message-ID: <20020103214839.9953.qmail@eklektix.com> (raw)
In-Reply-To: Your message of "Thu, 03 Jan 2002 16:34:55 EST." <20020103213455.34699.qmail@web14911.mail.yahoo.com>

> In Alessandro Rubini's book Linux Device Driver(Second
> Edition), Chatper 12

Alessandro and...um...some other guy...:)

> he said that "By accessing the
> fields in the request structure, usually by way of
> CURRENT" and "CURRENT is just a pointer into
> blk_dev[MAJOR_NR].request_queue". I know CURRENT is
> just a macro. Where can I find the definition of this
> macro?

A little grepping in the source would give you the answer there.  It's in
.../include/linux/blk.h.  

> I just don't know how to get the struct request from
> the request_queue(a request_queue_t struct). CURRENT
> points to which field in the
> blk_dev[MAJOR_NR].request_queue? Thank you very much.

CURRENT is one way.  There's also functions like blkdev_entry_next_request
(also described in that chapter) that will pull a request off the queue for
you, if that's what you need.

Note that all this stuff has changed quite a bit in 2.5.

jon

Jonathan Corbet
Executive editor, LWN.net
corbet@lwn.net

  reply	other threads:[~2002-01-03 21:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-03 21:34 The CURRENT macro Michael Zhu
2002-01-03 21:48 ` Jonathan Corbet [this message]
2002-01-03 21:55   ` Arnaldo Carvalho de Melo
2002-01-04  8:03     ` Terje Eggestad
2002-01-03 22:01 ` Richard B. Johnson
2002-01-03 22:14 ` Peter Makholm
2002-01-03 22:55 ` Tom Gall
2002-01-03 22:57 ` Tom Gall

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=20020103214839.9953.qmail@eklektix.com \
    --to=corbet@lwn.net \
    --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