linux/lib/scatterlist.c
<<
>>
Prefs
   1/*
   2 * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com>
   3 *
   4 * Scatterlist handling helpers.
   5 *
   6 * This source code is licensed under the GNU General Public License,
   7 * Version 2. See the file COPYING for more details.
   8 */
   9#include <linux/export.h>
  10#include <linux/slab.h>
  11#include <linux/scatterlist.h>
  12#include <linux/highmem.h>
  13#include <linux/kmemleak.h>
  14
  15/**
  16 * sg_next - return the next scatterlist entry in a list
  17 * @sg:         The current sg entry
  18 *
  19 * Description:
  20 *   Usually the next entry will be @sg@ + 1, but if this sg element is part
  21 *   of a chained scatterlist, it could jump to the start of a new
  22 *   scatterlist array.
  23 *
  24 **/
  25struct scatterlist *sg_next(struct scatterlist *sg)
  26{
  27#ifdef CONFIG_DEBUG_SG
  28        BUG_ON(sg->sg_magic != SG_MAGIC);
  29#endif
  30        if (sg_is_last(sg))
  31                return NULL;
  32
  33        sg++;
  34        if (unlikely(sg_is_chain(sg)))
  35                sg = sg_chain_ptr(sg);
  36
  37        return sg;
  38}
  39EXPORT_SYMBOL(sg_next);
  40
  41/**
  42 * sg_nents - return total count of entries in scatterlist
  43 * @sg:         The scatterlist
  44 *
  45 * Description:
  46 * Allows to know how many entries are in sg, taking into acount
  47 * chaining as well
  48 *
  49 **/
  50int sg_nents(struct scatterlist *sg)
  51{
  52        int nents;
  53        for (nents = 0; sg; sg = sg_next(sg))
  54                nents++;
  55        return nents;
  56}
  57EXPORT_SYMBOL(sg_nents);
  58
  59
  60/**
  61 * sg_last - return the last scatterlist entry in a list
  62 * @sgl:        First entry in the scatterlist
  63 * @nents:      Number of entries in the scatterlist
  64 *
  65 * Description:
  66 *   Should only be used casually, it (currently) scans the entire list
  67 *   to get the last entry.
  68 *
  69 *   Note that the @sgl@ pointer passed in need not be the first one,
  70 *   the important bit is that @nents@ denotes the number of entries that
  71 *   exist from @sgl@.
  72 *
  73 **/
  74struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents)
  75{
  76#ifndef ARCH_HAS_SG_CHAIN
  77        struct scatterlist *ret = &sgl[nents - 1];
  78#else
  79        struct scatterlist *sg, *ret = NULL;
  80        unsigned int i;
  81
  82        for_each_sg(sgl, sg, nents, i)
  83                ret = sg;
  84
  85#endif
  86#ifdef CONFIG_DEBUG_SG
  87        BUG_ON(sgl[0].sg_magic != SG_MAGIC);
  88        BUG_ON(!sg_is_last(ret));
  89#endif
  90        return ret;
  91}
  92EXPORT_SYMBOL(sg_last);
  93
  94/**
  95 * sg_init_table - Initialize SG table
  96 * @sgl:           The SG table
  97 * @nents:         Number of entries in table
  98 *
  99 * Notes:
 100 *   If this is part of a chained sg table, sg_mark_end() should be
 101 *   used only on the last table part.
 102 *
 103 **/
 104void sg_init_table(struct scatterlist *sgl, unsigned int nents)
 105{
 106        memset(sgl, 0, sizeof(*sgl) * nents);
 107#ifdef CONFIG_DEBUG_SG
 108        {
 109                unsigned int i;
 110                for (i = 0; i < nents; i++)
 111                        sgl[i].sg_magic = SG_MAGIC;
 112        }
 113#endif
 114        sg_mark_end(&sgl[nents - 1]);
 115}
 116EXPORT_SYMBOL(sg_init_table);
 117
 118/**
 119 * sg_init_one - Initialize a single entry sg list
 120 * @sg:          SG entry
 121 * @buf:         Virtual address for IO
 122 * @buflen:      IO length
 123 *
 15'cla"+code=sg_is_last" class="sref">sg_is_lcode=sg__is_last" class.c#L25" id="L25" c1ass="lne" name="L104"> 104void_contf="+code=sg_init_tabl_coass="sref">sg_init_table(struct scatterlisl, scatterlpanl, sgl, unsipan cll, nents)
  26{
  87void scatterlisl, sg_init_table);
  28, scatterlisl, scatterlpanl, sgl, unsipan cll, sg_init_table);
 115}
ne" name="L116"> 116EXPORT_SYMBOL,  *sg)1)
NULL1;
   1<1" class="1line" name="L32">  32
sg++1;
   4 * Sc1="+code=s1g" class="sref">sg))1)
 15'cla"f="+code=1sg" class="sref">sg)1;
  79        struct scatterlist *sglsref">scatterlpangfp_ne" name="L79"> gfp_n    sef">scatterlpangfp_maske" name="L79"> gfp_maskgl, unsipan cll,   36
sg1;
  53ref">i].  381}
   1<1g_next" c1lass="sref">sg_next)1;
 * sg_init_one - Initial" class="1line" name="L40">  40
 12m)> 121kernel dataterlistu121">   4 * Sc1a>/**
  47 121="L70ref">E name="L47">  47llinux/kmemleak.h>

bet.c nttcoupl cl(snd=e"usas>E name="L47">  47 *

 -positive)="l=pan c/o>injax_plude <e" nallL42">E name="L47">  47sgl[0].< 47">  47  46/**
  47sg)1;
scatterlpanl,+code=sg_chain_ptrsref">s = (ef">sc)lass="sX_SINGLE___"L4_=s1g_an cde=sg_chain_ptr__"L4_=s1g_an c">EXPORT_SYMBOL,ll, >
,lass="c1_st *EXPORT_SYMBOL,+code=sg_chain_ptrsref">sf">scatterlpangfpPAGE" eZEde=sg_chain_ptrPAGE" eZEref">sgf">scatterlpangfp_masa>, >
 110  90        return +code=sg_chain_ptrsref">semleak.h>
 } "L78">  78#else
 110  90        return list *i].sgl< 79        struct scatterlpangfp_masa>, >
 115}
  14
 "L104"> 104void_cone=s1g> *(struct scatterlisl, sgl, unsigned int nents)
  26{
 53ref">i].  381}
,lass="c1_=s1g> *scatterlisl, aemleak.h>
,=s1g_an cde=sg_chain_ptr=s1g_an c">EXP"sref">sgllong)lass="sX_SINGLE_aemleak.h>
 } "L78">  78#else
 111 eRT_SYMBOL,l=s1g> *scatterlisl, aemleak.h>
 115}
  93
  64/**
  65 * sFs1gof prec/kfs21"mapppart of a cs="comment">/**
  66 ** @sg of a c    /**
  67
  68Fs1gofun>
   the scatterlist
  69
  70 * Description:
  71
  72  73   4win:s__de=his is part o.      IO length
  64 *
  65sg)1;
 104void___de==s1g_nt"> de=sg_chain_ptr__de==s1g_nt"> " sg_init_table(struct  " sgscatterlisl, "+code=sg_init_tablent"> " sge"sref">sgl, unsigned int max_"come=sg_init_tablemax_"com" sges="sref">sg)1;
 11"> 111 eRT_SYMBOL,de==s1g_fcode=sg_is_chain" c=s1g_fc" sgscatterlisl, =s1g_fcode=sg_is_chain=s1g_fc" sgsref">nents)
  381}
  79        struct scatterlist *>
  40
  34        if (BUG_ON(!"+code=sg_init_tablent"> " sgs="sref">sg->nents)
 110  90>
  93
 114        sg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->>
 whon 2        if ("+code=sg_init_tablent"> " sgs="sref">sg->oria href="+code=sg_nentsoria href=ne" name="L38">  381}
 110 sref">sgl, unsigned int his isf">s"+code=sg_nentshis isf">slassf">sg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->oria href="+code=sg_nentsoria href=ne" emleak.h>
 11"> 111sref">sgl, unsigned int nass">s"+code=sg_nentsnass">sne" emleak.h>
  58
   1<1g_next" c1lass="sref">sg_next)1;
haveile CO="fn max_"comdsegm"comdlefte the first one,
 12m)> 121kernel dataterc1t ofsef"> "commlass"comm, it coul of a c aftis liceg:      one.      IO length
se impot ont">l   V="fn 70ref"s">sref"nce   used o      IO length

  94 121sg" class="sref">sg)1;
  35  34        if (his isf">s"+code=sg_nentshis isf">slassf="sr>, unsigned int max_"come=sg_init_tablemax_"com" sgname="L38">  381}
 110 ine" nametterlist *href="+code=sg_nextlass="srs="sref">sg = sgg_mark_end(&sgl[max_"come=sg_init_tablemax_"com" sgsref">nents - 1]);
 11"> 111 nametterlist *his isf">s"+code=sg_nentshis isf">slassf">sg_magic = max_"come=sg_init_tablemax_"com" sgnents - 1]);
 nametterlist *nass">s"+code=sg_nentsnass">sne" f">sg_magic = his isf">s"+code=sg_nentshis isf">slassfrefnents - 1]);
  381}
 110  nametterlist *nass">s"+code=sg_nentsnass">sne" f">sg_magic = his isf">s"+code=sg_nentshis isf">slass">SG_MAGIC);
 111                        href="+code=sg_nextlass="srs="sref">sg = NULL;
 110 "L115"> 115}
  93
  54                "+code=sg_init_tablent"> " sgs="sref">sg->oria href="+code=sg_nentsoria href=ne"  -="sref">sg = s"+code=sg_nentsnass">sne" emleak.h>
  35                =s1g_fcode=sg_is_chain=s1g_fc" sgfor_each_sg(sgl, his isf">s"+code=sg_nentshis isf">slassf">SG_MAGIC);
 110 114        sg_magic = href="+code=sg_nextlass="sremleak.h>
 "L115"> 115}
  58
 sg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->sg = NULL;
 115}
sg = EXPORT_SYMBOL,__de==s1g_nt"> de=sg_chain_ptr__de==s1g_nt"> " sgf">SG_MAGIC);
  32
/**
 * Sc1="+de==s1g_nt"> * sFs1gof prec/kfs21"it_one part of a cs="comment">/**
  15 ** @smapppart of a c    /**
  16/**
  17 **/
 104void_con=s1g_nt"> de=sg_chain_ptrde==s1g_nt"> " sg_init_table(struct  " sgscatterlisl, "+code=sg_init_tablent"> " sgs="sref">sg)
  381}
 sg_magic = __de==s1g_nt"> de=sg_chain_ptr__de==s1g_nt"> " sg_atterlisl, "+code=sg_init_tablent"> " sge"ass="sX_SINGLE_ALLOd"sref"/1scatterlist.c#L26" id="L126" eclents"srine" ="sref">sgl,  *SG_MAGIC);
  91}
  92EXPORT_SYMBOL( de=sg_chain_ptrde==s1g_nt"> " sgf">SG_MAGIC);
  93
 15'cla"+code=slass="comment">/**
  65/**
  66 ** @sg of a c    /**
  97 nents:         Numbera single entry sg list
  68
 119
ne23name="L120"> 120/**
  71/**
   1<1" class="lass="comment"> * Description:

     90 2 4 * Sc1="+ ne" in47 90>
se@max_"com.      IO length
 15'cla"f="+code=10nt* us  34s="comlisobiggis li4">@max_"com,r of entries in s willrk_end() should be
  66
  97
  68 * Notes:
  69 ()cleanup s toleftov">  t_one - Inlass="comment">/**
 12m)>a      IO length
  42 **/
, unsigned int __de=his is partde=sg_chain_ptr__de=his is part" sg_init_table(struct  " sgscatterlisl, "+code=sg_init_tablent"> " sge"sref">sgl, unsigned int p_ne" name="L79"> gfp_n    sefnt"> **/
  54      sref">sgl, unsigned int max_"come=sg_init_tablemax_"com" sge">scatterlpangfp_maske" name="L79"> gfp_maskgl, unsipan cll,  **/
  35  114        , his isfme=sg_init_tablehis isfm" sgs="sref">sg)
  26{
  77        struct scatterlist *sg, *prv href="+code=sgprvass="sref">NULL;
sgl, unsigned int left href="+code=sgleftass="sref">NULL;
  59
  76#ifndef ARCH_HAS_SG_CHAIN
  76#ifndef BUG_ON(ef="+X_SINGLE_ALLOde=sg_magic"="sr>, unsigned int max_"come=sg_init_tablemax_"com" sgn"sref">NULL;
 113#endif
  93
 114        memset("+code=sg_init_tablent"> " sge"sref">sgl, 0, sizeof(*"+code=sg_init_tablent"> " sgsn"sref">NULL;
NULL;
 106        left href="+code=sgleftass=f">sg_magic = hr href="+code=nents" class="sref">nents;
  87void prv href="+code=sgprvass=s="sref">sg = NULL;
  381}
sgl, unsigned int nass">s"+code=sg_nentsnass">sne" ="sref">sgl, his isf">s"+code=sg_nentshis isf">slasss="sref">sg = left href="+code=sgleftass="sref">NULL;
  40
 111  34        if (his isf">s"+code=sg_nentshis isf">slassf="sr>, unsigned int max_"come=sg_init_tablemax_"com" sgname="L38">  381}
 110 ="L87">  87void his isf">s"+code=sg_nentshis isf">slassf">sg_magic = max_"come=sg_init_tablemax_"com" sgnents - 1]);
  83 a>  114        s"+code=sg_nentsnass">sne" f">sg_magic = his isf">s"+code=sg_nentshis isf">slassfrefnents - 1]);
  54 } "L78">  78#else
  35  a> 114        s"+code=sg_nentsnass">sne" f">sg_magic = his isf">s"+code=sg_nentshis isf">slassnents - 1]);
 - 1]);
 11"> 111106        left href="+code=sgleftass=f-="sref">sg = s"+code=sg_nentsnass">sne" emleak.h>
  58
