linux/block/elevator.c
<<
p/spa pspa class="lxr_search"> ="+search" method="post" onsubmit="return do_search(this);"> Search p/spa ="ajax+*" method="post" onsubmit="return false;"> pinput typ"v3hidden" nam"v3ajax_lookup" idv3ajax_lookup" lue="v3">
pdiv idv3file_contents"
o o1p/a>pspa
 class="comment">/*p/spa
  o o2p/a>pspa
 class="comment"> *  Block device elevator/IO-scheduler.p/spa
  o o3p/a>pspa
 class="comment"> *p/spa
  o o4p/a>pspa
 class="comment"> *  Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSEp/spa
  o o5p/a>pspa
 class="comment"> *p/spa
  o o6p/a>pspa
 class="comment"> * 30042000 Jens Axboe <axboe@kernel.dk> :p/spa
  o o7p/a>pspa
 class="comment"> *p/spa
  o o8p/a>pspa
 class="comment"> * Split the elevator a bit so that it is possible to choose a differentp/spa
  o o9p/a>pspa
 class="comment"> * one or even write a new "plug in". There are three pieces:p/spa
  o pspa
 class="comment"> * - elevator_fn, inserts a new request in the queue listp/spa
  o 11p/a>pspa
 class="comment"> * - elevator_merge_fn, decides whether a new buffer can be merged withp/spa
  o 12p/a>pspa
 class="comment"> *   a
 existing requestp/spa
  o 13p/a>pspa
 class="comment"> * - elevator_dequeue_fn, called when a request is taken off the aconve listp/spa
  o 14p/a>pspa
 class="comment"> *p/spa
  o 15p/a>pspa
 class="comment"> * 20082000 Dave Jones <davej@suse.de> :p/spa
  o 16p/a>pspa
 class="comment"> * Removed tests for max-bomb-segments, which was breaking elvtunep/spa
  o 17p/a>pspa
 class="comment"> *  when run without -bNp/spa
  o 18p/a>pspa
 class="comment"> *p/spa
  o 19p/a>pspa
 class="comment"> * Jens:p/spa
  o 2/opa>pspa
 class="comment"> * - Rework again to work with bio instead of buffer_headsp/spa
  o 21p/a>pspa
 class="comment"> * - loose bi_dev comparisons, partion vahandling is right nowp/spa
  o 22p/a>pspa
 class="comment"> * - completely modularize elevator setup a
d teardownp/spa
  o 23p/a>pspa
 class="comment"> *p/spa
  o 24p/a>pspa
 class="comment"> */p/spa
  o 25p/a>#include <linux/kernel.hp/a>> o 26p/a>#include <linux/fs.hp/a>> o 27p/a>#include <linux/blkdev.hp/a>> o 28p/a>#include <linux/elevator.hp/a>> o 29p/a>#include <linux/bio.hp/a>> o 30p/a>#include <linux/module.hp/a>> o 31p/a>#include <linux/slab.hp/a>> o 32p/a>#include <linux/init.hp/a>> o 33p/a>#include <linux/compiler.hp/a>> o 34p/a>#include <linux/blktrace_api.hp/a>> o 35p/a>#include <linux/hash.hp/a>> o 36p/a>#include <linux/uaccess.hp/a>> o 37p/a> o 38p/a>#include <trace/events/block.hp/a>> o 39p/a> o 40p/a>#include "blk.hp/a>" o 41p/a>#include "blk-cgroup.hp/a>" o 42p/a> o 43p/a>staticopa href="+code=DEFINE_SPINLOCK" class="sref">DEFINE_SPINLOCKp/a>(pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o 44p/a>staticopa href="+code=LIST_HEAD" class="sref">LIST_HEADp/a>(pa href="+code=elv_list" class="sref">elv_listp/a>); o 45p/a> o 46p/a>pspa
 class="comment">/*p/spa
  o 47p/a>pspa
 class="comment"> * Merge hash stuff.p/spa
  o 48p/a>pspa
 class="comment"> */p/spa
  o 49p/a>#defineopa href="+code=rq_hash_key" class="sref">rq_hash_keyp/a>(pa href="+code=rq" class="sref">rqp/a>)         (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>) +opa href="+code=blk_rq_sectors" class="sref">blk_rq_sectorsp/a>(pa href="+code=rq" class="sref">rqp/a>)) o 50p/a> o 51p/a>pspa
 class="comment">/*p/spa
  o 52p/a>pspa
 class="comment"> * Query io scheduler to see if the current process issuing bio may bep/spa
  o 53p/a>pspa
 class="comment"> * merged with rq.p/spa
  o 54p/a>pspa
 class="comment"> */p/spa
  o 55p/a>staticoint pa href="+code=elv_iosched_allow_merge" class="sref">elv_iosched_allow_mergep/a>(struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, struct pa href="+code=bio" class="sref">biop/a> *pa href="+code=bio" class="sref">biop/a>) o 56p/a>{ o 57p/a>        struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a> =opa href="+code=rq" class="sref">rqp/a>->pa href="+code=q" class="sref">qp/a>; o 58p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatorp/a>; o 59p/a> o 60p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_allow_merge_fn" class="sref">elevator_allow_merge_fnp/a>) o 61p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_allow_merge_fn" class="sref">elevator_allow_merge_fnp/a>(pa href="+code=q" class="sref">qp/a>,opa href="+code=rq" class="sref">rqp/a>,opa href="+code=bio" class="sref">biop/a>); o 62p/a> o 63p/a>        return 1; o 64p/a>} o 65p/a> o 66p/a>pspa
 class="comment">/*p/spa
  o 67p/a>pspa
 class="comment"> * can we safely merge with this request?p/spa
  o 68p/a>pspa
 class="comment"> */p/spa
  o 69p/a>pa href="+code=bool" class="sref">boolp/a> pa href="+code=elv_rq_merge_ok" class="sref">elv_rq_merge_okp/a>(struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, struct pa href="+code=bio" class="sref">biop/a> *pa href="+code=bio" class="sref">biop/a>) o 70p/a>{ o 71p/a>        if (!pa href="+code=blk_rq_merge_ok" class="sref">blk_rq_merge_okp/a>(pa href="+code=rq" class="sref">rqp/a>,opa href="+code=bio" class="sref">biop/a>)) o 72p/a>                return 0; o 73p/a> o 74p/a>        if (!pa href="+code=elv_iosched_allow_merge" class="sref">elv_iosched_allow_mergep/a>(pa href="+code=rq" class="sref">rqp/a>,opa href="+code=bio" class="sref">biop/a>)) o 75p/a>                return 0; o 76p/a> o 77p/a>        return 1; o 78p/a>} o 79p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rq_merge_ok" class="sref">elv_rq_merge_okp/a>); o 80p/a> o 81p/a>staticostruct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=elevator_find" class="sref">elevator_findp/a>(const char *pa href="+code=nam"" class="sref">nam"p/a>) o 82p/a>{ o 83p/a>        struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a>; o 84p/a> o 85p/a>        pa href="+code=list_for_each_entry" class="sref">list_for_each_entryp/a>(pa href="+code=e" class="sref">ep/a>, &pa href="+code=elv_list" class="sref">elv_listp/a>,opa href="+code=list" class="sref">listp/a>) { o 86p/a>                if (!pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>,opa href="+code=nam"" class="sref">nam"p/a>)) o 87p/a>                        return pa href="+code=e" class="sref">ep/a>; o 88p/a>        } o 89p/a> o 90p/a>        return pa href="+code=NULL" class="sref">NULLp/a>; o 91p/a>} o 92p/a> o 93p/a>staticovoid pa href="+code=elevator_put" class="sref">elevator_putp/a>(struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a>) o 94p/a>{ o 95p/a>        pa href="+code=module_put" class="sref">module_putp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_owner" class="sref">elevator_ownerp/a>); o 96p/a>} o 97p/a> o 98p/a>staticostruct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=elevator_get" class="sref">elevator_getp/a>(const char *pa href="+code=nam"" class="sref">nam"p/a>,opa href="+code=bool" class="sref">boolp/a> pa href="+code=try_loading" class="sref">try_loadingp/a>) o 99p/a>{ o100p/a>        struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a>; o101p/a> o102p/a>        pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o103p/a> o104p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_find" class="sref">elevator_findp/a>(pa href="+code=nam"" class="sref">nam"p/a>); o105p/a>        if (!pa href="+code=e" class="sref">ep/a> && pa href="+code=try_loading" class="sref">try_loadingp/a>) { o106p/a>                pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o107p/a>                pa href="+code=request_module" class="sref">request_modulep/a>(pspa
 class="string">"%s-iosched"nam"p/a>); o108p/a>                pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o109p/a>                pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_find" class="sref">elevator_findp/a>(pa href="+code=nam"" class="sref">nam"p/a>); o110p/a>        } o111p/a> o112p/a>        if (pa href="+code=e" class="sref">ep/a> && !pa href="+code=try_module_get" class="sref">try_module_getp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_owner" class="sref">elevator_ownerp/a>)) o113p/a>                pa href="+code=e" class="sref">ep/a> =opa href="+code=NULL" class="sref">NULLp/a>; o114p/a> o115p/a>        pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o116p/a> o117p/a>        return pa href="+code=e" class="sref">ep/a>; o118p/a>} o119p/a> o12/opa>staticochar pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>[pa href="+code=ELV_NAME_MAX" class="sref">ELV_NAME_MAXopa>]; o121p/a> o122p/a>staticoint pa href="+code=__init" class="sref">__initp/a> pa href="+code=elevator_setup" class="sref">elevator_setupp/a>(char *pa href="+code=str" class="sref">strp/a>) o123p/a>{ o124p/a>        pspa
 class="comment">/*p/spa
  o125p/a>pspa
 class="comment">         * Be backwards-compatible with previous kernels, so usersp/spa
  o126p/a>pspa
 class="comment">         * won't get the wrong elevator.p/spa
  o127p/a>pspa
 class="comment">         */p/spa
  o128p/a>        pa href="+code=strncpy" class="sref">strncpyp/a>(pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>,opa href="+code=str" class="sref">strp/a>, sizeof(pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>) - 1); o129p/a>        return 1; o130p/a>} o131p/a> o132p/a>pa href="+code=__setup" class="sref">__setupp/a>(pspa
 class="string">"elevator="elevator_setupp/a>); o133p/a> o134p/a>pspa
 class="comment">/* called during boot to load the elevator chosen by the elevator param */p/spa
  o135p/a>void pa href="+code=__init" class="sref">__initp/a> pa href="+code=load_default_elevator_module" class="sref">load_default_elevator_modulep/a>(void) o136p/a>{ o137p/a>        struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a>; o138p/a> o139p/a>        if (!pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>[0]) o140p/a>                return; o141p/a> o142p/a>        pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o143p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_find" class="sref">elevator_findp/a>(pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>); o144p/a>        pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockp/a>); o145p/a> o146p/a>        if (!pa href="+code=e" class="sref">ep/a>) o147p/a>                pa href="+code=request_module" class="sref">request_modulep/a>(pspa
 class="string">"%s-iosched"chosen_elevatoropa>); o148p/a>} o149p/a> o15/opa>staticostruct pa href="+code=kobj_typ"" class="sref">kobj_typ"p/a> pa href="+code=elv_ktyp"" class="sref">elv_ktyp"p/a>; o151p/a> o152opa>staticostruct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=elevator_alloc" class="sref">elevator_allocp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, o153p/a>                                  struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a>) o154p/a>{ o155p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=eq" class="sref">eqp/a>; o156p/a> o157p/a>        pa href="+code=eq" class="sref">eqp/a> =opa href="+code=kmalloc_node" class="sref">kmalloc_nodep/a>(sizeof(*pa href="+code=eq" class="sref">eqp/a>),opa href="+code=GFP_KERNEL" class="sref">GFP_KERNELp/a> | pa href="+code=__GFP_ZERO" class="sref">__GFP_ZEROopa>,opa href="+code=q" class="sref">qp/a>->pa href="+code=node" class="sref">nodep/a>); o158p/a>        if (pa href="+code=unlikely" class="sref">unlikelyp/a>(!pa href="+code=eq" class="sref">eqp/a>)) o159p/a>                goto pa href="+code=err" class="sref">errp/a>; o160p/a> o161p/a>        pa href="+code=eq" class="sref">eqp/a>->pa href="+code=typ"" class="sref">typ"p/a> =opa href="+code=e" class="sref">ep/a>; o162p/a>        pa href="+code=kobject_init" class="sref">kobject_initp/a>(&pa href="+code=eq" class="sref">eqp/a>->pa href="+code=kobj" class="sref">kobjopa>,o&pa href="+code=elv_ktyp"" class="sref">elv_ktyp"p/a>); o163p/a>        pa href="+code=mutex_init" class="sref">mutex_initp/a>(&pa href="+code=eq" class="sref">eqp/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o164p/a>        pa href="+code=hash_init" class="sref">hash_initp/a>(pa href="+code=eq" class="sref">eqp/a>->pa href="+code=hash" class="sref">hashp/a>); o165p/a> o166p/a>        return pa href="+code=eq" class="sref">eqp/a>; o167p/a>pa href="+code=err" class="sref">errp/a>: o168p/a>        pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=eq" class="sref">eqp/a>); o169p/a>        pa href="+code=elevator_put" class="sref">elevator_putp/a>(pa href="+code=e" class="sref">ep/a>); o170p/a>        return pa href="+code=NULL" class="sref">NULLp/a>; o171p/a>} o172p/a> o173p/a>staticovoid pa href="+code=elevator_release" class="sref">elevator_releasep/a>(struct pa href="+code=kobject" class="sref">kobjectp/a> *pa href="+code=kobj" class="sref">kobjopa>) o174p/a>{ o175p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a>; o176p/a> o177p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=container_of" class="sref">container_ofp/a>(pa href="+code=kobj" class="sref">kobjopa>,ostruct pa href="+code=elevator_queue" class="sref">elevator_queuep/a>,opa href="+code=kobj" class="sref">kobjopa>); o178p/a>        pa href="+code=elevator_put" class="sref">elevator_putp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=typ"" class="sref">typ"p/a>); o179p/a>        pa href="+code=kfree" class="sref">kfreep/a>(pa href="+code=e" class="sref">ep/a>); o180p/a>} o181p/a> o182p/a>int pa href="+code=elevator_init" class="sref">elevator_initp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, char *pa href="+code=nam"" class="sref">nam"p/a>) o183p/a>{ o184p/a>        struct pa href="+code=elevator_typ"" class="sref">elevator_typ"p/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=NULL" class="sref">NULLp/a>; o185p/a>        int pa href="+code=err" class="sref">errp/a>; o186p/a> o187p/a>        if (pa href="+code=unlikely" class="sref">unlikelyp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>)) o188p/a>                return 0; o189p/a> o190p/a>        pa href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEADp/a>(&pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>); o191p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=NULL" class="sref">NULLp/a>; o192p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=end_sector" class="sref">end_sectorp/a> =o0; o193p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=boundary_rq" class="sref">boundary_rqp/a> =opa href="+code=NULL" class="sref">NULLp/a>; o194p/a> o195p/a>        if (pa href="+code=nam"" class="sref">nam"p/a>) { o196p/a>                pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_get" class="sref">elevator_getp/a>(pa href="+code=nam"" class="sref">nam"p/a>,opa href="+code=tru"" class="sref">truep/a>); o197p/a>                if (!pa href="+code=e" class="sref">ep/a>) o198p/a>                        return -pa href="+code=EINVAL" class="sref">EINVALp/a>; o199p/a>        } o200p/a> o201p/a>        pspa
 class="comment">/*p/spa
  o202p/a>pspa
 class="comment">         * Use the default elevator specified by config boot param orp/spa
  o203p/a>pspa
 class="comment">         * config tion>
.  Don't try to load modules as we could be runningp/spa
  o204p/a>pspa
 class="comment">         * off async a
d request_module() isn't allowed from async.p/spa
  o205p/a>pspa
 class="comment">         */p/spa
  o206p/a>        if (!pa href="+code=e" class="sref">ep/a> && *pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>) { o207p/a>                pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_get" class="sref">elevator_getp/a>(pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>,opa href="+code=false" class="sref">falsep/a>); o208p/a>                if (!pa href="+code=e" class="sref">ep/a>) o209p/a>                        pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> pspa
 class="string">"I/O scheduler %s not found\n"o210p/a>                                                        pa href="+code=chosen_elevator" class="sref">chosen_elevatoropa>); o211p/a>        } o212p/a> o213p/a>        if (!pa href="+code=e" class="sref">ep/a>) { o214p/a>                pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_get" class="sref">elevator_getp/a>(pa href="+code=CONFIG_DEFAULT_IOSCHED" class="sref">CONFIG_DEFAULT_IOSCHEDopa>,opa href="+code=false" class="sref">falsep/a>); o215p/a>                if (!pa href="+code=e" class="sref">ep/a>) { o216p/a>                        pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> o217p/a>                                pspa
 class="string">"Default I/O scheduler not found. "o218p/a>                                pspa
 class="string">"Using noop.\n"o219p/a>                        pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_get" class="sref">elevator_getp/a>(pspa
 class="string">"noop"falsep/a>); o220p/a>                } o221p/a>        } o222p/a> o223p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa> =opa href="+code=elevator_alloc" class="sref">elevator_allocp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=e" class="sref">ep/a>); o224p/a>        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>) o225p/a>                return -pa href="+code=ENOMEM" class="sref">ENOMEMp/a>; o226p/a> o227p/a>        pa href="+code=err" class="sref">errp/a> =opa href="+code=e" class="sref">ep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_init_fn" class="sref">elevator_init_fnp/a>(pa href="+code=q" class="sref">qp/a>); o228p/a>        if (pa href="+code=err" class="sref">errp/a>) { o229p/a>                pa href="+code=kobject_put" class="sref">kobject_putp/a>(&pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=kobj" class="sref">kobjopa>); o230p/a>                return pa href="+code=err" class="sref">errp/a>; o231p/a>        } o232p/a> o233p/a>        return 0; o234p/a>} o235p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elevator_init" class="sref">elevator_initp/a>); o236p/a> o237p/a>void pa href="+code=elevator_exit" class="sref">elevator_exitp/a>(struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a>) o238p/a>{ o239p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o240p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_exit_fn" class="sref">elevator_exit_fnp/a>) o241p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=typ"" class="sref">typ"p/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_exit_fn" class="sref">elevator_exit_fnp/a>(pa href="+code=e" class="sref">ep/a>); o242p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o243p/a> o244p/a>        pa href="+code=kobject_put" class="sref">kobject_putp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjopa>); o245p/a>} o246p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elevator_exit" class="sref">elevator_exitp/a>); o247p/a> o248p/a>staticopa href="+code=inline" class="sref">inlinep/a> void pa href="+code=__elv_rqhash_del" class="sref">__elv_rqhash_delp/a>(struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o249p/a>{ o250p/a>        pa href="+code=hash_del" class="sref">hash_delp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=hash" class="sref">hashp/a>); o251p/a>} o252p/a> o253p/a>staticovoid pa href="+code=elv_rqhash_del" class="sref">elv_rqhash_delp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o254p/a>{ o255p/a>        if (pa href="+code=ELV_ON_HASH" class="sref">ELV_ON_HASHp/a>(pa href="+code=rq" class="sref">rqp/a>)) o256p/a>                pa href="+code=__elv_rqhash_del" class="sref">__elv_rqhash_delp/a>(pa href="+code=rq" class="sref">rqp/a>); o257p/a>} o258p/a> o259p/a>staticovoid pa href="+code=elv_rqhash_add" class="sref">elv_rqhash_addp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o260p/a>{ o261p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o262p/a> o263p/a>        pa href="+code=BUG_ON" class="sref">BUG_ONp/a>(pa href="+code=ELV_ON_HASH" class="sref">ELV_ON_HASHp/a>(pa href="+code=rq" class="sref">rqp/a>)); o264p/a>        pa href="+code=hash_add" class="sref">hash_addp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=hash" class="sref">hashp/a>,o&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=hash" class="sref">hashp/a>,opa href="+code=rq_hash_key" class="sref">rq_hash_keyp/a>(pa href="+code=rq" class="sref">rqp/a>)); o265p/a>} o266p/a> o267p/a>staticovoid pa href="+code=elv_rqhash_reposion>
" class="sref">elv_rqhash_reposion>
p/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o268p/a>{ o269p/a>        pa href="+code=__elv_rqhash_del" class="sref">__elv_rqhash_delp/a>(pa href="+code=rq" class="sref">rqp/a>); o270p/a>        pa href="+code=elv_rqhash_add" class="sref">elv_rqhash_addp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o271p/a>} o272p/a> o273p/a>staticostruct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_rqhash_find" class="sref">elv_rqhash_findp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, pa href="+code=sector_t" class="sref">sector_tp/a> pa href="+code=offset" class="sref">offsetp/a>) o274p/a>{ o275p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o276p/a>        struct pa href="+code=hlist_node" class="sref">hlist_nodep/a> *pa href="+code=next" class="sref">nextopa>; o277p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>; o278p/a> o279p/a>        pa href="+code=hash_for_each_possible_safe" class="sref">hash_for_each_possible_safep/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=hash" class="sref">hashp/a>,opa href="+code=rq" class="sref">rqp/a>,opa href="+code=next" class="sref">nextopa>,opa href="+code=hash" class="sref">hashp/a>,opa href="+code=offset" class="sref">offsetp/a>) { o280p/a>                pa href="+code=BUG_ON" class="sref">BUG_ONp/a>(!pa href="+code=ELV_ON_HASH" class="sref">ELV_ON_HASHp/a>(pa href="+code=rq" class="sref">rqp/a>)); o281p/a> o282p/a>                if (pa href="+code=unlikely" class="sref">unlikelyp/a>(!pa href="+code=rq_mergeable" class="sref">rq_mergeablep/a>(pa href="+code=rq" class="sref">rqp/a>))) { o283p/a>                        pa href="+code=__elv_rqhash_del" class="sref">__elv_rqhash_delp/a>(pa href="+code=rq" class="sref">rqp/a>); o284p/a>                        continue; o285p/a>                } o286p/a> o287p/a>                if (pa href="+code=rq_hash_key" class="sref">rq_hash_keyp/a>(pa href="+code=rq" class="sref">rqp/a>) ==opa href="+code=offset" class="sref">offsetp/a>) o288p/a>                        return pa href="+code=rq" class="sref">rqp/a>; o289p/a>        } o290p/a> o291p/a>        return pa href="+code=NULL" class="sref">NULLp/a>; o292p/a>} o293p/a> o294p/a>pspa
 class="comment">/*p/spa
  o295p/a>pspa
 class="comment"> * RB-tree support funcon>
s for inserting/lookup/removal of requestsp/spa
  o296p/a>pspa
 class="comment"> * in a sorted RB tree.p/spa
  o297p/a>pspa
 class="comment"> */p/spa
  o298p/a>void pa href="+code=elv_rb_add" class="sref">elv_rb_addp/a>(struct pa href="+code=rb_root" class="sref">rb_rootp/a> *pa href="+code=root" class="sref">rootp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o299p/a>{ o300p/a>        struct pa href="+code=rb_node" class="sref">rb_nodep/a> **pa href="+code=p" class="sref">pp/a> =o&pa href="+code=root" class="sref">rootp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>; o301p/a>        struct pa href="+code=rb_node" class="sref">rb_nodep/a> *pa href="+code=parent" class="sref">parentp/a> =opa href="+code=NULL" class="sref">NULLp/a>; o302p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=__rq" class="sref">__rqp/a>; o303p/a> o304p/a>        while (*pa href="+code=p" class="sref">pp/a>) { o305p/a>                pa href="+code=parent" class="sref">parentp/a> =o*pa href="+code=p" class="sref">pp/a>; o306p/a>                pa href="+code=__rq" class="sref">__rqp/a> =opa href="+code=rb_entry" class="sref">rb_entryp/a>(pa href="+code=parent" class="sref">parentp/a>, struct pa href="+code=request" class="sref">requestp/a>,opa href="+code=rb_node" class="sref">rb_nodep/a>); o307p/a> o308p/a>                if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>) <opa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=__rq" class="sref">__rqp/a>)) o309p/a>                        pa href="+code=p" class="sref">pp/a> =o&(*pa href="+code=p" class="sref">pp/a>)->pa href="+code=rb_left" class="sref">rb_leftp/a>; o310p/a>                else if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>) >=opa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=__rq" class="sref">__rqp/a>)) o311p/a>                        pa href="+code=p" class="sref">pp/a> =o&(*pa href="+code=p" class="sref">pp/a>)->pa href="+code=rb_right" class="sref">rb_rightp/a>; o312p/a>        } o313p/a> o314p/a>        pa href="+code=rb_link_node" class="sref">rb_link_nodep/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>,opa href="+code=parent" class="sref">parentp/a>, pa href="+code=p" class="sref">pp/a>); o315p/a>        pa href="+code=rb_insert_color" class="sref">rb_insert_colorp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>,opa href="+code=root" class="sref">rootp/a>); o316p/a>} o317p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rb_add" class="sref">elv_rb_addp/a>); o318p/a> o319p/a>void pa href="+code=elv_rb_del" class="sref">elv_rb_delp/a>(struct pa href="+code=rb_root" class="sref">rb_rootp/a> *pa href="+code=root" class="sref">rootp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o320p/a>{ o321p/a>        pa href="+code=BUG_ON" class="sref">BUG_ONp/a>(pa href="+code=RB_EMPTY_NODE" class="sref">RB_EMPTY_NODEp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>)); o322p/a>        pa href="+code=rb_erase" class="sref">rb_erasep/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>,opa href="+code=root" class="sref">rootp/a>); o323p/a>        pa href="+code=RB_CLEAR_NODE" class="sref">RB_CLEAR_NODEp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>); o324p/a>} o325p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rb_del" class="sref">elv_rb_delp/a>); o326p/a> o327p/a>struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_rb_find" class="sref">elv_rb_findp/a>(struct pa href="+code=rb_root" class="sref">rb_rootp/a> *pa href="+code=root" class="sref">rootp/a>, pa href="+code=sector_t" class="sref">sector_tp/a> pa href="+code=sector" class="sref">sectorp/a>) o328p/a>{ o329p/a>        struct pa href="+code=rb_node" class="sref">rb_nodep/a> *pa href="+code=
" class="sref">np/a> =opa href="+code=root" class="sref">rootp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>; o330p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>; o331p/a> o332p/a>        while (pa href="+code=
" class="sref">np/a>) { o333p/a>                pa href="+code=rq" class="sref">rqp/a> =opa href="+code=rb_entry" class="sref">rb_entryp/a>(pa href="+code=
" class="sref">np/a>, struct pa href="+code=request" class="sref">requestp/a>,opa href="+code=rb_node" class="sref">rb_nodep/a>); o334p/a> o335p/a>                if (pa href="+code=sector" class="sref">sectorp/a> <opa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>)) o336p/a>                        pa href="+code=
" class="sref">np/a> =opa href="+code=
" class="sref">np/a>->pa href="+code=rb_left" class="sref">rb_leftp/a>; o337p/a>                else if (pa href="+code=sector" class="sref">sectorp/a> >opa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>)) o338p/a>                        pa href="+code=
" class="sref">np/a> =opa href="+code=
" class="sref">np/a>->pa href="+code=rb_right" class="sref">rb_rightp/a>; o339p/a>                else o340p/a>                        return pa href="+code=rq" class="sref">rqp/a>; o341p/a>        } o342p/a> o343p/a>        return pa href="+code=NULL" class="sref">NULLp/a>; o344p/a>} o345p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rb_find" class="sref">elv_rb_findp/a>); o346p/a> o347p/a>pspa
 class="comment">/*p/spa
  o348p/a>pspa
 class="comment"> * Insert rq into dispatch queue of q.  Queue lock must be held >
p/spa
  o349p/a>pspa
 class="comment"> * entry.  rq is sort instead into the dispatch queue. To be used byp/spa
  o350p/a>pspa
 class="comment"> * specific elevators.p/spa
  o351p/a>pspa
 class="comment"> */p/spa
  o352p/a>void pa href="+code=elv_dispatch_sort" class="sref">elv_dispatch_sortp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o353p/a>{ o354p/a>        pa href="+code=sector_t" class="sref">sector_tp/a> pa href="+code=boundary" class="sref">boundaryp/a>; o355p/a>        struct pa href="+code=list_head" class="sref">list_headp/a> *pa href="+code=entry" class="sref">entryp/a>; o356p/a>        int pa href="+code=stop_flags" class="sref">stop_flagsp/a>; o357p/a> o358p/a>        if (pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> ==opa href="+code=rq" class="sref">rqp/a>) o359p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=NULL" class="sref">NULLp/a>; o360p/a> o361p/a>        pa href="+code=elv_rqhash_del" class="sref">elv_rqhash_delp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o362p/a> o363p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a>--; o364p/a> o365p/a>        pa href="+code=boundary" class="sref">boundaryp/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=end_sector" class="sref">end_sectorp/a>; o366p/a>        pa href="+code=stop_flags" class="sref">stop_flagsp/a> =opa href="+code=REQ_SOFTBARRIER" class="sref">REQ_SOFTBARRIERp/a> |opa href="+code=REQ_STARTED" class="sref">REQ_STARTEDp/a>; o367p/a>        pa href="+code=list_for_each_prev" class="sref">list_for_each_prevp/a>(pa href="+code=entry" class="sref">entryp/a>,o&pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>) { o368p/a>                struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=pos" class="sref">posp/a> =opa href="+code=list_entry_rq" class="sref">list_entry_rqp/a>(pa href="+code=entry" class="sref">entryp/a>); o369p/a> o370p/a>                if ((pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_DISCARD" class="sref">REQ_DISCARDp/a>) != o371p/a>                    (pa href="+code=pos" class="sref">posp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_DISCARD" class="sref">REQ_DISCARDp/a>)) o372p/a>                        break; o373p/a>                if (pa href="+code=rq_data_dir" class="sref">rq_data_dirp/a>(pa href="+code=rq" class="sref">rqp/a>) !=opa href="+code=rq_data_dir" class="sref">rq_data_dirp/a>(pa href="+code=pos" class="sref">posp/a>)) o374p/a>                        break; o375p/a>                if (pa href="+code=pos" class="sref">posp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=stop_flags" class="sref">stop_flagsp/a>) o376p/a>                        break; o377p/a>                if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>) >=opa href="+code=boundary" class="sref">boundaryp/a>) { o378p/a>                        if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=pos" class="sref">posp/a>) <opa href="+code=boundary" class="sref">boundaryp/a>) o379p/a>                                continue; o380p/a>                } else { o381p/a>                        if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=pos" class="sref">posp/a>) >=opa href="+code=boundary" class="sref">boundaryp/a>) o382p/a>                                break; o383p/a>                } o384p/a>                if (pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>) >=opa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=pos" class="sref">posp/a>)) o385p/a>                        break; o386p/a>        } o387p/a> o388p/a>        pa href="+code=list_add" class="sref">list_addp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=queuelist" class="sref">queuelistp/a>, pa href="+code=entry" class="sref">entryp/a>); o389p/a>} o390p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_dispatch_sort" class="sref">elv_dispatch_sortp/a>); o391p/a> o392p/a>pspa
 class="comment">/*p/spa
  o393p/a>pspa
 class="comment"> * Insert rq into dispatch queue of q.  Queue lock must be held >
p/spa
  o394p/a>pspa
 class="comment"> * entry.  rq is added to the back of the dispatch queue. To be used byp/spa
  o395p/a>pspa
 class="comment"> * specific elevators.p/spa
  o396p/a>pspa
 class="comment"> */p/spa
  o397p/a>void pa href="+code=elv_dispatch_add_tail" class="sref">elv_dispatch_add_tailp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o398p/a>{ o399p/a>        if (pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> ==opa href="+code=rq" class="sref">rqp/a>) o400p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=NULL" class="sref">NULLp/a>; o401p/a> o402p/a>        pa href="+code=elv_rqhash_del" class="sref">elv_rqhash_delp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o403p/a> o404p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a>--; o405p/a> o406p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=end_sector" class="sref">end_sectorp/a> =opa href="+code=rq_end_sector" class="sref">rq_end_sectorp/a>(pa href="+code=rq" class="sref">rqp/a>); o407p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=boundary_rq" class="sref">boundary_rqp/a> =opa href="+code=rq" class="sref">rqp/a>; o408p/a>        pa href="+code=list_add_tail" class="sref">list_add_tailp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=queuelist" class="sref">queuelistp/a>, &pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>); o409p/a>} o410p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_dispatch_add_tail" class="sref">elv_dispatch_add_tailp/a>); o411p/a> o412p/a>int pa href="+code=elv_merge" class="sref">elv_mergep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> **pa href="+code=req" class="sref">reqp/a>, struct pa href="+code=bio" class="sref">biop/a> *pa href="+code=bio" class="sref">biop/a>) o413p/a>{ o414p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o415p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=__rq" class="sref">__rqp/a>; o416p/a>        int pa href="+code=ret" class="sref">retp/a>; o417p/a> o418p/a>        pspa
 class="comment">/*p/spa
  o419p/a>pspa
 class="comment">         * Levels of merges:p/spa
  o420p/a>pspa
 class="comment">         *      nomerges:  No merges at all attemptedp/spa
  o421p/a>pspa
 class="comment">         *      noxmerges: Only simple one-hit cache tryp/spa
  o422p/a>pspa
 class="comment">         *      merges:    All merge tries attemptedp/spa
  o423p/a>pspa
 class="comment">         */p/spa
  o424p/a>        if (pa href="+code=blk_queue_nomerges" class="sref">blk_queue_nomergesp/a>(pa href="+code=q" class="sref">qp/a>)) o425p/a>                return pa href="+code=ELEVATOR_NO_MERGE" class="sref">ELEVATOR_NO_MERGEp/a>; o426p/a> o427p/a>        pspa
 class="comment">/*p/spa
  o428p/a>pspa
 class="comment">         * First try one-hit cache.p/spa
  o429p/a>pspa
 class="comment">         */p/spa
  o430p/a>        if (pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> && pa href="+code=elv_rq_merge_ok" class="sref">elv_rq_merge_okp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a>, pa href="+code=bio" class="sref">biop/a>)) { o431p/a>                pa href="+code=ret" class="sref">retp/a> =opa href="+code=blk_try_merge" class="sref">blk_try_mergep/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a>, pa href="+code=bio" class="sref">biop/a>); o432p/a>                if (pa href="+code=ret" class="sref">retp/a> !=opa href="+code=ELEVATOR_NO_MERGE" class="sref">ELEVATOR_NO_MERGEp/a>) { o433p/a>                        *pa href="+code=req" class="sref">reqp/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a>; o434p/a>                        return pa href="+code=ret" class="sref">retp/a>; o435p/a>                } o436p/a>        } o437p/a> o438p/a>        if (pa href="+code=blk_queue_noxmerges" class="sref">blk_queue_noxmergesp/a>(pa href="+code=q" class="sref">qp/a>)) o439p/a>                return pa href="+code=ELEVATOR_NO_MERGE" class="sref">ELEVATOR_NO_MERGEp/a>; o440p/a> o441p/a>        pspa
 class="comment">/*p/spa
  o442p/a>pspa
 class="comment">         * See if our hash lookup can find a potential backmerge.p/spa
  o443p/a>pspa
 class="comment">         */p/spa
  o444p/a>        pa href="+code=__rq" class="sref">__rqp/a> =opa href="+code=elv_rqhash_find" class="sref">elv_rqhash_findp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=bio" class="sref">biop/a>->pa href="+code=bi_sector" class="sref">bi_sectorp/a>); o445p/a>        if (pa href="+code=__rq" class="sref">__rqp/a> && pa href="+code=elv_rq_merge_ok" class="sref">elv_rq_merge_okp/a>(pa href="+code=__rq" class="sref">__rqp/a>, pa href="+code=bio" class="sref">biop/a>)) { o446p/a>                *pa href="+code=req" class="sref">reqp/a> =opa href="+code=__rq" class="sref">__rqp/a>; o447p/a>                return pa href="+code=ELEVATOR_BACK_MERGE" class="sref">ELEVATOR_BACK_MERGEp/a>; o448p/a>        } o449p/a> o450p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merge_f
