<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML ><HEAD ><TITLE >generic_make_request</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="The Linux Kernel API" HREF="book1.html"><LINK REL="UP" TITLE="Block Devices" HREF="c11504.html"><LINK REL="PREVIOUS" TITLE="blk_init_queue" HREF="r11616.html"><LINK REL="NEXT" TITLE="submit_bh" HREF="r11705.html"></HEAD ><BODY CLASS="REFENTRY" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >The Linux Kernel API</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="r11616.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="r11705.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="AEN11663" ></A ><SPAN CLASS="phrase" ><SPAN CLASS="PHRASE" >generic_make_request</SPAN ></SPAN ></H1 ><DIV CLASS="REFNAMEDIV" ><A NAME="AEN11667" ></A ><H2 >Name</H2 >generic_make_request -- </DIV ><DIV CLASS="REFSYNOPSISDIV" ><A NAME="AEN11670" ></A ><H2 >Synopsis</H2 ><DIV CLASS="FUNCSYNOPSIS" ><A NAME="AEN11672" ></A ><P ></P ><P ><CODE ><CODE CLASS="FUNCDEF" >void <TT CLASS="FUNCTION" >generic_make_request </TT ></CODE >(int <TT CLASS="PARAMETER" ><I >rw</I ></TT >, struct buffer_head * <TT CLASS="PARAMETER" ><I >bh</I ></TT >);</CODE ></P ><P ></P ></DIV ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN11680" ></A ><H2 >Arguments</H2 ><P ></P ><DIV CLASS="VARIABLELIST" ><DL ><DT ><TT CLASS="PARAMETER" ><I >rw</I ></TT ></DT ><DD ><P > READ, WRITE, or READA - what sort of I/O is desired. </P ></DD ><DT ><TT CLASS="PARAMETER" ><I >bh</I ></TT ></DT ><DD ><P > The buffer head describing the location in memory and on the device. </P ></DD ></DL ></DIV ></DIV ><DIV CLASS="REFSECT1" ><A NAME="AEN11693" ></A ><H2 >Description</H2 ><P > <TT CLASS="FUNCTION" >generic_make_request</TT > is used to make I/O requests of block devices. It is passed a &struct buffer_head and a &rw value. The <TT CLASS="CONSTANT" >READ</TT > and <TT CLASS="CONSTANT" >WRITE</TT > options are (hopefully) obvious in meaning. The <TT CLASS="CONSTANT" >READA</TT > value means that a read is required, but that the driver is free to fail the request if, for example, it cannot get needed resources immediately. </P ><P > <TT CLASS="FUNCTION" >generic_make_request</TT > does not return any status. The success/failure status of the request, along with notification of completion, is delivered asynchronously through the bh->b_end_io function described (one day) else where. </P ><P > The caller of generic_make_request must make sure that b_page, b_addr, b_size are set to describe the memory buffer, that b_rdev and b_rsector are set to describe the device address, and the b_end_io and optionally b_private are set to describe how completion notification should be signaled. BH_Mapped should also be set (to confirm that b_dev and b_blocknr are valid). </P ><P > generic_make_request and the drivers it calls may use b_reqnext, and may change b_rdev and b_rsector. So the values of these fields should NOT be depended on after the call to generic_make_request. Because of this, the caller should record the device address information in b_dev and b_blocknr. </P ><P > Apart from those fields mentioned above, no other fields, and in particular, no other flags, are changed by generic_make_request or any lower level drivers. </P ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="r11616.html" ACCESSKEY="P" ><<< Previous</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="book1.html" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="r11705.html" ACCESSKEY="N" >Next >>></A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><SPAN CLASS="phrase" ><SPAN CLASS="PHRASE" >blk_init_queue</SPAN ></SPAN ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="c11504.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><SPAN CLASS="phrase" ><SPAN CLASS="PHRASE" >submit_bh</SPAN ></SPAN ></TD ></TR ></TABLE ></DIV ></BODY ></HTML >