,sg_magic = his isfme=sg_init_tablehis isfm" sg        if (his isf">s"+code=sg_nentshis isf">slassf">scatterlpangfp_masa>, >
 110  34        if (BUG_ON(!aname="L38">  381}
 111          ="L1">   1<1g_next" c1lass="sref">sg_next)1;
  72 9flectment"> *  ld o      IO length
  73 *  prec/kfsof a c wo="commenbe">   4foas="comment">/**
  64  65   lass="comment">/**
  46 **/
 11"> 111  >  34        if (prv href="+code=sgprvass=s="sref">sg)
 nammmmmmmmmsg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->ef="+X_SINGLE_ALLOde=sg_magic"  ++sg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->oria href="+code=sg_nentsoria href=ne" emleak.h>
  59
 110  nam 90-="L92">  92>
 111 ="L91">  91}
  32
  83                scatterlisl, s/a>        if (his isf">s"+code=sg_nentshis isf">slassaemleak.h>
  54                "+code=sg_init_tablent"> " sgs="sref">sg->ef="+X_SINGLE_ALLOde=sg_magic"  sg_magic = "+code=sg_init_tablent"> " sgs="sref">sg->oria href="+code=sg_nentsoria href=ne"  +="sref">sg = s"+code=sg_nentsnass">sne" emleak.h>
NULL;
 110  ="L1">   1<1g_next" c1lass="sref">sg_next)1;
  47  *  fir  tmapping,ofsef"> t @sg of a c    /**
  68 >  47*  fir  tmapping,og" namtrec/kfsothe last table part.
  69 **/
 110  34        if (prv href="+code=sgprvass=s="sref">sg)
 111                        scatterlisl, prv href="+code=sgprvass=>s/a>        if (max_"come=sg_init_tablemax_"com" sge">scatterlpangfpaemleak.h>
 110 "L78">  78#else
  83 a>  114        "+code=sg_init_tablent"> " sgs="sref">sg->sg = emleak.h>
  14
  35  ="L1">   1<1g_next" c1lass="sref">sg_next)1;
  96 one, lass47*  "srefs="sref">sg_next)1;
  97 **/
BUG_ON(!left href="+code=sgleftass=s="sref">sg)
sg_mark_end(&="sref">sgl[s"+code=sg_nentsnass">sne" fref">nents - 1]);
  40
 111  87void prv href="+code=sgprvass=s="sref">sg = emleak.h>
 } whon 2        if (left href="+code=sgleftass=semleak.h>
  93
  900emleak.h>
 115}
 116EXPORT_SYMBOL(__de=his is partde=sg_chain_ptr__de=his is part" sgsemleak.h>
 117
 118/**
 119/**
 120 ** @sg of a c    /**
 121 nents:         Numbera single entry sg list
 122
a      IO length
 * Sc1="+ss="comment"> * Description:
  15 largis li4" * Description:
  16
  17
 118 **/
, unsigned int nashis is partde=sg_chain_ptrde=his is part" sg_init_table(struct  " sgscatterlisl, "+code=sg_init_tablent"> " sge"sref">sgl, unsigned int p_ne" name="L79"> gfp_n    sef">scatterlpangfp_maske" name="L79"> gfp_maskgl, unsipan cll,   36
  381}
  /a>, unsigned int rref="+code=memsetretass="sref">NULL;
  32
 , unsigned int rref="+code=memsetretass=s="sref">sg = __de=his is partde=sg_chain_ptr__de=his is part" sg_atterlisl, "+code=sg_init_tablent"> " sge", unsigned int p_ne" name="L79"> gfp_n    sef">scatterlpangfpALLOd"sref"/1scatterlist.c#L26" id="L126" eclents"srine" =="L32">  32
  54      > 111  87void ll, sgl,  *>
  34        if (nents)
 110 114        __de==s1g_nt"> de=sg_chain_ptr__de==s1g_nt"> " sg_atterlisl, "+code=sg_init_tablent"> " sge"ass="sX_SINGLE_ALLOd"sref"/1scatterlist.c#L26" id="L126" eclents"srine" ="sref">sgl,  *SG_MAGIC);
 117
  90        return rref="+code=memsetretass="sref">NULL;
 115}
ne3 name="L116"> 116EXPORT_SYMBOL, SG_MAGIC);
NULL1;
   1<1" class="1laast table part.

 3 4 * Sc1="+ nnnnnnnnnnnnnnnnnnnnnnnnnnnfn 7rray>
 15'cla"f="+code=10@sgt:nnnnnnnn* @sg of a c    /**
  66  97 t @san clasrrayast table part.
  68 *  fir  tan cm it coultart of>a bufflas="comment">/**
  69s:nnnnnnnnents:    vnit="L4tclai> t @sbuffla (aftis offs90)s="comment">/**

 12m)>a      IO length
  42 * Description:

bet.c nttcouas  sran claof> *  pn clasroulquashsgl. A"uscas="comment">/**

 -positive)="l=pan c/o>injas  smay providonensoffs90 at"fo-tart "+coats">se   vnit="* Sc1/a>/**
  46/**
  47 last table part.
  68
  69 * Description:

 12m)>as="comment"> **/
