Re: The CURRENT macro

From: Richard B. Johnson (
Date: Thu Jan 03 2002 - 17:01:18 EST

On Thu, 3 Jan 2002, Michael Zhu wrote:

> In Alessandro Rubini's book Linux Device Driver(Second
> Edition), Chatper 12, 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?
> 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.
> Michael

If symlinks are set up:


#ifndef _BLK_H
#define _BLK_H


#ifndef CURRENT
#define CURRENT blkdev_entry_next_request(&blk_dev[MAJOR_NR].request_queue.queue_head)

#endif /* _BLK_H */



FYI. To find things in the future, do:
cd /usr/include/linux
grep WHAT_TO_FIND *.h | more
cd ../asm
grep WHAT_TO_FIND *.h | more

Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (797.90 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:22 EST