" class="sref">elevator_merge_f
p/a>) o451p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merge_f
" class="sref">elevator_merge_f
p/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=req" class="sref">reqp/a>, pa href="+code=bio" class="sref">biop/a>); o452p/a> o453p/a>        return pa href="+code=ELEVATOR_NO_MERGE" class="sref">ELEVATOR_NO_MERGEp/a>; o454p/a>} o455p/a> o456p/a>pspa
 class="comment">/*p/spa
  o457p/a>pspa
 class="comment"> * Attempt to do a
 insertion back merge. Only check for the case wherep/spa
  o458p/a>pspa
 class="comment"> * we can append 'rq' to an existing request, so we can throw 'rq' awayp/spa
  o459p/a>pspa
 class="comment"> * afterwards.p/spa
  o460p/a>pspa
 class="comment"> *p/spa
  o461p/a>pspa
 class="comment"> * Returns true if we merged, false otherwisep/spa
  o462p/a>pspa
 class="comment"> */p/spa
  o463p/a>staticopa href="+code=bool" class="sref">boolp/a> pa href="+code=elv_attempt_insert_merge" class="sref">elv_attempt_insert_mergep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, o464p/a>                                     struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o465p/a>{ o466p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=__rq" class="sref">__rqp/a>; o467p/a>        pa href="+code=bool" class="sref">boolp/a> pa href="+code=ret" class="sref">retp/a>; o468p/a> o469p/a>        if (pa href="+code=blk_queue_nomerges" class="sref">blk_queue_nomergesp/a>(pa href="+code=q" class="sref">qp/a>)) o470p/a>                return pa href="+code=false" class="sref">falsep/a>; o471p/a> o472p/a>        pspa
 class="comment">/*p/spa
  o473p/a>pspa
 class="comment">         * First try one-hit cache.p/spa
  o474p/a>pspa
 class="comment">         */p/spa
  o475p/a>        if (pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> && pa href="+code=blk_attempt_req_merge" class="sref">blk_attempt_req_mergep/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a>, pa href="+code=rq" class="sref">rqp/a>)) o476p/a>                return pa href="+code=true" class="sref">truep/a>; o477p/a> o478p/a>        if (pa href="+code=blk_queue_noxmerges" class="sref">blk_queue_noxmergesp/a>(pa href="+code=q" class="sref">qp/a>)) o479p/a>                return pa href="+code=false" class="sref">falsep/a>; o480p/a> o481p/a>        pa href="+code=ret" class="sref">retp/a> =opa href="+code=false" class="sref">falsep/a>; o482p/a>        pspa
 class="comment">/*p/spa
  o483p/a>pspa
 class="comment">         * See if our hash lookup can find a potential backmerge.p/spa
  o484p/a>pspa
 class="comment">         */p/spa
  o485p/a>        while (1) { o486p/a>                pa href="+code=__rq" class="sref">__rqp/a> =opa href="+code=elv_rqhash_find" class="sref">elv_rqhash_findp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=blk_rq_pos" class="sref">blk_rq_posp/a>(pa href="+code=rq" class="sref">rqp/a>)); o487p/a>                if (!pa href="+code=__rq" class="sref">__rqp/a> || !pa href="+code=blk_attempt_req_merge" class="sref">blk_attempt_req_mergep/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=__rq" class="sref">__rqp/a>, pa href="+code=rq" class="sref">rqp/a>)) o488p/a>                        break; o489p/a> o490p/a>                pspa
 class="comment">/* The merged request could be merged with others, try again */p/spa
  o491p/a>                pa href="+code=ret" class="sref">retp/a> =opa href="+code=true" class="sref">truep/a>; o492p/a>                pa href="+code=rq" class="sref">rqp/a> =opa href="+code=__rq" class="sref">__rqp/a>; o493p/a>        } o494p/a> o495p/a>        return pa href="+code=ret" class="sref">retp/a>; o496p/a>} o497p/a> o498p/a>void pa href="+code=elv_merged_request" class="sref">elv_merged_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, int pa href="+code=type" class="sref">typep/a>) o499p/a>{ o500p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o501p/a> o502p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merged_f
" class="sref">elevator_merged_f
p/a>) o503p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merged_f
" class="sref">elevator_merged_f
p/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=type" class="sref">typep/a>); o504p/a> o505p/a>        if (pa href="+code=type" class="sref">typep/a> ==opa href="+code=ELEVATOR_BACK_MERGE" class="sref">ELEVATOR_BACK_MERGEp/a>) o506p/a>                pa href="+code=elv_rqhash_reposition" class="sref">elv_rqhash_repositionp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o507p/a> o508p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=rq" class="sref">rqp/a>; o509p/a>} o510p/a> o511p/a>void pa href="+code=elv_merge_requests" class="sref">elv_merge_requestsp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, o512p/a>                             struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=next" class="sref">nextp/a>) o513p/a>{ o514p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o515p/a>        const int pa href="+code=next_sorted" class="sref">next_sortedp/a> =opa href="+code=next" class="sref">nextp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_SORTED" class="sref">REQ_SORTEDp/a>; o516p/a> o517p/a>        if (pa href="+code=next_sorted" class="sref">next_sortedp/a> && pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merge_req_f
" class="sref">elevator_merge_req_f
p/a>) o518p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_merge_req_f
" class="sref">elevator_merge_req_f
p/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=next" class="sref">nextp/a>); o519p/a> o520p/a>        pa href="+code=elv_rqhash_reposition" class="sref">elv_rqhash_repositionp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o521p/a> o522p/a>        if (pa href="+code=next_sorted" class="sref">next_sortedp/a>) { o523p/a>                pa href="+code=elv_rqhash_del" class="sref">elv_rqhash_delp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=next" class="sref">nextp/a>); o524p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a>--; o525p/a>        } o526p/a> o527p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=rq" class="sref">rqp/a>; o528p/a>} o529p/a> o530p/a>void pa href="+code=elv_bio_merged" class="sref">elv_bio_mergedp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, o531p/a>                        struct pa href="+code=bio" class="sref">biop/a> *pa href="+code=bio" class="sref">biop/a>) o532p/a>{ o533p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o534p/a> o535p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_bio_merged_f
" class="sref">elevator_bio_merged_f
p/a>) o536p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_bio_merged_f
" class="sref">elevator_bio_merged_f
p/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=bio" class="sref">biop/a>); o537p/a>} o538p/a> o539p/a>void pa href="+code=elv_requeue_request" class="sref">elv_requeue_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o540p/a>{ o541p/a>        pspa
 class="comment">/*p/spa
  o542p/a>pspa
 class="comment">         * it already went through dequeue, we need to decrement thep/spa
  o543p/a>pspa
 class="comment">         * in_flight count againp/spa
  o544p/a>pspa
 class="comment">         */p/spa
  o545p/a>        if (pa href="+code=blk_account_rq" class="sref">blk_account_rqp/a>(pa href="+code=rq" class="sref">rqp/a>)) { o546p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=in_flight" class="sref">in_flightp/a>[pa href="+code=rq_is_sync" class="sref">rq_is_syncp/a>(pa href="+code=rq" class="sref">rqp/a>)]--; o547p/a>                if (pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_SORTED" class="sref">REQ_SORTEDp/a>) o548p/a>                        pa href="+code=elv_deactivate_rq" class="sref">elv_deactivate_rqp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o549p/a>        } o550p/a> o551p/a>        pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> &= ~pa href="+code=REQ_STARTED" class="sref">REQ_STARTEDp/a>; o552p/a> o553p/a>        pa href="+code=__elv_add_request" class="sref">__elv_add_requestp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=ELEVATOR_INSERT_REQUEUE" class="sref">ELEVATOR_INSERT_REQUEUEp/a>); o554p/a>} o555p/a> o556p/a>void pa href="+code=elv_drain_elevator" class="sref">elv_drain_elevatorp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>) o557p/a>{ o558p/a>        staticoint pa href="+code=printed" class="sref">printedp/a>; o559p/a> o560p/a>        pa href="+code=lockdep_assert_held" class="sref">lockdep_assert_heldp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_lock" class="sref">queue_lockp/a>); o561p/a> o562p/a>        while (pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_dispatch_f
" class="sref">elevator_dispatch_f
p/a>(pa href="+code=q" class="sref">qp/a>, 1)) o563p/a>                ; o564p/a>        if (pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a> && pa href="+code=printed" class="sref">printedp/a>++ <o10) { o565p/a>                pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> pspa
 class="string">"%s: forced dispatching is broken "p/spa
  o566p/a>                       pspa
 class="string">"(nr_sorted=%u), please report this\n"p/spa
 , o567p/a>                       pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=type" class="sref">typep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a>); o568p/a>        } o569p/a>} o570p/a> o571p/a>void pa href="+code=__elv_add_request" class="sref">__elv_add_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, int pa href="+code=where" class="sref">wherep/a>) o572p/a>{ o573p/a>        pa href="+code=trace_block_rq_insert" class="sref">trace_block_rq_insertp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o574p/a> o575p/a>        pa href="+code=rq" class="sref">rqp/a>->pa href="+code=q" class="sref">qp/a> =opa href="+code=q" class="sref">qp/a>; o576p/a> o577p/a>        if (pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_SOFTBARRIER" class="sref">REQ_SOFTBARRIERp/a>) { o578p/a>                pspa
 class="comment">/* barriers are scheduling boundary, update end_sector */p/spa
  o579p/a>                if (pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_type" class="sref">cmd_typep/a> ==opa href="+code=REQ_TYPE_FS" class="sref">REQ_TYPE_FSp/a>) { o580p/a>                        pa href="+code=q" class="sref">qp/a>->pa href="+code=end_sector" class="sref">end_sectorp/a> =opa href="+code=rq_end_sector" class="sref">rq_end_sectorp/a>(pa href="+code=rq" class="sref">rqp/a>); o581p/a>                        pa href="+code=q" class="sref">qp/a>->pa href="+code=boundary_rq" class="sref">boundary_rqp/a> =opa href="+code=rq" class="sref">rqp/a>; o582p/a>                } o583p/a>        } else if (!(pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_ELVPRIV" class="sref">REQ_ELVPRIVp/a>) && o584p/a>                    (pa href="+code=where" class="sref">wherep/a> ==opa href="+code=ELEVATOR_INSERT_SORT" class="sref">ELEVATOR_INSERT_SORTp/a> || o585p/a>                     pa href="+code=where" class="sref">wherep/a> ==opa href="+code=ELEVATOR_INSERT_SORT_MERGE" class="sref">ELEVATOR_INSERT_SORT_MERGEp/a>)) o586p/a>                pa href="+code=where" class="sref">wherep/a> =opa href="+code=ELEVATOR_INSERT_BACK" class="sref">ELEVATOR_INSERT_BACKp/a>; o587p/a> o588p/a>        switch (pa href="+code=where" class="sref">wherep/a>) { o589p/a>        case pa href="+code=ELEVATOR_INSERT_REQUEUE" class="sref">ELEVATOR_INSERT_REQUEUEp/a>: o590p/a>        case pa href="+code=ELEVATOR_INSERT_FRONT" class="sref">ELEVATOR_INSERT_FRONTp/a>: o591p/a>                pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> |=opa href="+code=REQ_SOFTBARRIER" class="sref">REQ_SOFTBARRIERp/a>; o592p/a>                pa href="+code=list_add" class="sref">list_addp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=queuelist" class="sref">queuelistp/a>, &pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>); o593p/a>                break; o594p/a> o595p/a>        case pa href="+code=ELEVATOR_INSERT_BACK" class="sref">ELEVATOR_INSERT_BACKp/a>: o596p/a>                pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> |=opa href="+code=REQ_SOFTBARRIER" class="sref">REQ_SOFTBARRIERp/a>; o597p/a>                pa href="+code=elv_drain_elevator" class="sref">elv_drain_elevatorp/a>(pa href="+code=q" class="sref">qp/a>); o598p/a>                pa href="+code=list_add_tail" class="sref">list_add_tailp/a>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=queuelist" class="sref">queuelistp/a>, &pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>); o599p/a>                pspa
 class="comment">/*p/spa
  o600p/a>pspa
 class="comment">                 * We kick the queue here for the following reasons.p/spa
  o601p/a>pspa
 class="comment">                 * - The elevator might have returned NULL previouslyp/spa
  o602p/a>pspa
 class="comment">                 *   to delay requests and returned them now.  As thep/spa
  o603p/a>pspa
 class="comment">                 *   queue wasn't empty before this request, ll_rw_blkp/spa
  o604p/a>pspa
 class="comment">                 *   won't run the queue on return, resulting in hang.p/spa
  o605p/a>pspa
 class="comment">                 * - Usually, back inserted requests won't be mergedp/spa
  o606p/a>pspa
 class="comment">                 *   with anything.  There's no point in delaying queuep/spa
  o607p/a>pspa
 class="comment">                 *   processing.p/spa
  o608p/a>pspa
 class="comment">                 */p/spa
  o609p/a>                pa href="+code=__blk_run_queue" class="sref">__blk_run_queuep/a>(pa href="+code=q" class="sref">qp/a>); o610p/a>                break; o611p/a> o612p/a>        case pa href="+code=ELEVATOR_INSERT_SORT_MERGE" class="sref">ELEVATOR_INSERT_SORT_MERGEp/a>: o613p/a>                pspa
 class="comment">/*p/spa
  o614p/a>pspa
 class="comment">                 * If we succeed in merging this request with one in thep/spa
  o615p/a>pspa
 class="comment">                 * queue already, we are done - rq has now been freed,p/spa
  o616p/a>pspa
 class="comment">                 * so no need to do anything further.p/spa
  o617p/a>pspa
 class="comment">                 */p/spa
  o618p/a>                if (pa href="+code=elv_attempt_insert_merge" class="sref">elv_attempt_insert_mergep/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>)) o619p/a>                        break; o620p/a>        case pa href="+code=ELEVATOR_INSERT_SORT" class="sref">ELEVATOR_INSERT_SORTp/a>: o621p/a>                pa href="+code=BUG_ON" class="sref">BUG_ONp/a>(pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_type" class="sref">cmd_typep/a> !=opa href="+code=REQ_TYPE_FS" class="sref">REQ_TYPE_FSp/a>); o622p/a>                pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> |=opa href="+code=REQ_SORTED" class="sref">REQ_SORTEDp/a>; o623p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=nr_sorted" class="sref">nr_sortedp/a>++; o624p/a>                if (pa href="+code=rq_mergeable" class="sref">rq_mergeablep/a>(pa href="+code=rq" class="sref">rqp/a>)) { o625p/a>                        pa href="+code=elv_rqhash_add" class="sref">elv_rqhash_addp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o626p/a>                        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a>) o627p/a>                                pa href="+code=q" class="sref">qp/a>->pa href="+code=last_merge" class="sref">last_mergep/a> =opa href="+code=rq" class="sref">rqp/a>; o628p/a>                } o629p/a> o630p/a>                pspa
 class="comment">/*p/spa
  o631p/a>pspa
 class="comment">                 * Some ioscheds (cfq) run q->request_fn directly, sop/spa
  o632p/a>pspa
 class="comment">                 * rq cannot be accessed after callingp/spa
  o633p/a>pspa
 class="comment">                 * elevator_add_req_fn.p/spa
  o634p/a>pspa
 class="comment">                 */p/spa
  o635p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_add_req_fn" class="sref">elevator_add_req_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o636p/a>                break; o637p/a> o638p/a>        case pa href="+code=ELEVATOR_INSERT_FLUSH" class="sref">ELEVATOR_INSERT_FLUSHp/a>: o639p/a>                pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> |=opa href="+code=REQ_SOFTBARRIER" class="sref">REQ_SOFTBARRIERp/a>; o640p/a>                pa href="+code=blk_insert_flush" class="sref">blk_insert_flushp/a>(pa href="+code=rq" class="sref">rqp/a>); o641p/a>                break; o642p/a>        default: o643p/a>                pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> pspa
 class="string">"%s: bad insertion point %d\n"p/spa
 , o644p/a>                       pa href="+code=__func__" class="sref">__func__p/a>, pa href="+code=where" class="sref">wherep/a>); o645p/a>                pa href="+code=BUG" class="sref">BUGp/a>(); o646p/a>        } o647p/a>} o648p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=__elv_add_request" class="sref">__elv_add_requestp/a>); o649p/a> o650p/a>void pa href="+code=elv_add_request" class="sref">elv_add_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, int pa href="+code=where" class="sref">wherep/a>) o651p/a>{ o652p/a>        unsigned long pa href="+code=flags" class="sref">flagsp/a>; o653p/a> o654p/a>        pa href="+code=spin_lock_irqsave" class="sref">spin_lock_irqsavep/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_lock" class="sref">queue_lockp/a>, pa href="+code=flags" class="sref">flagsp/a>); o655p/a>        pa href="+code=__elv_add_request" class="sref">__elv_add_requestp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=where" class="sref">wherep/a>); o656p/a>        pa href="+code=spin_unlock_irqrestore" class="sref">spin_unlock_irqrestorep/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_lock" class="sref">queue_lockp/a>, pa href="+code=flags" class="sref">flagsp/a>); o657p/a>} o658p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_add_request" class="sref">elv_add_requestp/a>); o659p/a> o660p/a>struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_latter_request" class="sref">elv_latter_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o661p/a>{ o662p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o663p/a> o664p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_latter_req_fn" class="sref">elevator_latter_req_fnp/a>) o665p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_latter_req_fn" class="sref">elevator_latter_req_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o666p/a>        return pa href="+code=NULL" class="sref">NULLopa>; o667p/a>} o668p/a> o669p/a>struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_former_request" class="sref">elv_former_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o670p/a>{ o671p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o672p/a> o673p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_former_req_fn" class="sref">elevator_former_req_fnp/a>) o674p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_former_req_fn" class="sref">elevator_former_req_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o675p/a>        return pa href="+code=NULL" class="sref">NULLopa>; o676p/a>} o677p/a> o678p/a>int pa href="+code=elv_set_request" class="sref">elv_set_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>, o679p/a>                    struct pa href="+code=bio" class="sref">biop/a> *pa href="+code=bio" class="sref">biop/a>, pa href="+code=gfp_t" class="sref">gfp_tp/a> pa href="+code=gfp_mask" class="sref">gfp_maskp/a>) o680p/a>{ o681p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o682p/a> o683p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_set_req_fn" class="sref">elevator_set_req_fnp/a>) o684p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_set_req_fn" class="sref">elevator_set_req_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>, pa href="+code=bio" class="sref">biop/a>, pa href="+code=gfp_mask" class="sref">gfp_maskp/a>); o685p/a>        return 0; o686p/a>} o687p/a> o688p/a>void pa href="+code=elv_put_request" class="sref">elv_put_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o689p/a>{ o690p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o691p/a> o692p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_put_req_fn" class="sref">elevator_put_req_fnp/a>) o693p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_put_req_fn" class="sref">elevator_put_req_fnp/a>(pa href="+code=rq" class="sref">rqp/a>); o694p/a>} o695p/a> o696p/a>int pa href="+code=elv_may_queue" class="sref">elv_may_queuep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, int pa href="+code=rw" class="sref">rwp/a>) o697p/a>{ o698p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o699p/a> o700p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_may_queue_fn" class="sref">elevator_may_queue_fnp/a>) o701p/a>                return pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_may_queue_fn" class="sref">elevator_may_queue_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rw" class="sref">rwp/a>); o702p/a> o703p/a>        return pa href="+code=ELV_MQUEUE_MAY" class="sref">ELV_MQUEUE_MAYopa>; o704p/a>} o705p/a> o706p/a>void pa href="+code=elv_abort_queue" class="sref">elv_abort_queuep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>) o707p/a>{ o708p/a>        struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>; o709p/a> o710p/a>        pa href="+code=blk_abort_flushes" class="sref">blk_abort_flushesp/a>(pa href="+code=q" class="sref">qp/a>); o711p/a> o712p/a>        while (!pa href="+code=list_empty" class="sref">list_emptyp/a>(&pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>)) { o713p/a>                pa href="+code=rq" class="sref">rqp/a> =opa href="+code=list_entry_rq" class="sref">list_entry_rqp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_head" class="sref">queue_headp/a>.pa href="+code=next" class="sref">nextp/a>); o714p/a>                pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> |=opa href="+code=REQ_QUIET" class="sref">REQ_QUIETp/a>; o715p/a>                pa href="+code=trace_block_rq_abort" class="sref">trace_block_rq_abortp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o716p/a>                pspa
 class="comment">/*p/spa
  o717p/a>pspa
 class="comment">                 * Mark this request as started so we don't triggerp/spa
  o718p/a>pspa
 class="comment">                 * any debug logicoin the end I/O path.p/spa
  o719p/a>pspa
 class="comment">                 */p/spa
  o720p/a>                pa href="+code=blk_start_request" class="sref">blk_start_requestp/a>(pa href="+code=rq" class="sref">rqp/a>); o721p/a>                pa href="+code=__blk_end_request_all" class="sref">__blk_end_request_allp/a>(pa href="+code=rq" class="sref">rqp/a>, -pa href="+code=EIO" class="sref">EIOp/a>); o722p/a>        } o723p/a>} o724p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_abort_queue" class="sref">elv_abort_queuep/a>); o725p/a> o726p/a>void pa href="+code=elv_completed_request" class="sref">elv_completed_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) o727p/a>{ o728p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o729p/a> o730p/a>        pspa
 class="comment">/*p/spa
  o731p/a>pspa
 class="comment">         * request is released from the driver, io must be donep/spa
  o732p/a>pspa
 class="comment">         */p/spa
  o733p/a>        if (pa href="+code=blk_account_rq" class="sref">blk_account_rqp/a>(pa href="+code=rq" class="sref">rqp/a>)) { o734p/a>                pa href="+code=q" class="sref">qp/a>->pa href="+code=in_flight" class="sref">in_flightp/a>[pa href="+code=rq_is_sync" class="sref">rq_is_syncp/a>(pa href="+code=rq" class="sref">rqp/a>)]--; o735p/a>                if ((pa href="+code=rq" class="sref">rqp/a>->pa href="+code=cmd_flags" class="sref">cmd_flagsp/a> & pa href="+code=REQ_SORTED" class="sref">REQ_SORTEDp/a>) && o736p/a>                    pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_completed_req_fn" class="sref">elevator_completed_req_fnp/a>) o737p/a>                        pa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_completed_req_fn" class="sref">elevator_completed_req_fnp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=rq" class="sref">rqp/a>); o738p/a>        } o739p/a>} o740p/a> o741p/a>#define pa href="+code=to_elv" class="sref">to_elvp/a>(pa href="+code=atr" class="sref">atrp/a>) pa href="+code=container_of" class="sref">container_ofp/a>((pa href="+code=atr" class="sref">atrp/a>), struct pa href="+code=elv_fs_entry" class="sref">elv_fs_entryp/a>, pa href="+code=attr" class="sref">attrp/a>) o742p/a> o743p/a>static pa href="+code=ssize_t" class="sref">ssize_tp/a> o744p/a>pa href="+code=elv_attr_show" class="sref">elv_attr_showp/a>(struct pa href="+code=kobject" class="sref">kobjectp/a> *pa href="+code=kobj" class="sref">kobjp/a>, struct pa href="+code=attribute" class="sref">attributep/a> *pa href="+code=attr" class="sref">attrp/a>, char *pa href="+code=page" class="sref">pagep/a>) o745p/a>{ o746p/a>        struct pa href="+code=elv_fs_entry" class="sref">elv_fs_entryp/a> *pa href="+code=entry" class="sref">entryp/a> =opa href="+code=to_elv" class="sref">to_elvp/a>(pa href="+code=attr" class="sref">attrp/a>); o747p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a>; o748p/a>        pa href="+code=ssize_t" class="sref">ssize_tp/a> pa href="+code=error" class="sref">errorp/a>; o749p/a> o750p/a>        if (!pa href="+code=entry" class="sref">entryp/a>->pa href="+code=show" class="sref">showp/a>) o751p/a>                return -pa href="+code=EIO" class="sref">EIOp/a>; o752p/a> o753p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=container_of" class="sref">container_ofp/a>(pa href="+code=kobj" class="sref">kobjp/a>, struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a>, pa href="+code=kobj" class="sref">kobjp/a>); o754p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o755p/a>        pa href="+code=error" class="sref">errorp/a> =opa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a> ?opa href="+code=entry" class="sref">entryp/a>->pa href="+code=show" class="sref">showp/a>(pa href="+code=e" class="sref">ep/a>, pa href="+code=page" class="sref">pagep/a>) : -pa href="+code=ENOENT" class="sref">ENOENTp/a>; o756p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o757p/a>        return pa href="+code=error" class="sref">errorp/a>; o758p/a>} o759p/a> o760p/a>static pa href="+code=ssize_t" class="sref">ssize_tp/a> o761p/a>pa href="+code=elv_attr_store" class="sref">elv_attr_storep/a>(struct pa href="+code=kobject" class="sref">kobjectp/a> *pa href="+code=kobj" class="sref">kobjp/a>, struct pa href="+code=attribute" class="sref">attributep/a> *pa href="+code=attr" class="sref">attrp/a>, o762p/a>               const char *pa href="+code=page" class="sref">pagep/a>, pa href="+code=size_t" class="sref">size_tp/a> pa href="+code=length" class="sref">lengthp/a>) o763p/a>{ o764p/a>        struct pa href="+code=elv_fs_entry" class="sref">elv_fs_entryp/a> *pa href="+code=entry" class="sref">entryp/a> =opa href="+code=to_elv" class="sref">to_elvp/a>(pa href="+code=attr" class="sref">attrp/a>); o765p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a>; o766p/a>        pa href="+code=ssize_t" class="sref">ssize_tp/a> pa href="+code=error" class="sref">errorp/a>; o767p/a> o768p/a>        if (!pa href="+code=entry" class="sref">entryp/a>->pa href="+code=store" class="sref">storep/a>) o769p/a>                return -pa href="+code=EIO" class="sref">EIOp/a>; o770p/a> o771p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=container_of" class="sref">container_ofp/a>(pa href="+code=kobj" class="sref">kobjp/a>, struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a>, pa href="+code=kobj" class="sref">kobjp/a>); o772p/a>        pa href="+code=mutex_lock" class="sref">mutex_lockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o773p/a>        pa href="+code=error" class="sref">errorp/a> =opa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a> ?opa href="+code=entry" class="sref">entryp/a>->pa href="+code=store" class="sref">storep/a>(pa href="+code=e" class="sref">ep/a>, pa href="+code=page" class="sref">pagep/a>, pa href="+code=length" class="sref">lengthp/a>) : -pa href="+code=ENOENT" class="sref">ENOENTp/a>; o774p/a>        pa href="+code=mutex_unlock" class="sref">mutex_unlockp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=sysfs_lock" class="sref">sysfs_lockp/a>); o775p/a>        return pa href="+code=error" class="sref">errorp/a>; o776p/a>} o777p/a> o778p/a>static const struct pa href="+code=sysfs_ops" class="sref">sysfs_opsp/a> pa href="+code=elv_sysfs_ops" class="sref">elv_sysfs_opsp/a> =o{ o779p/a>        .pa href="+code=show" class="sref">showp/a>   =opa href="+code=elv_attr_show" class="sref">elv_attr_showp/a>, o780p/a>        .pa href="+code=store" class="sref">storep/a>  =opa href="+code=elv_attr_store" class="sref">elv_attr_storep/a>, o781p/a>}; o782p/a> o783p/a>static struct pa href="+code=kobj_type" class="sref">kobj_typep/a> pa href="+code=elv_ktype" class="sref">elv_ktypep/a> =o{ o784p/a>        .pa href="+code=sysfs_ops" class="sref">sysfs_opsp/a>      = &pa href="+code=elv_sysfs_ops" class="sref">elv_sysfs_opsp/a>, o785p/a>        .pa href="+code=release" class="sref">releasep/a>        =opa href="+code=elevator_release" class="sref">elevator_releasep/a>, o786p/a>}; o787p/a> o788p/a>int pa href="+code=elv_register_queue" class="sref">elv_register_queuep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>) o789p/a>{ o790p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o791p/a>        int pa href="+code=error" class="sref">errorp/a>; o792p/a> o793p/a>        pa href="+code=error" class="sref">errorp/a> =opa href="+code=kobject_add" class="sref">kobject_addp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjp/a>, &pa href="+code=q" class="sref">qp/a>->pa href="+code=kobj" class="sref">kobjp/a>, pspa
 class="string">"%s"p/spa
 , pspa
 class="string">"iosched"p/spa
 ); o794p/a>        if (!pa href="+code=error" class="sref">errorp/a>) { o795p/a>                struct pa href="+code=elv_fs_entry" class="sref">elv_fs_entryp/a> *pa href="+code=attr" class="sref">attrp/a> =opa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>->pa href="+code=elevator_attrs" class="sref">elevator_attrsp/a>; o796p/a>                if (pa href="+code=attr" class="sref">attrp/a>) { o797p/a>                        while (pa href="+code=attr" class="sref">attrp/a>->pa href="+code=attr" class="sref">attrp/a>.pa href="+code=nam"" class="sref">nam"p/a>) { o798p/a>                                if (pa href="+code=sysfs_create_file" class="sref">sysfs_create_filep/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjp/a>, &pa href="+code=attr" class="sref">attrp/a>->pa href="+code=attr" class="sref">attrp/a>)) o799p/a>                                        break; o800p/a>                                pa href="+code=attr" class="sref">attrp/a>++; o801p/a>                        } o802p/a>                } o803p/a>                pa href="+code=kobject_uevent" class="sref">kobject_ueventp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjp/a>, pa href="+code=KOBJ_ADD" class="sref">KOBJ_ADDp/a>); o804p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=registered" class="sref">registeredp/a> =o1; o805p/a>        } o806p/a>        return pa href="+code=error" class="sref">errorp/a>; o807p/a>} o808p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_register_queue" class="sref">elv_register_queuep/a>); o809p/a> o810p/a>void pa href="+code=elv_unregister_queue" class="sref">elv_unregister_queuep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>) o811p/a>{ o812p/a>        if (pa href="+code=q" class="sref">qp/a>) { o813p/a>                struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o814p/a> o815p/a>                pa href="+code=kobject_uevent" class="sref">kobject_ueventp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjp/a>, pa href="+code=KOBJ_REMOVE" class="sref">KOBJ_REMOVEp/a>); o816p/a>                pa href="+code=kobject_del" class="sref">kobject_delp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=kobj" class="sref">kobjp/a>); o817p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=registered" class="sref">registeredp/a> =o0; o818p/a>        } o819p/a>} o820p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_unregister_queue" class="sref">elv_unregister_queuep/a>); o821p/a> o822p/a>int pa href="+code=elv_register" class="sref">elv_registerp/a>(struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=e" class="sref">ep/a>) o823p/a>{ o824p/a>        char *pa href="+code=def" class="sref">defp/a> =opspa
 class="string">""p/spa
 ; o825p/a> o826p/a>        pspa
 class="comment">/* create icq_cache if requested */p/spa
  o827p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_size" class="sref">icq_sizep/a>) { o828p/a>                if (pa href="+code=WARN_ON" class="sref">WARN_ONp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_size" class="sref">icq_sizep/a> < sizeof(struct pa href="+code=io_cq" class="sref">io_cqp/a>)) || o829p/a>                    pa href="+code=WARN_ON" class="sref">WARN_ONp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_align" class="sref">icq_alignp/a> < pa href="+code=__alignof__" class="sref">__alignof__p/a>(struct pa href="+code=io_cq" class="sref">io_cqp/a>))) o830p/a>                        return -pa href="+code=EINVAL" class="sref">EINVALopa>; o831p/a> o832p/a>                pa href="+code=snprintf" class="sref">snprintfp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache_nam"" class="sref">icq_cache_nam"p/a>, sizeof(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache_nam"" class="sref">icq_cache_nam"p/a>), o833p/a>                         pspa
 class="string">"%s_io_cq"p/spa
 , pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>); o834p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a> =opa href="+code=kmem_cache_create" class="sref">kmem_cache_createp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache_nam"" class="sref">icq_cache_nam"p/a>, pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_size" class="sref">icq_sizep/a>, o835p/a>                                                 pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_align" class="sref">icq_alignp/a>, 0, pa href="+code=NULL" class="sref">NULLopa>); o836p/a>                if (!pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a>) o837p/a>                        return -pa href="+code=ENOMEM" class="sref">ENOMEMopa>; o838p/a>        } o839p/a> o840p/a>        pspa
 class="comment">/* register, don't allow duplicate nam"s */p/spa
  o841p/a>        pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); o842p/a>        if (pa href="+code=elevator_find" class="sref">elevator_findp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>)) { o843p/a>                pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); o844p/a>                if (pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a>) o845p/a>                        pa href="+code=kmem_cache_destroy" class="sref">kmem_cache_destroyp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a>); o846p/a>                return -pa href="+code=EBUSY" class="sref">EBUSYopa>; o847p/a>        } o848p/a>        pa href="+code=list_add_tail" class="sref">list_add_tailp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=list" class="sref">listp/a>, &pa href="+code=elv_list" class="sref">elv_listp/a>); o849p/a>        pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); o850p/a> o851p/a>        pspa
 class="comment">/* print pretty m"ssage */p/spa
  o852p/a>        if (!pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=chosen_elevator" class="sref">chosen_elevatorp/a>) || o853p/a>                        (!*pa href="+code=chosen_elevator" class="sref">chosen_elevatorp/a> && o854p/a>                         !pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=CONFIG_DEFAULT_IOSCHED" class="sref">CONFIG_DEFAULT_IOSCHEDp/a>))) o855p/a>                                pa href="+code=def" class="sref">defp/a> =opspa
 class="string">" (default)"p/spa
 ; o856p/a> o857p/a>        pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_INFO" class="sref">KERN_INFOp/a> pspa
 class="string">"io scheduler %s registered%s\n"p/spa
 , pa href="+code=e" class="sref">ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, o858p/a>                                                                pa href="+code=def" class="sref">defp/a>); o859p/a>        return 0; o860p/a>} o861p/a>pa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPLp/a>(pa href="+code=elv_register" class="sref">elv_registerp/a>); o862p/a> o863p/a>void pa href="+code=elv_unregister" class="sref">elv_unregisterp/a>(struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=e" class="sref">ep/a>) o864p/a>{ o865p/a>        pspa
 class="comment">/* unregister */p/spa
  o866p/a>        pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); o867p/a>        pa href="+code=list_del_init" class="sref">list_del_initp/a>(&pa href="+code=e" class="sref">ep/a>->pa href="+code=list" class="sref">listp/a>); o868p/a>        pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); o869p/a> o870p/a>        pspa
 class="comment">/*p/spa
  o871p/a>pspa
 class="comment">         * Destroy icq_cache if it exists.  icq's are RCU managed.  Makep/spa
  o872p/a>pspa
 class="comment">         * sure all RCU operations are complete before proceeding.p/spa
  o873p/a>pspa
 class="comment">         */p/spa
  o874p/a>        if (pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a>) { o875p/a>                pa href="+code=rcu_barrier" class="sref">rcu_barrierp/a>(); o876p/a>                pa href="+code=kmem_cache_destroy" class="sref">kmem_cache_destroyp/a>(pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a>); o877p/a>                pa href="+code=e" class="sref">ep/a>->pa href="+code=icq_cache" class="sref">icq_cachep/a> =opa href="+code=NULL" class="sref">NULLopa>; o878p/a>        } o879p/a>} o880p/a>pa href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPLp/a>(pa href="+code=elv_unregister" class="sref">elv_unregisterp/a>); o881p/a> o882p/a>pspa
 class="comment">/*p/spa
  o883p/a>pspa
 class="comment"> * switch to new_e io scheduler. be careful not to introduce deadlocks -p/spa
  o884p/a>pspa
 class="comment"> * we don't free the old io scheduler, before we have allocated what wep/spa
  o885p/a>pspa
 class="comment"> * need for the new one. this way we have a chance of going back to the oldp/spa
  o886p/a>pspa
 class="comment"> * one, if the new one fails init for some reason.p/spa
  o887p/a>pspa
 class="comment"> */p/spa
  o888p/a>static int pa href="+code=elevator_switch" class="sref">elevator_switchp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=new_e" class="sref">new_ep/a>) o889p/a>{ o890p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=old" class="sref">oldp/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o891p/a>        pa href="+code=bool" class="sref">boolp/a> pa href="+code=registered" class="sref">registeredp/a> =opa href="+code=old" class="sref">oldp/a>->pa href="+code=registered" class="sref">registeredp/a>; o892p/a>        int pa href="+code=err" class="sref">erropa>; o893p/a> o894p/a>        pspa
 class="comment">/*p/spa
  o895p/a>pspa
 class="comment">         * Turn on BYPASS and drain all requests w/ elevator private data.p/spa
  o896p/a>pspa
 class="comment">         * Block layer doesn't call into a quiesced elevator - all requestsp/spa
  o897p/a>pspa
 class="comment">         * are directly put on the dispatch list without elevator datap/spa
  o898p/a>pspa
 class="comment">         * using INSERT_BACK.  All requests have SOFTBARRIER set and nop/spa
  o899p/a>pspa
 class="comment">         * merge happens either.p/spa
  o900p/a>pspa
 class="comment">         */p/spa
  o901p/a>        pa href="+code=blk_queue_bypass_start" class="sref">blk_queue_bypass_startp/a>(pa href="+code=q" class="sref">qp/a>); o902p/a> o903p/a>        pspa
 class="comment">/* unregister and clear all auxiliary data of the old elevator */p/spa
  o904p/a>        if (pa href="+code=registered" class="sref">registeredp/a>) o905p/a>                pa href="+code=elv_unregister_queue" class="sref">elv_unregister_queuep/a>(pa href="+code=q" class="sref">qp/a>); o906p/a> o907p/a>        pa href="+code=spin_lock_irq" class="sref">spin_lock_irqp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_lock" class="sref">queue_lockp/a>); o908p/a>        pa href="+code=ioc_clear_queue" class="sref">ioc_clear_queuep/a>(pa href="+code=q" class="sref">qp/a>); o909p/a>        pa href="+code=spin_unlock_irq" class="sref">spin_unlock_irqp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=queue_lock" class="sref">queue_lockp/a>); o910p/a> o911p/a>        pspa
 class="comment">/* allocate, init and register new elevator */p/spa
  o912p/a>        pa href="+code=err" class="sref">erropa> =o-pa href="+code=ENOMEM" class="sref">ENOMEMopa>; o913p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa> =opa href="+code=elevator_alloc" class="sref">elevator_allocp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=new_e" class="sref">new_ep/a>); o914p/a>        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>) o915p/a>                goto pa href="+code=fail_init" class="sref">fail_initopa>; o916p/a> o917p/a>        pa href="+code=err" class="sref">erropa> =opa href="+code=new_e" class="sref">new_ep/a>->pa href="+code=ops" class="sref">opsp/a>.pa href="+code=elevator_init_fn" class="sref">elevator_init_fnp/a>(pa href="+code=q" class="sref">qp/a>); o918p/a>        if (pa href="+code=err" class="sref">erropa>) { o919p/a>                pa href="+code=kobject_put" class="sref">kobject_putp/a>(&pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=kobj" class="sref">kobjp/a>); o920p/a>                goto pa href="+code=fail_init" class="sref">fail_initopa>; o921p/a>        } o922p/a> o923p/a>        if (pa href="+code=registered" class="sref">registeredp/a>) { o924p/a>                pa href="+code=err" class="sref">erropa> =opa href="+code=elv_register_queue" class="sref">elv_register_queuep/a>(pa href="+code=q" class="sref">qp/a>); o925p/a>                if (pa href="+code=err" class="sref">erropa>) o926p/a>                        goto pa href="+code=fail_register" class="sref">fail_registeropa>; o927p/a>        } o928p/a> o929p/a>        pspa
 class="comment">/* done, kill the old one and finish */p/spa
  o930p/a>        pa href="+code=elevator_exit" class="sref">elevator_exitp/a>(pa href="+code=old" class="sref">oldp/a>); o931p/a>        pa href="+code=blk_queue_bypass_end" class="sref">blk_queue_bypass_endp/a>(pa href="+code=q" class="sref">qp/a>); o932p/a> o933p/a>        pa href="+code=blk_add_trace_msg" class="sref">blk_add_trace_msgp/a>(pa href="+code=q" class="sref">qp/a>, pspa
 class="string">"elv switch: %s"p/spa
 , pa href="+code=new_e" class="sref">new_ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>); o934p/a> o935p/a>        return 0; o936p/a> o937p/a>pa href="+code=fail_register" class="sref">fail_registeropa>: o938p/a>        pa href="+code=elevator_exit" class="sref">elevator_exitp/a>(pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>); o939p/a>pa href="+code=fail_init" class="sref">fail_initopa>: o940p/a>        pspa
 class="comment">/* switch failed, restore and re-register old elevator */p/spa
  o941p/a>        pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa> =opa href="+code=old" class="sref">oldp/a>; o942p/a>        pa href="+code=elv_register_queue" class="sref">elv_register_queuep/a>(pa href="+code=q" class="sref">qp/a>); o943p/a>        pa href="+code=blk_queue_bypass_end" class="sref">blk_queue_bypass_endp/a>(pa href="+code=q" class="sref">qp/a>); o944p/a> o945p/a>        return pa href="+code=err" class="sref">erropa>; o946p/a>} o947p/a> o948p/a>pspa
 class="comment">/*p/spa
  o949p/a>pspa
 class="comment"> * Switch this queue to the given IO scheduler.p/spa
  o950p/a>pspa
 class="comment"> */p/spa
  o951p/a>int pa href="+code=elevator_change" class="sref">elevator_changep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, const char *pa href="+code=nam"" class="sref">nam"p/a>) o952p/a>{ o953p/a>        char pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>[pa href="+code=ELV_NAME_MAX" class="sref">ELV_NAME_MAXp/a>]; o954p/a>        struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=e" class="sref">ep/a>; o955p/a> o956p/a>        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>) o957p/a>                return -pa href="+code=ENXIO" class="sref">ENXIOp/a>; o958p/a> o959p/a>        pa href="+code=strlcpy" class="sref">strlcpyp/a>(pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=nam"" class="sref">nam"p/a>, sizeof(pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>)); o960p/a>        pa href="+code=e" class="sref">ep/a> =opa href="+code=elevator_get" class="sref">elevator_getp/a>(pa href="+code=strstrip" class="sref">strstripp/a>(pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>), pa href="+code=tru"" class="sref">tru"p/a>); o961p/a>        if (!pa href="+code=e" class="sref">ep/a>) { o962p/a>                pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> pspa
 class="string">"elevator: type %s not found\n"p/spa
 , pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>); o963p/a>                return -pa href="+code=EINVAL" class="sref">EINVALopa>; o964p/a>        } o965p/a> o966p/a>        if (!pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>->pa href="+code=type" class="sref">typep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>)) { o967p/a>                pa href="+code=elevator_put" class="sref">elevator_putp/a>(pa href="+code=e" class="sref">ep/a>); o968p/a>                return 0; o969p/a>        } o970p/a> o971p/a>        return pa href="+code=elevator_switch" class="sref">elevator_switchp/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=e" class="sref">ep/a>); o972p/a>} o973p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elevator_change" class="sref">elevator_changep/a>); o974p/a> o975p/a>pa href="+code=ssize_t" class="sref">ssize_tp/a> pa href="+code=elv_iosched_store" class="sref">elv_iosched_storep/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, const char *pa href="+code=nam"" class="sref">nam"p/a>, o976p/a>                          pa href="+code=size_t" class="sref">size_tp/a> pa href="+code=count" class="sref">countopa>) o977p/a>{ o978p/a>        int pa href="+code=ret" class="sref">retopa>; o979p/a> o980p/a>        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>) o981p/a>                return pa href="+code=count" class="sref">countopa>; o982p/a> o983p/a>        pa href="+code=ret" class="sref">retopa> =opa href="+code=elevator_change" class="sref">elevator_changep/a>(pa href="+code=q" class="sref">qp/a>, pa href="+code=nam"" class="sref">nam"p/a>); o984p/a>        if (!pa href="+code=ret" class="sref">retopa>) o985p/a>                return pa href="+code=count" class="sref">countopa>; o986p/a> o987p/a>        pa href="+code=printk" class="sref">printkp/a>(pa href="+code=KERN_ERR" class="sref">KERN_ERRp/a> pspa
 class="string">"elevator: switch to %s failed\n"p/spa
 , pa href="+code=nam"" class="sref">nam"p/a>); o988p/a>        return pa href="+code=ret" class="sref">retopa>; o989p/a>} o990p/a> o991p/a>pa href="+code=ssize_t" class="sref">ssize_tp/a> pa href="+code=elv_iosched_show" class="sref">elv_iosched_showp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, char *pa href="+code=nam"" class="sref">nam"p/a>) o992p/a>{ o993p/a>        struct pa href="+code=elevator_queue" class="sref">elevator_queuep/a> *pa href="+code=e" class="sref">ep/a> =opa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa>; o994p/a>        struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=elv" class="sref">elvopa>; o995p/a>        struct pa href="+code=elevator_type" class="sref">elevator_typep/a> *pa href="+code=__e" class="sref">__ep/a>; o996p/a>        int pa href="+code=len" class="sref">lenp/a> =o0; o997p/a> o998p/a>        if (!pa href="+code=q" class="sref">qp/a>->pa href="+code=elevator" class="sref">elevatoropa> || !pa href="+code=blk_queue_stackable" class="sref">blk_queue_stackablep/a>(pa href="+code=q" class="sref">qp/a>)) o999p/a>                return pa href="+code=sprintf" class="sref">sprintfp/a>(pa href="+code=nam"" class="sref">nam"p/a>, pspa
 class="string">"none\n"p/spa
 ); 1000p/a> 