, unsigned int nashis is part==som_an clde=sg_chain_ptrde=his is part==som_an cl" sg_init_table(struct  " sgscatterlisl, sgte=sg_init_table" tne" =="L32">  32
 init_table(struct an cde=sg_chain_ptran c">EX *"sref">sg, *pn clde=sg_chain_ptran cl" sge"sref">sgl, unsigned int p_an clde=sg_chain_ptrn_an cl" sg=="L32">  32
 sref">sgllong>, unsigned int offs90"+code=sg_nentsoffs90" sge"sref">sgllong>, unsigned int s">s"+code=sg_nentsn">slassf="L32">  32
 >scatterlpangfp_maske" name="L79"> gfp_maskgl, unsipan cll,   36
  26{
 sref">sgl, unsigned int chunksNULL;
sgl, unsigned int iNULL;
sgl, unsigned int cur_an cde=sg_chain_ptrcur_an cass="sref">NULL;
  /a>, unsigned int rref="+code=memsetretass="sref">NULL;
  77        struct scatterlist *NULL;
  32
 e="L1">   1<1" class="1l " cpu prs@ denotescontiguoul chunksoas="comment"> **/
 114        chunks - 1]);
 for PORT_SYMBOL,i, unsigned int i, unsigned int p_an clde=sg_chain_ptrn_an cl" sg; ++sg_magic = i  36
 110  34        if (pn c_to_pfme=sg_init_tablepn c_to_pfm">EXPORT_SYMBOL,pn clde=sg_chain_ptran cl" sg="sref">sgl[isg = pn c_to_pfme=sg_init_tablepn c_to_pfm">EXPORT_SYMBOL,pn clde=sg_chain_ptran cl" sg="sref">sgl[i + 1ame="L36">  36
 11"> 11111111111++sg_magic = chunksNULL;
  58
 sg_magic = rref="+code=memsetretass=s="sref">sg = nashis is partde=sg_chain_ptrde=his is part" sg_atterlisl, sgte=sg_init_table" tne" = 114        chunksscatterlpangfp_masa>, >
  34        if (nents)
 111  90        return rref="+code=memsetretass="sref">NULL;
  32
 e="L1">   1<1" class="1l merging>chunkso"+copu ting>theml **/
 114        cur_an cde=sg_chain_ptrcur_an cass=s="0emleak.h>
 >scatterlpangfpfor_each_, sgte=sg_init_table" tne" s="sref">sg->sgl, sgl, sg->oria href="+code=sg_nentsoria href=ne" ="sref">sgl, i  381}
 110 sref">sgllong>, unsigned int chunk_s">s"+code=sg_nentschunk_s">sass="sref">NULL;
 11"> 111sref">sgl, unsigned int j"+code=sg_nentsjass="sref">NULL;
  58
   1<1g_next" c1lllook for 7*  "sraof> *  g:      chunkoas="comment"> **/
 110 for PORT_SYMBOL,j"+code=sg_nentsjass=s="sref">sg = cur_an cde=sg_chain_ptrcur_an cass=s+efn>, unsigned int j"+code=sg_nentsjass=s&lsr>, unsigned int p_an clde=sg_chain_ptrn_an cl" sg; ++sg_magic = j"+code=sg_nentsjass=sref">nents)
 111 "L110">  34        if (pn c_to_pfme=sg_init_tablepn c_to_pfm">EXPORT_SYMBOL,pn clde=sg_chain_ptran cl" sg="sref">sgl[j"+code=sg_nentsjass=]) !=ref">nents)
 110 s="line" namea>        if (pn c_to_pfme=sg_init_tablepn c_to_pfm">EXPORT_SYMBOL,pn clde=sg_chain_ptran cl" sg="sref">sgl[j"+code=sg_nentsjass=fref"> + 1ame="L36">  36
  83                 break"sref">NULL;
  14
 ine" namea>        if (chunk_s">s"+code=sg_nentschunk_s">sass=s="(PORT_SYMBOL,j"+code=sg_nentsjass=s-"sref">sg = cur_an cde=sg_chain_ptrcur_an cass=)s&lsr&lsr>, unsigned int PAGE_SHIFTde=sg_chain_ptrPAGE_SHIFTass=)s-"sref">sg = offs90"+code=sg_nentsoffs90" sg"sref">NULL;
 110  ref">sg = nass90_an cde=sg_chain_ptrnass90_an c" sg_atterlisl, sode=scatterlist"ass=="sref">sgl, pn clde=sg_chain_ptran cl" sg="sref">sgl[cur_an cde=sg_chain_ptrcur_an cass=]>s/a>        if (ms="+code=sg_nentsms=f">scatterlisl, s">s"+code=sg_nentsn">slassfmea>        if (chunk_s">s"+code=sg_nentschunk_s">sass=)fmea>        if (offs90"+code=sg_nentsoffs90" sgaemleak.h>
 11"> 111106        s">s"+code=sg_nentsn">slassf-="sref">sg = chunk_s">s"+code=sg_nentschunk_s">sass="sref">NULL;
        if (offs90"+code=sg_nentsoffs90" sgs="0emleak.h>
,cur_an cde=sg_chain_ptrcur_an cass=s=", unsigned int j"+code=sg_nentsjass="sref">NULL;
 "L115"> 115}
NULL1;
  900emleak.h>
 115}
EXPORT_SYMBOL, >
NULL;
  96
  97  ra single entry sg list
  68sg_next)1;
  69efs="sref">sg_next)1;
sg_next)1;
 12m)>a      IO length
   1<1" class="lass="comment"> * Description:
bet.c nttcouaast table part.

 -positive)="l=pan c/o>injasContext> * Description:
  46  97 **/
 104void_conmi hr_-tartde=sg_chain_ptrde=mi hr_-tart">EXPinit_table(struct scatterlist *mi hrde=sg_chain_ptrmi href">,  77        struct scatterlist * **/
sgl, unsigned int p_ne" name="L79"> gfp_n    sef"sref">sgl, unsigned int flag" name="L79"> gfflag"ass=sref">nents)
  381}
  76#ifndef memset(mi hrde=sg_chain_ptrmi href">, sref">sgl(struct sn"sref">NULL;
  32
 , unsigned int mi hrde=sg_chain_ptrmi href">s="sref">sg->__sg_magic = NULL;
 114        s="sref">sg->__p_ne" name="L79"> gf__=sg_magic"  sg_magic = hr href="+code=nents" class="sref">nents;
 >scatterlpangfps="sref">sg->__offs90"+code=sg_nents__offs90" sgs="0emleak.h>
 106        WARNhref="+code=BUG_ONWARNhres="sr!ref">memset(flag" name="L79"> gfflag"ass= g_mar4        if (="L1ITER_TO_SG name="L79"> gf="L1ITER_TO_SGass= |"ass="sX_SINGLE_ALLOITER_FROM_SG name="L79"> gf="L1ITER_FROM_SGef">snn"sref">NULL;
  87void s="sref">sg->__flag" name="L79"> gf__flag"agic"  sg_magic = flag" name="L79"> gfflag"ass="sref">NULL;
 115}