1001p/a>        pa href="+code=elv" class="sref">elvopa> =opa href="+code=e" class="sref">ep/a>->pa href="+code=type" class="sref">typep/a>; 1002p/a> 1003p/a>        pa href="+code=spin_lock" class="sref">spin_lockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); 1004p/a>        pa href="+code=list_for_each_entry" class="sref">list_for_each_entryp/a>(pa href="+code=__e" class="sref">__ep/a>, &pa href="+code=elv_list" class="sref">elv_listp/a>, pa href="+code=list" class="sref">listp/a>) { 1005p/a>                if (!pa href="+code=strcmp" class="sref">strcmpp/a>(pa href="+code=elv" class="sref">elvopa>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>, pa href="+code=__e" class="sref">__ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>)) 1006p/a>                        pa href="+code=len" class="sref">lenp/a> +=opa href="+code=sprintf" class="sref">sprintfp/a>(pa href="+code=nam"" class="sref">nam"p/a>+pa href="+code=len" class="sref">lenp/a>, pspa
 class="string">"[%s] "p/spa
 , pa href="+code=elv" class="sref">elvopa>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>); 1007p/a>                else 1008p/a>                        pa href="+code=len" class="sref">lenp/a> +=opa href="+code=sprintf" class="sref">sprintfp/a>(pa href="+code=nam"" class="sref">nam"p/a>+pa href="+code=len" class="sref">lenp/a>, pspa
 class="string">"%s "p/spa
 , pa href="+code=__e" class="sref">__ep/a>->pa href="+code=elevator_nam"" class="sref">elevator_nam"p/a>); 1009p/a>        } 1010p/a>        pa href="+code=spin_unlock" class="sref">spin_unlockp/a>(&pa href="+code=elv_list_lock" class="sref">elv_list_lockopa>); 1011p/a> 1012p/a>        pa href="+code=len" class="sref">lenp/a> +=opa href="+code=sprintf" class="sref">sprintfp/a>(pa href="+code=len" class="sref">lenp/a>+pa href="+code=nam"" class="sref">nam"p/a>, pspa
 class="string">"\n"p/spa
 ); 1013p/a>        return pa href="+code=len" class="sref">lenp/a>; 1014p/a>} 1015p/a> 1016p/a>struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_rb_former_request" class="sref">elv_rb_former_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, 1017p/a>                                      struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) 1018p/a>{ 1019p/a>        struct pa href="+code=rb_node" class="sref">rb_nodep/a> *pa href="+code=rbprev" class="sref">rbprevopa> =opa href="+code=rb_prev" class="sref">rb_prevopa>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>); 1020p/a> 1021p/a>        if (pa href="+code=rbprev" class="sref">rbprevopa>) 1022p/a>                return pa href="+code=rb_entry_rq" class="sref">rb_entry_rqp/a>(pa href="+code=rbprev" class="sref">rbprevopa>); 1023p/a> 1024p/a>        return pa href="+code=NULL" class="sref">NULLopa>; 1025p/a>} 1026p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rb_former_request" class="sref">elv_rb_former_requestp/a>); 1027p/a> 1028p/a>struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=elv_rb_latter_request" class="sref">elv_rb_latter_requestp/a>(struct pa href="+code=request_queue" class="sref">request_queuep/a> *pa href="+code=q" class="sref">qp/a>, 1029p/a>                                      struct pa href="+code=request" class="sref">requestp/a> *pa href="+code=rq" class="sref">rqp/a>) 1030p/a>{ 1031p/a>        struct pa href="+code=rb_node" class="sref">rb_nodep/a> *pa href="+code=rbnext" class="sref">rbnextopa> =opa href="+code=rb_next" class="sref">rb_nextopa>(&pa href="+code=rq" class="sref">rqp/a>->pa href="+code=rb_node" class="sref">rb_nodep/a>); 1032p/a> 1033p/a>        if (pa href="+code=rbnext" class="sref">rbnextopa>) 1034p/a>                return pa href="+code=rb_entry_rq" class="sref">rb_entry_rqp/a>(pa href="+code=rbnext" class="sref">rbnextopa>); 1035p/a> 1036p/a>        return pa href="+code=NULL" class="sref">NULLopa>; 1037p/a>} 1038p/a>pa href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOLp/a>(pa href="+code=elv_rb_latter_request" class="sref">elv_rb_latter_requestp/a>); 1039p/a>p/pre>
lxr.linux.no kindly hosted by Redpill Linpro ASp/a>, provider of Linux consulting and operations services since 1995.