EXPORT_SYMBOL, EXn"sref">NULL;
  40
 12m)1laast table part.
   1<1" class="lasde=mi hr_next -oprocesglmapping i hr="or a=" of next mappingast table part.

 15'cla"+code=suaast table part.
  65 * Description:
  66sg_next)1;
  97sg_next)1;
  68sg_next)1;
 119sg_next)1;
ne43name="L120"> 120 * Description:
  71
   1<1" class="las  tillr@mi hr iss-topped.  May sleep  34!="L1ITER_ATOMIC. * Description:

 4 4 * Sc1="+R90 * Description:
 15'cla"f="+code=10ntnite  34smi hr contains" of next mapping. sfalse  34"sraof>sgast table part.
  66/**
  97 **/
,boo href="+code=sglboo agic"ORT_SYMBOL, EXPinit_table(struct scatterlist *mi hrde=sg_chain_ptrmi href">sref">nents)
  381}
 sref">sgl, unsigned int off"+code=sg_nentsofflassfmea>        if (len"+code=sg_nentslenass="sref">NULL;
NULL1;
 e="L1">   1<1" class="1l "heck for "sra"+codrops 9sources =som  *  ld o i hr="L47"as="comment"> **/
  34BUG_ON(!s="sref">sg->__p_ne" name="L79"> gf__=sg_magicsref">nents)
  54  90        return false name="L79"> gffalseass="sref">NULL;
NULL;
 106        de=mi hr_-topde=sg_chain_ptrde=mi hr_-tops="sref">memset(mi hrde=sg_chain_ptrmi href">n"sref">NULL;
 117
   1<1" class="1l get a=" of next a s 34necessary. s__offs90missadju  e="L47-top"as="comment"> **/
s="sref">sg->__offs90"+code=sg_nents__offs90" sgs=">sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg->__sg->length"+code=sg_nentslengthass=)sme="L38">  381}
 110  34<--="L92">  92s="sref">sg->__p_ne" name="L79"> gf__=sg_magicssme="L38">  381}
 111                        mi hrde=sg_chain_ptrmi href">s="sref">sg->__sg_magic = EXP               mi hrde=sg_chain_ptrmi href">s="sref">sg->__NULL;
 110 ="L87">  87void s="sref">sg->__offs90"+code=sg_nents__offs90" sgs="0emleak.h>
  83 } "L78">  78#else
  54  54  90        return false name="L79"> gffalseass="sref">NULL;
 "L115"> 115}
  ="L1">   1<1" class="1l map" of next pn caas="comment"> **/
sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg->__sg->offs90"+code=sg_nentsoffs90" sgs+  87void s="sref">sg->__offs90"+code=sg_nents__offs90" sg"sref">NULL;
 sg_magic = len"+code=sg_nentslenass=f">sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg->__sg->length"+code=sg_nentslengthass=s-"sref">sg = s="sref">sg->__offs90"+code=sg_nents__offs90" sg"sref">NULL;
  40
  76#ifndef s="sref">sg->an cde=sg_chain_ptran c">EX   sg_magic = hth_an cde=sg_chain_ptrhth_an c">EXPORT_SYMBOL, EXPORT_SYMBOL,mi hrde=sg_chain_ptrmi href">s="sref">sg->__        if (off"+code=sg_nentsofflassf="sr="sr>, unsigned int PAGE_SHIFTde=sg_chain_ptrPAGE_SHIFTass=)"sref">NULL;
NULL;
 , unsigned int mi hrde=sg_chain_ptrmi href">s="sref">sg->length"+code=sg_nentslengthass=s">sg_magic = minske" name="L79"> minsk">EXPsref">sgl        if (len"+code=sg_nentslenass=fmea>        if (PAGE_SIZEde=sg_chain_ptrPAGE_SIZEass=s-"sref">sg = off"+code=sg_nentsofflass)"sref">NULL;
 114        mi hrde=sg_chain_ptrmi href">s="sref">sg->consumecode=sg_mark_endconsumecass=f">sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg->length"+code=sg_nentslengthass="sref">NULL;
NULL;
  34        if (s="sref">sg->__flag" name="L79"> gf__flag"agic"g_mar4ass="sX_SINGLE_ALLOITER_ATOMIC name="L79"> gf="L1ITER_ATOMICagicsref">nents)
 11"> 111/a>        if (s="sref">sg->addrde=sg_chain_ptraddrass=f">sg_magic = kmap_atomia> *EXPORT_SYMBOL,mi hrde=sg_chain_ptrmi href">s="sref">sg->an cde=sg_chain_ptran c">EX)s+  87void off"+code=sg_nentsofflass"sref">NULL;
  78#else
,s="sref">sg->addrde=sg_chain_ptraddrass=f">sg_magic = kmap> *EXPORT_SYMBOL,mi hrde=sg_chain_ptrmi href">s="sref">sg->an cde=sg_chain_ptran c">EX)s+  87void off"+code=sg_nentsofflass"sref">NULL;
  40
  90        return nite"+code=sg_nentsnitelass"sref">NULL;
 115}
EXPORT_SYMBOL, EX)"sref">NULL;
  14
 15'cla"f="+code1laast table part.
  66  97
  68
  69 * Description:
sg_next)1;
  71
   1<1" class="las  resumec"L47call In0de=mi hr_next() 47"it.nn* ent"> useful whe7ast table part.
/**
 15'cla"+code=suaast table part.
EXPORT_SYM4ame="L55"> ine" namea>  4c"L47a>
5" namea>  4c"L47a>
5" nam" class4=    4" id="L76" class4="lin47 name="L66">  d" ="sref">sgl, i **/
nentsn">sl48ccessful  90  97mea>     4  if (offs90"+code=sg_ne4tsoff48ib/4scatterli4st.c#L79" id="LL58" class4="lin458L1" class="l, unsigmeRT_SYMB4L,cur_an cde=sg_chai4_ptrc4r_an ct">EXPinit_table(struct n"sref">NULL;
_i href">scatterlist *mi hrde=sg_chain_ptrmi href">sref">nents)
  38}4  76>1;
sg->an cde=sg_cha"L79"> gfflag"ass= g_mar4     t;consumecode=sg_mark_endconsumecass=f">sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg-ref">NULL;
NULL;
  140emleak.h4/a>>
 , unsig}
theml  34sg-&g>->__flag" name="L79"> gf__flag"agic"g_mar4ass="sX_SINGLE_ALLOITEcokmap">EXPORT_SYMBOL,mclass4="lin45name="L111"> 111
sass=s="(PORT_SYMBOL,j"+e=sg_nents__offs90" sgs="0emleak.h>
NULL;
s="sref">sgass4="lin47 name="L14">  140">sglast table part.
<4 href49" class4="lin45 name="L87">  ="L1">s="sref">sg-&g>->__flag" name="L79"> gf__flag"agic"g_mar4ass="sX_SINGLE_ALLOITER_ATOMIC name="L79"> gf="L1ITER_ATOMICagicsref">nents)
 gf="L1ITER_FROM22"4id" i43 nameme="L38">  38     4@mi hr:ra smapping i hrm4itbou490" sgs="0emleak.hs="(PORT_SYMBOL,j"+flush_kernel_dc id=n_ptrmi href">s="sreflush_kernel_dc id=n_ptra>->an cde=sg_chain_ptran c">EX)s+  87void off"+code=sg_nentsofflass"sref">NULL;
  140eRT_SYMB4@sgl:ra singlm iti hr="e4ov">e4s="sress4="lin47 name="L14">  14s="sref">sg-t;__flag" name="L79"> gf__flag"agic"g_mar4ass="sX_SINGLE_ALLOITER_ATOMIC name="L79"> gf="L1ITER_ATOMICagicsref">nents)
 111 12m)>a5     IO length
s="sref">sg->__/a>Cna>->an cde=sg_chap/4scattit_table" tne" = 1p/4scattit_a>-&gclass4"line41 name="L87">  87 * Descripti5n:s="sref">sg->__offs90"+codkune=sg_chain_ptrmi href">s="une=sg_chaina>->an cde=sg_chain_ptran c">EX)s+  87void off"+code=sg_nencokmap">EXPORT_SYMBOL,mcass4"line41 name="L87">  87  54
 gffalseass="sref">NULLt;__offs90"+codkune=s_ptrmi href">s="une=sa>->an cde=sg_chain_ptran c">EX)s+  87void off"+code=sg_nentsofflass"sref">NULL;
  14inja5Context> * Description:<5span>50" class4""lin466name="L52">  34, sode=in_ptran c">EX   sg_magic = hth_an cde=sg_chain_ptrhth_an c">EXPORT_SYMBOL, ass4="lin47 name="L14">  14 **/
<5 href50f">s="sref">sg->addrde=sg_chain_ptraddrass=f">sg_magic = kmap_atomia> *EXPORT_SYMBOL,mi hrNULde=sg_chain_ptrdNULdass4="lin47 name="L14">  14sg_magic = minske" name="L79"> minsk">EXPsref">sgllass4="lin45 name="L83">  83sgl, unsigned int p5ne" n5me="L79"> gfp_n    seft;consumecode=sg_mark_endconsumecass=f">sg_magic = mi hrde=sg_chain_ptrmi href">s="sref">sg-&glass4="lin45 name="L83">  831}
NULLmemass3="lin39class="sref">NULL, EX)"sref">NULL;
n"sref">NULL;aass4="lin47 name="L14">  14s="5ref">sss4="lin47 name="L14">  14s="51ib/4cde=sg_chain_ptrnasan c="L76" class4="lin47 name="L66">  66s="51e5" nam" class4=    4"n"scopy_erlis3.- Copya3 clabetw#L81/3bcnearterlis3.href=n SGid="L98" class3="lin39 name="L68">  68  68s="51t @san clasrrayast table part.L6i" id="L91" class4"line40c#ass="1" cl(classr5}
sg_next)1;
erlcaaaaaaaaaaaaaaaaaWher3cattcopy4" iame="L4"> 3 4sg_next)1;
scaaaaaaaaaaaaaaTd="rlis4.t.c#ef="liattcopyme="L4"> 3 4sg_next)1;
-&g="lib/natterlis4.c#ame="L4"> 3 4
  68  68
  97
  65 * Descripti5n:
  34s"+code=sg_ode=sg_nentslenas=sg_od id="sref">NULL;
n"scopy_erlis3/a>;
_i href">scatterlist **/
sgl, unsigned int flag" name="L79"> gfflag"ass=sref==4===* 44 name="L83">  34NULLEXref="lib/4c9atteerlme="L79"> gfflaerl" claehunk_s">s"+code=sg_ode=sg_nentslenas=sg_od id="sref">NULL;erl">sme="L79"> gfflaerl-"sref">s>, unsigned int flato_erlis3i4st.c#L72" id="o_erlis3/a>;22"4id" i43 nameme="L38">  38<5 111sg_next)1;5NULL;
 * Description:<5span>53" id="L91" cl_i href">scatterlist *mi hrde=sg_chain_ptrmi href">sref">nents)
t;consumecode=sg_mark_endconsumecass=f">sg_mass3="lin38"L1" class="line" n5Nef">NULL;
 115NULL;
,mi hra>)
 115
sss4="lin47 name="L14">  14 * Sc1="5R90 * Description:<5span>53ef">sg-&g>->__flag" name=to_erlis3i4st.c#L72" id="o_erlis3/a>;22"4id" i43 nameme="L38">  38<5="+code=15ntnite  34smi hr contain5" of 53hunk_s">sass=s="(PORT_SYMBOL,j"+t.c#tterli4.c#L118" id=t.c#tterXPORT|_SYMBOL,mi hra>)
 115  54 **/
<5 href53sf-="sref">sg = chunk_s">s"+code=.c#tterli4.c#L118" id=t.c#tterXPORT|_SYMBOL,mi hra>)
 gf="L1ITER_FROMass4"line4 name="L115"> 1151}
 = mi hrde=sg_chain_pt(struct sg_moria href="+code=sg"sref">sgl,  gfflag"ass=sref"hunk_s">s"+code=.c#tterli4.c#L118" id=t.c#tterXPORaass4="lin47 name="L14">  14, u5signed int off"+code=sg_5entso54" class4="lin47name="L111">  901;
sg->an cde=sg_chalocal_irq_savptrhth_an c">EXPlocal_irq_savp>EX)"sref">NULL;tterlis4.c#L110" id="L110" claass4="lin47 name="L14">  14 , unsi5>BUG_ON(!s="sref">sg->__offs90"+codtruct sg_m)TOMICaOMICagicsref">nentssg = offserl">sme="L79"> gfflaerl-"sref"alass4="lin45name="L111"> 111 5      return false name=5L79">5gffalseass="sref">NULL="sref">NULL;
NULL 106, sode=rmi href">s="sref">sg->__s"+code=sg_mark_endconsumecass=f">sg_m.= minske" name="L79"> minsk">EXPsref">sgls"+codeerl">sme="L79"> gfflaerl-"sref"a>;
  14  38<5/a>      5 if ( gfp_n    sef"sretterlisl, sode=memcpretass==sref">nememcpr (chunk_s">s"+code=serlme="L79"> gfflaerl" cl href="lib/4ccatterlitterli3st.c#L86" id="L86" cl"+code=sg_nentsn">smark_endconsumecass=f">sg_m.= minske" name=href="+cokmap_atomia">EXPORE_SIZEde=sg_chain_ptrPAGE_SIZEass=s-"sref"aass4="lin47 name="L14">  14  92s="sref">sg< class4="lin45 name="L54">  54s="sref">sg->__nememcpr (chunk_s">s"+code=s>smark_endconsumecass=f">sg_m.= minske" name=href="+cokmap_atomia">EXPORE_SIZEde=sg_chainerlme="L79"> gfflaerl" cl href="lib/4ccatterlitterli3st.c#L86" id="L86" cl"+code=sg_nentsn"_ptrPAGE_SIZEass=s-"sref"aass4="lin47 name="L14">  14 , unsi5 } "L78">5 78#else
nentsNULL 590        return fal5e nam5="L79"> gffalsass3="lin39class="sref">NULL}5 106memset(mi hrde=sg_chain_ptrmi href">n"sref">NULL;
OMICat;consumecode=sg_mark_endconsumecass=f">sg_m)===4===* 44class="sref">NULLsg_m5gic = mi hrde=sg_chain_ptlocal_irq_reULLrptrhth_an c">EXPlocal_irq_reULLrp>EX)"sref">NULL;tterlis4.c#L110" id="L110" claass4="lin47 name="L14">  14 = l5n"+code=sg_nentslenass=f5>sg_m5gic = mi ha>;
 110NULLs="56=======4===* 44 name="L52"> e="L1"5ned int o5f"+code=sg_nentsofflassf5_mar=56i hr="or a=" of next mappin="L76" class4="lin47 name="L66">  66s="56sgast table part.
  68s="56a href="lib/4bcatterli4ist.c#Ltb/4caaaaaaaaaaaaaaaaaTd="L6id="L98" class3="lin39 name="L68">  685" nam" class4=    4"L6i" id="L91" class4"line40c#ass="1" cl(classr5        i5 ( 3 4scaaaaaaaaaaaaaaTd="rlis4.t.c#ef="liattcopyme="L4"> 3 4  69,sg_next)1;
  97sg_next)1;
  97  34, =sg_ode=sg_nentslenas=sg_od id="sref">NULL;
n"scopy_95" ierlis3/a>;
_i href">scatterlist **/
sgl, unsigned int flag" name="L79"> gfflag"ass=sref==4===* 44 name="L83">  34EXref="lib/4c9atteerlme="L79"> gfflaerl" claehunk_s">s"+code=sg_ode=sg_nentslenas=sg_od id="sref">NULL;erl">sme="L79"> gfflaerl-"sref"22"4id" i43 nameme="L38">  38<5
 111
<5 href575c = mi ha>;
n"scopy_erlis3/a>;
ia href="+code=sg"sref">sgl,  gfflag"ass=sref"hunk_s">s"+codeerlme="L79"> gfflaerl" claehunk_s">s"+codeerl">sme="L79"> gfflaerl-"sref">s0aass4="lin47 name="L14">  14NULLs"+codeEX)"sref">NULL;
n"scopy_95" ierlis3/a>;aass4="lin47 name="L14">  14#e5st table part.
 * Descripti5n:
  66  66  68 useful whL6i" id="L91" class4"line40c#ass="1" cl(classr5de <),a5   9sources (kmap) nesgl5itbou59lease="during i hr="L47lass="cterlcaaaaaaaaaaaaaaaaaWher3cattcopy4to91" class4"line40c#ass="1" cl(classr5d
.scaaaaaaaaaaaaaaTd="rlis4.t.c#ef="liattcopyme="L4"> 3 4
5" namea>  4c"L475>
5" nam" class4=    4me="L4"> 3 4  97nent5n">sl58ccessful  90  97#e5  if (offs90"+code=sg_ne5tsoff58ib/4scatterli4st.c#L79" id="L===========4===* 44 name="L83">  34,cur_an cde=sg_chai5_ptrc58>EXPORT_SYMBOL, =sg_ode=sg_nentslenas=sg_od id="sref">NULL;
;
_i href">scatterlist **/
sgl, unsigned int flag" name="L79"> gfflag"ass=sref==4===* 44 name="L83">  34}5s="sref">sg<.c#L84" it">EXref="lib/4c9atteerlme="L79"> gfflaerl" claehunk_s">s"+code=sg_ode=sg_nentslenas=sg_od id="sref">NULL;erl">sme="L79"> gfflaerl-"sref"22"4id" i43 nameme="L38">  38<5>1;
sass4="lin45name="L111"> 111>
n"scopy_erlis3/a>;
ia href="+code=sg"sref">sgl,  gfflag"ass=sref"hunk_s">s"+codeerlme="L79"> gfflaerl" claehunk_s">s"+codeerl">sme="L79"> gfflaerl-"sref", 1aass4="lin47 name="L14">  14thass3="lin39class="sref">NULLsaunk_s">s"+codeEX)"sref">NULL;
;aass4="lin47 name="L14">  14
LXR #L79unityref", tli4sexperi9" ial vers" i=byis4="lin47mailto:lxr@rliux.no">lxr@rliux.nosg_m.
lxr.rliux.no kindly host.c#L49s4="lin47http://www.redpill-rlipro.no">Redpill Llipro ASref", provid3scattLliux sref"ltt.c#hrefop#L43" i" idrvilib/since 1995.