linux/block/blk-integrity.c
<<
ptio15ptio15>>ptptioptio15 ">ptio15ptio15Searchptio15Prefs. 15ptpt ">pio15 5.
5 51/*5 52 * blk-integrity.c - Block layer data integrity extens vs5 53 *5 54 * Copyright (C) 2007, 2008 Oracle Corpora v5 55 * Written by: Martin K. Petersen <martin.petersen@oracle.com>5 56 *5 57 * This program is free software; you cav redistribute it and/or5 58 * modify it under the terms of the GNU General Public License vers v5 59 * 2 as published by the Free Software Founda v.5 " a> *5 11 * This program is distributed in the hope that it will be useful, but5 12 * WITHOUT ANY WARRANTY; without even the implied warranty of5 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU5 14 * General Public License for more details.5 15 *5 16 * You should have received a copy of the GNU General Public License5 17 * along with this program; see the file COPYING. If not, write to5 18 * the Free Software Founda v, 675 Mass Ave, Cambridge, MA 02139,5 19 * USA.5 2 a> *5 21 */5 22.5 23#include <linux/blkdev.h>.5 24#include <linux/mempool.h>.5 25#include <linux/bio.h>.5 26#include <linux/scatterlist.h>.5 27#include <linux/export.h>.5 28#include <linux/slab.h>.5 29.5 30#include "blk.h".5 31.5 32static struct5kmem_cache *integrity_cachep;.5 33.5 34static const char *bi_unsupported_nam = "unsupported"5 35.5 36/**5 37 * blk_rq_count_integrity_sg - Count number of integrity scatterlist elements5 38 * @q: request queue5 39 * @bio: bio with integrity metadata attached5 4 a> *5 41 * Descri> v: Returns the number of elements required in a5 42 * scatterlist corresponding to the integrity metadata in a bio.5 43 */5 44int5blk_rq_count_integrity_sg(struct5request_queue *q, struct5bio *bio).5 45{.5 46 struct5bio_vec *iv, *ivprv = NULL;.5 47 unsigned int5segments = 0;.5 48 unsigned int5seg_size = 0;.5 49 unsigned int5i = 0;.5 50.5 51 bio_for_each_integrity_vec(iv, bio, i) {.5 52.5 53 if (ivprv) {.5 54 if (!BIOVEC_PHYS_MERGEABLE(ivprv, iv)).5 55 goto new_segment;.5 56.5 57 if (!BIOVEC_3=BIOVEC_ >>>>>>>>> 2e"v276p2opav3.seg_size = 0;.5 47 unsigned int55 57 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt55 575 47="line" nam L56">5 56.5 49 6 un61>>>>>> 2e"v276p2opav3.bio_for_each_int6grity6vec(bio, 5 47 unsigned int5 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt55 52. 2e"v276p2opav3.bio, iv++k/blk-integrity.c#L7"t/spav3.5 47 unsigned int5 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt5BIOVEC_3=BIO6EC_ >6>>>>>>> seg_size = 0;.5 45{. k/blk-integrity.c#L7"t/spav3.5 49 7 un71>>>>>> }/blk-integrity.c#L7"t/spav3.bio_for_each_int7grity7vec(bio, ivk/blk-integrity.c#L7"t/spav3.5 52. EXPORT_SYMBOlass="line" nam EXPORT_SYMBOl="line" nam L56">5ref="block/blk-integrity.c#L43" id L43" class="line" nam L43">5 43)k/blk-integrity.c#L7"t/spav3.5 55 7y: Martinn K. Petersen <martin5 35.BIOVEC_3=BIO7EC_ >7ne" nam L37">5 37 v: Returngria1">5 41 * blk_rq_count_integrity_sg - Count number of inte8 50seg_size = 0;.5 38 * @q: request qu8s="line"8nam L49">5 49 8 un8data attached5 41bio_for_each_int8grity8d L41" class="line" nam L4pported" * Descri> vectorsurns"> * blkrngriapported"5 52.5 13 ">5 41()number of elements required in a * scatterli8y: Marti8n K. Petersen <marti8 */5 44int5blk_rq_count_integrity_s,spav class="comment"> * scatterli83.int55 415 41q, 9 50seg_size = 0;.bio).5 45{.5 46 struct55 49 9 un91="+code=new_ref="+code=bio" class=">5 415 415 46 struct5bio_for_each_int9grity92href="+code=iv" class="sref">iv, *ivprv = iv, *5 48 unsigned int55 52.5 55 9if (!i = 0;.5 50.5 51 5 55 9y: Marti9n K. Petersen <marti9i) {.9>>>>>>> 5 53 if (ivprv) {.5 54 9ref="blocck/blk-integrity.c#L8" isref"99>>>>>> 2e"v276p2opav3.5 55 10"> * 2 as0 published by the Free S01ef=k-1>>>>>> new_segment;.5 56.5 57 if (!>>>>> 2e"v276p2opav3.5 57 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt55 575 47="line" nam L56">5 56.BIOVEC_PHYS_MERGEABLE(ivprv, iv)).0 * General Public Licens06ef=k-5" class="line" nam L55">5 55 10f="block/0blk-integrity.c#L16" id 07ef=k-f="+code=new_segment" class="="line" nam L4gcode=ivprv" clasgtegr- (C) ock/blk-integrlengthcode=ivprv" clalengtht5 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt5>>>>>> 2e"v276p2opav3.new_segment * 2 as published by the Free So1ef=k11>>>>>> >>>>> bio, 54gcode=ivprv" clasgtegr k/blk-integrity.c#L7"t/spav3.BIOVEC_PHYS_}/blk-integrity.c#L7"t/spav3.> * General Public Licensse fo115" class="line" nam L55">5 55 1ef="block//blk-integrity.c#L16" id L1611f="+code=new_segment" class="="line" nam L4ga ht_pagegtde=ivprv" clasg_ ht_page="line" nam L56">54gcode=ivprv" clasgtegram L57">5 57 - (C) ock/blk-integriv_pagegtde=ivprv" claiv_pagetegram L57">5 57 - (C) ock/blk-integriv_l+pre#L51" id L51"v_l+pt55 57 - (C) ock/blk-integriv_offse>de=ivprv" claiv_offse&tegr k/blk-integrity.c#L7"t/spav3.>>>>>> iv++k/blk-integrity.c#L7"t/spav3.>>>>> 5 55 1ine" nam 1 L19">5 195 45{. k/blk-integrity.c#L7"t/spav3.>>>>> }/blk-integrity.c#L7"t/spav3.5 22.BIOV="line" nam L4gamark_endgtde=ivprv" clasg_mark_end="line" nam L56">54gcode=ivprv" clasgtegr k/blk-integrity.c#L7"t/spav3.>.5 55 1.ivk/blk-integrity.c#L7"t/spav3.>1;. EXPORT_SYMBOlass="line" nam EXPORT_SYMBOl="line" nam L56">5ref="blmapegrity.c#L36"c#L43" id L43" class=mapegrity.c#L36"5 43 k/blk-integrity.c#L7"t/spav3.5 218#include <5 55 1"line" na1m L29">5 29.5 145 30#includ1e &qu13c5c3d0e1fd0e9b35b39d1_3/0"3 proould 15" woritykclass="comment">/**5 32s1tatic13 L12" class="line" nam L12"@gd1L38" clasDtykmmen9d1p="class="comment">/**5 13/**5 34static con1st ch13ntegrity.c#L14" id L14" class="line" nam L14">5 14bi_unsupported_nam <1/a> =1"u12"block/blk-intMeta-devices like DMam MD needmmenver575 35.5 375 38/**5 213. ajaa * @bio:1 bio with integri1ty me1adata attached * scatterli1v3.5 44int51c#L43" id L43"b1tegrity.c#L46" id L46gd1c#L43" id L43"gd144">- (C) ock/blk-integrgrity.c#Lc#L43" id L43"grity.c#Lrityk/blk-integrity.c#L7"t/spav3.request_que1ue2c#L43" id L43"b2tegrity.c#L46" id L46gd2c#L43" id L43"gd2tegr- (C) ock/blk-integrgrity.c#Lc#L43" id L43"grity.c#Lrityk/blk-integrity.c#L7"t/spav3.5 55 1de=bio_ve1c" class="sref">bio_vec<1/a> *1a href="+code=sref">new_segment1c#L43" id L43"b1tegri amp; amp; ">new_segment2c#L43" id L43"b2tegr if (!>>>>>> = 0;.1lass="sre1f">seg_size = 0;.new_segment1c#L43" id L43"b1tegri|| ">new_segment2c#L43" id L43"b2tegr if (!5 49 1 u151>>>>>> bio_for_each_int1egrit1_vec(iv,1 bio, < clag" class="sref">1c#L43" id L43"b1tegr- (C) ock/blk-integrsector>5 47 unsigctor>5 47">bio!ty.c#L46" id L46>2c#L43" id L43"b2tegr- (C) ock/blk-integrsector>5 47 unsigctor>5 47">bik-integrity.c#L52" id L52" class="l1ine" nam 1 L52">5 52.5KERN_ERRcode=ivprv" claKERN_ERRlk-inass="line" nam L33">5 33<%s: %s/%s igctor sz %uo!ty%u\n="block/blk-iam L57">5 575ntegrity.c#L52" id L52" class="l1i_queue" 1href="+code=BIOVEC_PHYS_1MERGE1BLE" class="sref">BIOVEC_PHYS.c#L46" id L46gd1c#L43" id L43"gd144">- (C) ock/blk-integrdtyka href="block/blk-indtyka hret55 57bio, 1c#L43" id L43"b1tegr- (C) ock/blk-integrsector>5 47 unsigctor>5 47">bi"block/blk-integri2c#L43" id L43"b2tegr- (C) ock/blk-integrsector>5 47 unsigctor>5 47">bikned int5>1lass="sref">BIOVEC_3=BIO1VEC_ 1>>>>>>>> }/blk-integrity.c#L7"t/spav3.seg_size = 0;.1c#L43" id L43"b1tegr- (C) ock/blk-integrtuple>5 47 unstuple>5 47">bio!ty.c#L46" id L46>2c#L43" id L43"b2tegr- (C) ock/blk-integrtuple>5 47 unstuple>5 47">bik-integrity.c#L52" id L52" class="l16s="line"16nam L49">5 49 16 u161>>>>>> 5KERN_ERRcode=ivprv" claKERN_ERRlk-inass="line" nam L33">5 33<%s: %s/%s tuple sz %uo!ty%u\n="block/blk-iam L57">5 575ntegrity.c#L52" id L52" class="l16c" class16"sref">bio_for_each_int16grit162>>>>>> - (C) ock/blk-integrdtyka href="block/blk-indtyka hret55 57bio, 1c#L43" id L43"b1tegr- (C) ock/blk-integrtuple>5 47 unstuple>5 47">bi"block/blk-integri2c#L43" id L43"b2tegr- (C) ock/blk-integrtuple>5 47 unstuple>5 47">bikned int55 52.5 55 16 16 goto161c#L43" id L43"b1tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegri amp; amp; lock/blk-integri2c#L43" id L43"b2tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegri amp; amp; fg" class="sref">1c#L43" id L43"b1tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegri!ty.c#L46" id L46>2c#L43" id L43"b2tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegr)k-integrity.c#L52" id L52" class="l16h>16ass="sref">BIOVEC_3=BIO16EC_ 16>>>>>>> 5KERN_ERRcode=ivprv" claKERN_ERRlk-inass="line" nam L33">5 33<%s: %s/%s tag sz %uo!ty%u\n="block/blk-iam L57">5 575ntegrity.c#L52" id L52" class="l16f="block16blk-integrity.c#L43"02=16sref169>>>>>> - (C) ock/blk-integrdtyka href="block/blk-indtyka hret55 57seg_size = 0;.1c#L43" id L43"b1tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegr"block/blk-integri2c#L43" id L43"b2tegr- (C) ock/blk-integrta">5 47 unsta">5 47tegr)ned int55 49 17 u171>>>>>> bio_for_each_int17grit172>>>>>> }/blk-integrity.c#L7"t/spav3.iv,175 52.strcmi="line" nam L56">5r1c#L43" id L43"b1tegr- (C) ock/blk-integr href="block/blk-in hret55 57BIOV="line" nam LprL52kcode=ivprv" claprL52k="line" nam L56">5KERN_ERRcode=ivprv" claKERN_ERRlk-inass="line" nam L33">5 33<%s: %s/%s type %so!ty%s\n="block/blk-iam L57">5 575ntegrity.c#L52" id L52" class="l17 href="b17lock/blk-integrity.c#L517id 176">bio, - (C) ock/blk-integrdtyka href="block/blk-indtyka hret55 575r1c#L43" id L43"b1tegr- (C) ock/blk-integr href="block/blk-in hret55 57>17ass="sref">BIOVEC_3=BIO17EC_ 17>>>>>>> >>>>> }/blk-integrity.c#L7"t/spav3.seg_size = 0;.5 55 18s="line"18nam L49">5 49 18 u181>>>>>> av clasgned int5bio_for_each_int18grit18d L4}/blk-integrity.c#L7"t/spav3.iv,185ref=grity.c#L39d1p="cc#L43" id L43" clagrity.c#L39d1p="c5 43)ned int55 52.5 55 18if (! */5 44int5bio, >>>>>> srefg" class="sref">ef=grity.c#L3r 56.ef=grity.c#L3r 56.>>>>> seg_size = 0;.5 55 19s="line"19nam L49">5 49 19 u191="+code=new_srefg" class="sref"/bl.5 57linux/ex19c" class19"sref">bio_for_each_int19grit192>>>>>> - (C) ock/blk-integrlimi"+code=ivprv" clalimi"+44">. ock/blk-integrmaxagrity.c#L367"ef="+code=ivprv" clamaxagrity.c#L367"ef="+="li if (!bio, 5 52.5 55 19if (!5ref=grity.c#L3merge_r 56.>>> a bio. */5 44int5blk_rq_count_integrity_sg(struct5 * 2 a20 published by the Free 201ef=2-1>>>>integrity.c#L52" id L52" class="l20"block/b20k-integrity.c#L11" id 202ef=2-2>>>>>> a bio.ivk/blk-integrity.c#L7"t/spav3.bio, ivk/blk-integrity.c#L7"t/spav3.5 220blk-integrity.c#L13" id204ef=204" class="line" nam L55">5 55 20See the 20NUivity.c#L46" id L46" class="line" nam L46">5 46 struct5ivity.c#L46" id L46def="block/blk-integrity.c#L43" id L43" class="line" nam L43">5 43<4" id L44" class="line" nam L44">5 g" class="sref">blk_rq_count_integrity_sg 46 struct5ivity.c#L46" id L46n=">de=ivprv" clan="&="li 46 struct5>>>>ed int5>>>>> srefg" class="sref"/bl.5 57ivilinux/export.h" class="fref">linux/exp vers v<2/spav3.- (C) ock/blk-integrlimi"+code=ivprv" clalimi"+44">. ock/blk-integrmaxagrity.c#L367"ef="+code=ivprv" clamaxagrity.c#L367"ef="+="li if (! * 2 a2 published by the Free 2o1ef=211>>>>>> (bio, ivk/blk-integrity.c#L7"t/spav3.5 55 2=See the 2GNU * General Public Licen2se fo215" cl}/blk-integrity.c#L7"t/spav3.5ref=grity.c#L3merge_ity.c#L51" id L51"ef=grity.c#L3merge_ity5 43g 46 struct5>>>>ed int5>>>ref="+code=bio" class=grity.c#L36ysfs_f="rLc#L43" id L43"grity.c#L36ysfs_f="rLE" clintegrity.c#L52" id L52" class="l2e Founda 2 v, 675 Mass Ave, Cambr2idge,220="+code=new_ref="+code=bio" class=attribut3.ivk/blk-integrity.c#L7"t/spav3.5 19>>>>(sg" class="sref"showgtde=ivprv" clashow5 43g struct5>>>>> g" class="sref"s5 47_>de=ivprv" clas5 47_&>>>>>(sg" class="sref"sto"cc#L43" id L43"sto"c5 43g>>>g 46 struct5 struct5.5 55 2>.2>>>>ode=bio" class=grity.c#L3attr_showgtde=ivprv" clagrity.c#L3attr_show5 435 44int5ivantegrity.c#L52" id L52" class="l2empool.h<2/a>>.bio, ">5 51 b unsntegrity.c#L52" id L52" class="l2.ef="bloc2>>.5kobjgtde=ivprv" clakobj44">5 44int5g 46 struct55 228#include <5 29.5 51 contaf="r_of="line" nam L56">5attr.iva_ref="+code=bio" class=grity.c#L36ysfs_f="rLc#L43" id L43"grity.c#L36ysfs_f="rLE" c5 g" class="sref"attr.ivg 46 struct55 30#includ2e &qu23vec(5 32s2tatic23f">bio, 5r">5 51 b u5 g" class="sref"pagegtde=ivprv" clapagetegr 46 struct5 *>.2 L34">5 34static con2st ch23ntegr/blk-integrity.c#L7"t/spav3.bi_unsupported_nam <2/a> =2>>>>ode=bio" class=grity.c#L3attr_sto"cc#L43" id L43"grity.c#L3attr_sto"c5 435/blk-integrity.c#L7"t/spav3.int5iva con>>2grity.c#L37" id L37" cl2ass="23>>>>>>> >>>i ock/blk-integrcou 2e"v276p2opavcou tegr if (!q, 2fL28">5 223.">5 51 b unsntegrity.c#L52" id L52" class="l2> * @bio:2 bio with integri2ty me241>>>>>> 5gtde=ivprv" clakobj44">5 44int5g 46 struct5g 46 struvL28v3.5 29.5 51 contaf="r_of="line" nam L56">5attr.iva_ref="+code=bio" class=grity.c#L36ysfs_f="rLc#L43" L43"gry5r">5 515 55< L43"gd124">- (C) ock/blk-integrg2ity.c24 *>>>>ed href="+code=iv" class="sref2class="li2ne" nam L3grity.c#L11" id 2111" 222>>>*>>>>ed href="+code=iv" class="sref2class="li2ne" nam L3grity.c#L11" id 2111" 222>>, >>>>>> 5 55< blockattr43"b1tegri amp; amp; ">n2w_seg24"ef=grity.c#L3merge_ity5 43g 46 h>12;.">5 51(5 55 t1c#L23" id L43"b1tegri|| ">n2w_seg2ent t43" clagram L49">5 49 1 2 u152>>>>>>>static con2st ch23ntegr/blk-integrity.c#L7"t/spav3.bi_unsuppspav3.k-integ2rity.22LE" cstatic g" spav3.k-int"s5 47_>de=ivprv" clas5 4ode=q" class="sref">q, 2fL28">5 223.bio, 2 47 unsigti18ef=gri" id L46de=blk_rq_count_in="+code=srefg" class="sref">egrit240="+code=new_re43" id L43"b1tegr- (C) ock/blk-integr href="blflass="sref">ef=gri" id L46de=blk_rq_count_in="block/b2lk-in226">bio, 5 57>, BIOV="line" nam LprL52kcode=ERN_ERRcode=ivprv" claKERN_ERRlk>egrit240="+code=new_re43" id L43"b1tegr- (C) ock/blk-integr href="bl53214" class="line" nam L55">5 55< L43"gd22egr- (C) ock/blk-integrd2yka h2ef="block/blk-/blk214" class="line" nam L55">5 55< tde=ivprv(C) ock/blk-integrsector25 47<2a> unsigctor>5 47">bikin125" class="liss="l L52" class="l2iss="l 22>>, BIOV="line" nam LprL52noneERN_ERRcode=ivp53214" class="line" nam L55">5 55< blockattr goto1 2a h1e25+code=ivprv" class="sref">ivk/blk-integ2de=seg_si2e" c1eh>1lass="sre2">BIO2EC_3=BIO1VEC_ 1>>>>>>>> }/blk-inte2rity.c#L72t/spav3.bi_unsupp uk-integ2rity.22LE" cstatic g" uk-int"s5 47_>de=ivprv" clas5 4ode=q" class="sref">q, 2fL28">5 223.bio, blk_rq_count_integrity_sg(struct7;u\n="bl2ck/blk-iam L57">5 57ef=gri" id L46de=blk_rq_count_in="block/b2lk-in226">bio, >, BIOV="line" nam LprL52kcodeRN_ERRcode=ivprv" claKERN_ERRlk-i>egrit240="+code=new_re43" id L43"b1tegr- blk-integrta">5 47 unsta">5 47tegr"block/blk-integri2c#L43"2L43"b2teg2- (C) ock/blk-integrtupl2>5 472/a> uns/blk214" class="line" nam L55">5 555 52.>, BIOV="line" nam LprL520ERN_ERRcode=ivp53214" class="line" nam L55">5 55bi_unsuppreadd_nam <2/a> =2q, 2fL28">5 223.5 57>>>>>>>>>>>>>44int5>2grity.c#L37" id L37" cl2ass="23>>>>>>> 5 27 uint55 55<="line"172am L49">5 49 172 u172>>>>>> >>>>ed sim unsttrtoul(C) ock/blk-intsim unsttrtoul22>>, , 5 55b2o_for2each_int17grit172>>>>>> }/blk-inte2rity.c#L72t/spav3.iv,12>>>>ed INTEGRITY_FLAG_READk-integr regritINTEGRITY_FLAG_READhowg3214" class="line" nam L55">5 55<=e=seg_si2ck/blk-iam L57">5 575 55< L43"gd22egr- (C) ock/blk-integrd2yka h2ef="block/blk-indtyka t5egrit240="+code=new_re43" id L43"b1tegr- flablk-integr regritflablef="b" class=08ef=20>>>>>ed INTEGRITY_FLAG_READk-integr regritINTEGRITY_FLAG_READhowg3214" class="line" nam L55">5 55<=blockattr L43"b2tegr- (C) ock/bl2-inte27"ef=grity.c#L3merge_ity5 43g 46 >172ss="sref">BIOVEC_3=BIO172C_ 1727ref">">5 51(>>>>>> 5 55 rity.c#L72t/spav3.seg28nt /a> 18s2"line"18nam L49">5 49<2a> 28>>>>>>static con2st ch23ntegr/blk-integrity.c#L7"t/spav3.bi_unsuppreadd_integ2rity.22LE" cstatic g" readd_int"s5 47_>de=ivprv" clas5 4ode=q" class="sref">q, 2fL28">5 223.bio, 5r2f=grity.c#L39d1p="cc#L432 id 284ef">">5 51(>, BIOV="line" nam LprL52kcodedN_ERRcode=ivprv" 8>>>>ed INTEGRITY_FLAG_READk-integr regritINTEGRITY_FLAG_READhowg clas053214" class="line" nam L55">5 55 re=seg_si2="block/blk-iny.c#L44" i2 L4428C_PHYS_16ERGE165>>>>>> }/blk-inte2.bi_unsuppwnsued_nam <2/a> =2q, 2fL28">5 223.44int5>2grity.c#L37" id L37" cl2ass="23>>>>>>> 5 55seg2size = 0;.unsigned long id L43"f="rLE"val(C) ock/blk-intval=2-f="+08ef=20>>>>>ed sim unsttrtoul(C) ock/blk-intsim unsttrtoul22>>, , 5 55ivg 46 -integrma2agrity.c#L367"ef="+code=2vprv"29bio_for_each_int1egrit1_vec(val(C) ock/blk-intval=2-f5tSSEG_B32tiii ock/blk-integr5 47_&iv,192a href="+code=bio" cla192="s1929 unsigctor>5 47">bik-integrit>egrit240="+code=new_re43" id L43"b1tegr- flablk-integr regritflablef="b|"+08ef=20>>>>>ed INTEGRITY_FLAG_WRITEk-integr regritINTEGRITY_FLAG_WRITEhowg3214" class="line" nam L55">5 55.5 55 19i2 (!>>>>ed INTEGRITY_FLAG_WRITEk-integr regritINTEGRITY_FLAG_WRITEhowg3214" class="line" nam L55">5 555ref2grity.c#L3merge_r 562(>>>>>> 5 55 3in.>>>> b>static con2st ch23ntegr/blk-integrity.c#L7"t/spav3.bi_unsuppwnsued_integ2rity.22LE" cstatic g" wnsued_int"s5 47_>de=ivprv" clas5 4ode=q" class="sref">q, 2fL28">5 223.bio, * 2 a203publi3hed by 2e"v276p2opavcou tegr if (!5 30#includ2e &qu23vec(>, BIOV="line" nam LprL52kcodedN_ERRcode=ivprv" 8>>>>ed INTEGRITY_FLAG_WRITEk-integr regritINTEGRITY_FLAG_WRITEhowg clas053214" class="line" nam L55">5 553q_count_i3tegrity- (C) ock/blk-int3grii_30pagegtde=ivprv" clapagetegr 46 3rity.c#L73t/spav3.5 223blk-i30 *ivity.c#L463 id 3034staticlakobj44">g 46 struct5g 46 stru4">g 46 structspav3.kef="+co2 L28v3.g 46spav3.kef="+=2-f="+ 2e"v276p2opavcou tegr if (!blk_rq_cou10="+code=new_se>iva_ref="+code=bio" class=="+ u10="+code=new_se(C) ock/blk-integr href="blf= i">BIOV="line" nam LprL52spav3.ERRcode=ivprv" 10="+code=new_segw_sock/blk-integr gw_s=2-f="+08ef=20>>>>>ed S_IRUGOock/blk-integr S_IRUGO=2-f=},1LE" class="srav clasgned int5ivity.c#L463 id 308">blk_rq_cou10="+code=new_se32">5 32s2tatic23f">bio="+08ef=20>>>>>ed >bi_unsuppspav3.k-integ2rity.22LE" cstatic g" spav3.k-int"s5 ,1LE" class="srav clasgned int5>>>g 46 3 L57">5 53>>>> staticlakobj44">g 46 struct5g 46 stru4">g 46 struct ukef="+co2 L28v3.g 46 ukef="+=2-f="+ 2e"v276p2opavcou tegr if (! * 2 a2 3published by the Free 2o3ef=21312">blk_rq_cou10="+code=new_se>iva_ref="+code=bio" class=="+ u10="+code=new_se(C) ock/blk-integr href="blf= i">BIOV="line" nam LprL52 uERRcode=ivprv" 10="+code=new_segw_sock/blk-integr gw_s=2-f="+08ef=20>>>>>ed S_IRUGOock/blk-integr S_IRUGO=2-f=},1LE" class="srav clasgned int55 32s2tatic23f">bio="+08ef=20>>>>>ed >bi_unsupp uk-integ2rity.22LE" cstatic g" uk-int"s5 ,1LE" class="srav clasgned int5>>>g 46 3 ity.c#L73t/spav3. *staticlakobj44">g 46 struct5g 46 stru4">g 46 structreaddef="+co2 L28v3.g 46readdef="+=2-f="+ 2e"v276p2opavcou tegr if (!7e=ivprv3=seg_size" c2"comment"2>3* Gen31f">blk_rq_cou10="+code=new_se>iva_ref="+code=bio" class=="+ u10="+code=new_se(C) ock/blk-integr href="blf= i">BIOV="line" nam LprL52readdverifyERRcode=ivprv" 10="+code=new_segw_sock/blk-integr gw_s=2-f="+08ef=20>>>>>ed S_IRUGOock/blk-integr S_IRUGO=2-f=|+08ef=20>>>>>ed S_IWUSC_PHYS_17ERGE17LS_IWUSC=2-f=},1LE" class="srav clasgned int5blk_rq_cou10="+code=new_se32">5 32s2tatic23f">bio="+08ef=20>>>>>ed >bi_unsuppreadd_integ2rity.22LE" cstatic g" readd_int"s5 ,1LE" class="srav clasgned int5blk_rq_cou10="+code=new_se3grity.c#L11" id 2111" 222>>="+08ef=20>>>>>ed >bi_unsuppreadd_nam <2/a> =2>>>g 46 3 3 class="c3mmen"clagrity.c#Lc#L43" 3d L43224staticlakobj44">g 46 struct5g 46 stru4">g 46 structwnsuedef="+co2 L28v3.g 46wnsuedef="+=2-f="+ 2e"v276p2opavcou tegr if (!BIOV="line" nam LprL52wnsuedgeneratuERRcode=ivprv" 10="+code=new_segw_sock/blk-integr gw_s=2-f="+08ef=20>>>>>ed S_IRUGOock/blk-integr S_IRUGO=2-f=|+08ef=20>>>>>ed S_IWUSC_PHYS_17ERGE17LS_IWUSC=2-f=},1LE" class="srav clasgned int5blk_rq_cou10="+code=new_se32">5 32s2tatic23f">bio="+08ef=20>>>>>ed >bi_unsuppwnsued_integ2rity.22LE" cstatic g" wnsued_int"s5 ,1LE" class="srav clasgned int5blk_rq_cou10="+code=new_se3grity.c#L11" id 2111" 222>>="+08ef=20>>>>>ed >bi_unsuppwnsued_nam <2/a> =2>>>g 46 3<7e=ivprv3" tyyyyyyyyyphar *g" cla3s="sr32k-int1LE" class="srav clasgned int5staticlakobj44">g 46 c">5 51, g 46spav3.kef="+=2-f10="+code=new_se>iva_ref="+code=bio" class=,1LE" class="srav clasgned int5, g 46 ukef="+=2-f10="+code=new_se>iva_ref="+code=bio" class=,1LE" class="srav clasgned int5, g 46readdef="+=2-f10="+code=new_se>iva_ref="+code=bio" class=,1LE" class="srav clasgned int5, g 46wnsuedef="+=2-f10="+code=new_se>iva_ref="+code=bio" class=,1LE" class="srav clasgned int5>>>g 46 3 struct3 *3 34static44lakobj44">g 46 oplk-integr regrit opl stru4">g 46 structoplk-integr regrit structopl=2-f="+ 2e"v276p2opavcou tegr if (!blk_rq_cou10="+code=new_se32">5 32s2tatic23f">bio= ="+"+cod/a>, iva con>blk_rq_cou10="+code=new_se3grity.c#L11" id 2111" 222>>=="+"+cod/a>, >>>i ock/blk3integ33tegrie=ivprv" clas 47_&>>>>g 46 3f="+code=3IOVEC_SEG_BO2cef="bloc2t3erlis34>>>>> statici 201ef=2-1>>>>inte__ini-integrity.c#L7"__ini- stru4">g 46 fL28devegrEXPORT_Sini-integrity.c#L7"fL28devegrEXPORT_Sini-22>>bio, >>>>ed kmemScache_creaf=2y.c#L35" id LkmemScache_creaf=22>>BIOV="line" nam LprL52 tdevegrEXPORT_ERRcode=ivprv"2e"v276p2opavcou tegr if (!q, 2fL28">5 223.- (C) ock/blk-integrg3ity.c34ref="block/blk-in hreeeeeeeeeeeeeeeeeeeeeeeeeeeeee03ity.c#L7"t/spav3SLAB_PANIC_PHYS_17ERGE17LSLAB_PANIChowg" i 2L11" 21vec<" id L46de=blk_rq_count_in53214" class="line" nam L55">5 553 L43"gd23egr- (C) ock/blk-integrg3ity.c34"attr.5 553 tde=ivpr3t/spav3. 3 blockatt343"b1tegri amp; amp; ">n3w_seg34"ef=g0="+code=new_se3ub>, >53214" class="line" nam L55">5 553 9e=ivprv3;.staticvoide=ivprv" clas5 4ode=q" class=6releas=2y.c#L35" id Lode=q" class=6releas="s5 47_>de=ivprv" clas5 47_&>>>>>ode=bio" class=grity.c#L3attr_sto"cc#L43" id L43"grity.c#L3attr_sto"="block/b2lk-in226">bio, 1c#L33" id L43"b1tegri|| ">n3w_seg35ef">blk_rq_count_integrity_sg(struc3t43" clag3am L49">5 49 1 3 u1535gtde=ivprv" clakobj44">g 46 ode=q" class="sref">q, 2fL28">5 223.5 29.>>>>> 5gtde=ivprv" clakobj44">5 44int53 47 3h L43"gd13ck/blk-iam L57">5 57>>>>ed kmemScache_fre=2y.c#L35" id LkmemScache_fre= L29">5 29.egrit240="+code=new_reg 46 _typ=2y.c#L35" id Lk/a>_typ= stru4">g 46 structktyp=2y.c#L35" id L structktyp==2-f="+ 2e"v276p2opavcou tegr if (!>1lass="sre3">BIO359">blk_rq_cou10="+code=new_sedefaultc35" lk-integr regritdefaultc35" l22>>=="+e23f="+code=newtatic g" c35" lk-integr regrittatic g" c35" l=2"l"2e"v276p2opavcou tegr if (!blk_rq_cou10="+code=new_se oplk-integr regrit opl struuuuuu"+"+cod/a>, 1c#L3 (C) ock/blk-integrtuple35 47<361">blk_rq_cou10="+code=new_sereleas=2y.c#L35" id Lreleas="s5 k_rq_couass="sref">ef=grity.c#L3r 56eleas=2y.c#L35" id Lode=q" class=6releas="s5 "2e"v276p2opavcou tegr if (!5 57>>>g 46 34ref="+co3egr- (C) ock/blk-integrd3yka h36ach_int17grit172>>>>>> }/blk-inte3L43"b2teg3- (C) ock/blk-integrtupl3>5 473/a> s="sref">ef=gritool(C) ock/blk-inttool stru4">g 46 fL28grEXPORT_SiaSini-ial ud2y.c#L35" id Lode=q" class=6iaSini-ial ud"s5 47_>de=ivprv" clas5 4gendisk2y.c#L35" id Lgendiska href="block/blk-intdisk2y.c#L35" id Ldiska hr="block/b2lk-in226">bio, 5 52.g 46 ode=q" class="sref">q, 2fL28">5 223.g 46 ode=get=q" class="sref">q, 2fL28get=q" class= L29">5 29.>>>g 46 34tde=ivpr3t/spav3.egrit240="+code=new_re43" id L43"b1tegr- (C) ock/blk-integr href="blf"+code=srefg" class="sref"lakcm .e_unsupported_(C) ock/blk-integr >e_unsupported_(C) a hr=clas053214" class="line" nam L55">5 553re=seg_si3ck/blk-iam L57">5 57 3 L43"gd23egr- (C) ock/blk-integrd3yka h3ef="blclaKERN_ERRlk-io215" cl}/blk-integrity.c#L7"t/spav3.5 553id L43"b3tegr- (C) ock/blk-integr3a">5 37nt 3="line"173am L49">5 49 173 u173>>>>>>/">BIOV="linecoms="s">/**e=ivprvde=ivprv" clapagetegr 46 3=ref="+co3e" c17c" class17"sref">b3o_for3each_i/">BIOV="linecoms="s"> * ode=q" class=6register - Register a gendisk as being q" class=-capablee=ivprvde=ivprv" clapagetegr 46 3=43"b2teg3t/spav3.iv,13BIOV="linecoms="s"> * @disk: 3=" nam 163L43"b2tegr- (C) ock/blk-3ntegr3href="/">BIOV="linecoms="s"> * @template: 3=e=seg_si3ck/blk-iam L57">5 57BIOV="linecoms="s"> *e=ivprvde=ivprv" clapagetegr 46 3=tde=ivpr3egr- (C) ock/blk-integrd3yka h3ef="bl/">BIOV="linecoms="s"> * Description: When a device needs to advertise qtself as being ablee=ivprvde=ivprv" clapagetegr 46 3=blockatt3 L43"b2tegr- (C) ock/bl3-inte37"ef=g/">BIOV="linecoms="s"> * to send/receive q" class= metadata qt must use this function toe=ivprvde=ivprv" clapagetegr 46 3=e=seg_si3ss="sref">BIOVEC_3=BIO173C_ 1737ref">/">BIOV="linecoms="s"> * register the capabilss= with the clapa layer. The template is ae=ivprvde=ivprv" clapagetegr 46 3de=seg_si3e" c17f="block17blk-inte3rity.38a hre/">BIOV="linecoms="s"> * ode=q" class=flakobj4with values appropriate for the underlyinge=ivprvde=ivprv" clapagetegr 46 3dd L43"b3t/spav3.seg38ntBIOV="linecoms="s"> * hardware. If template is coun the new profile is allapated bute=ivprvde=ivprv" clapagetegr 46 3d"line"173"line"18nam L49">5 49<3a> 38>>>>>/">BIOV="linecoms="s"> * not filled out. See Docus="sation/clapagdatagr 46 txt.e=ivprvde=ivprv" clapagetegr 46 3dref="+co3=seg_size" c18c" class183sref"38ach_i/">BIOV="linecoms="s"> */e=ivprvde=ivprv" clapagetegr 46 3d43"b2teg3f=grity.c#L39d1p="cc#L433 id 384ef">i 201ef=2-1>>>>inteode=q" class=6register2y.c#L35" id Lode=q" class=6registere=5 47_>de=ivprv" clas5 4gendisk2y.c#L35" id Lgendiska href="block/blk-intdisk2y.c#L35" id Ldiska hrtiii ock/blk-integrcontaf="r_of>5 51 contaf="r_of="line" namef="block/blk-inttemplate/a> contaftemplatea hr="block/b2lk-in226">bio, g 46 ode=q" class="sref">q, 2fL28">5 223.5 553.5 29.ef=gri" id L46de=blk_rq_count_in=3214" class="line" nam L55">5 553.e=seg_si3grity.c#L3r 5 43<4" id 344" c38C_3=BIO1VEC_ 1>>>>>>>> }/blk-inte3="block183lk-integrity.c#L43"02=183ref1839elements(disk2y.c#L35" id Ldiska hr43" id L43"b1tegr- q" class="sref">q, 2">5 223.ef=gri" id L46de=blk_rq_count_in=+ 2e"v276p2opavcou tegr if (!seg39ref">">5 51 b unsntegrit2egrit240="+code=new_regt44">g 46 kmemScache_allap2y.c#L35" id LkmemScache_allap L29">5 29.">5 51 ">5 29."|+08ef=20>>>>>ed __GFP_ZEROock/blk-integr __GFP_ZEROt_in=3214" class="line" nam L55">5 553-integrma3agrity.c#L367"ef="+code=3vprv"39lamaxagrity.c#L367"efint1!claKERN_ERRlk-i>egrit240="+code=new_re<214" class="line" nam L55">5 553-43"b2teg3a href="+code=bio" cla193="s1939 unsigctor>5 4gtde=ivplud2e &-13214" class="line" nam L55">5 553-ref="+co3e=seg_size" c19ne" nam 13 L52"39 *, >>>>> , 5/blk-integriiiiii"+cod/a>, 5 29.>>>>> "">BIOV="line" nam LprL52kcode=ERRcode=ivprv" c">BIOV="line" nam LprL52grEXPORT_ERRcode=ivprv)=+ 2e"v276p2opavcou tegr if (!>08ef=20>>>>>ed kmemScache_fre=2y.c#L35" id LkmemScache_fre= L29">5 29.egrit240="+code=new_re5 4gtde=ivplud2e &-13214" class="line" nam L55">5 554ss=de=blk4rq_count_integrity_sg" c4ass="40ref">">5 51 tde=ivprv" clapagetegr 46 45 * 2 a204publi40attr.ivg 46 4 bio.>>>>> > L29"+cod/a>, >>>>> 4rity.c#L74t/spav3.5 224blk-i40ref="block/blk-in hret5egrit240="+code=new_re43" id L43"b1tegr- flablk-integr regritflablef="b|"+08ef=20>>>>>ed INTEGRITY_FLAG_READk-integr regritINTEGRITY_FLAG_READhowg"|+08ef=20>>>>>ed INTEGRITY_FLAG_WRITEk-integr regritINTEGRITY_FLAG_WRITEhowg3214" class="line" nam L55">5 554tde=ivprv4 claii_n="&">ivity.c#L464 id 40"attr.5 47 sty.or-intew_regt44">g 46 queue_logical_="lin-integrta">5 47 queue_logical_="lin-inte L29">5 29.5 47 queuew_req, 2">5 223.egrit240="+code=new_rea href="+co"clagrity.c#Lc#L43" id 4i8e=ivprv4 rity.c#L3merge_r 564 id 408">blk_rq_cou}r/blk214" class="line" nam L55">5 554t9e=ivprv4 =seg_size" c193.g 46 disk2y.c#L35" id Ldiska hr43" id L43"b1tegr- q" class="sref">q, 2">5 223.5 54>>>> ">5 51BIOV="linecoms="s">/* Use the provided profile as template */e=ivprvde=ivprv" clapagetegr 46 4> * 2 a2 4published by the Free 2o4ef=2141_code=ivprv" ti18 contaftemplatea hrflass="sref">ef=gri" id L46de=blk_rq_count_in=+ 2e"v276p2opavcou tegr if (!egrit240="+code=new_re43" id L43"b1tegr- (C) ock/blk-integr href="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- (C) ock/blk-integr href="bla href="+co"clagrity.c#Lc#L43" id 4 4io.5 47">bik-integrit>egrit240="+code=new_re43" id L43"b1tegr- generatu_fn2y.c#L35" id Lgeneratu_fn="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- generatu_fn2y.c#L35" id Lgeneratu_fn="bla href="+co"clagrity.c#Lc#L43" id 4 ity.c#L74t/spav3.egrit240="+code=new_re43" id L43"b1tegr- verify_fn2y.c#L35" id Lverify_fn="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- verify_fn2y.c#L35" id Lverify_fn="bla href="+co"clagrity.c#Lc#L43" id 4 de=ivprv4e the 2GNU5 47 u unstnte="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- tu unstntegrta">5 47 u unstnte="bla href="+co"clagrity.c#Lc#L43" id 4 7e=ivprv4=seg_size" c2"comment"2>4* Gen41f="block/blk-indtyka t5egrit240="+code=new_re43" id L43"b1tegr- set6 fn2y.c#L35" id Lset6 fn="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- set6 fn2y.c#L35" id Lset6 fn="bla href="+co"clagrity.c#Lc#L43" id 4 8e=ivprv4ity.c#L3merge_ity.c#L51"4id L41"pagegtde=ivprv" clap7">bik-integrit>egrit240="+code=new_re43" id L43"b1tegr- get6 fn2y.c#L35" id Lget6 fn="blfass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- get6 fn2y.c#L35" id Lget6 fn="bla href="+co"clagrity.c#Lc#L43" id 4 9e=ivprv455 47 unstafass="sref">ef=gritemplate/a> contaftemplatea hr43" id L43"b1tegr- tlk-integrta">5 47 unstaa href="+co"clagrity.c#Lc#L43" id 4" class=g4ity.c#L36ysfs_f="rLc#L434 id 420 unsig}r/blk214" class="line" nam L55">5 554">5 51 b unsntegrit2egrit240="+code=new_re43" id L43"b1tegr- (C) ock/blk-integr href="blfass="sref">ef=gri>e_unsupported_(C) ock/blk-integr >e_unsupported_(C) a hra href="+co"clagrity.c#Lc#L43" id 4" * 2 a2 4mmen"clagrity.c#Lc#L43" 4d L442attr.ivg 46 4Lrity_s, 4on>5 30#includ2e &13214" class="line" nam L55">5 554 struct54a href="+co22. 4 ity.c#L745bls="sref">ef=grio215" cl}/blk-integrity.c#L7"t/spav3. 2=S4ockattribut3lk-insg" cla4s="sr42C_PHYS_16ERGE165>>>>>> }/blk-inte4<7e=ivprv4" tyyyyyyyyyphar *g" cla4s="sr42f="bl/">BIOV="linecoms="s">/**e=ivprvde=ivprv" clapagetegr 46 4f="+code=4IOVEC_SEG_BO2.BIOV="linecoms="s"> * ode=q" class=6unregister - Remove clapa q" class= profilee=ivprvde=ivprv" clapagetegr 46 4f9e=ivprv43" clagrity.c#Lrity_sg" 4lass=42ref">/">BIOV="linecoms="s"> * @disk: 4id L43" 4lagrity.c#Lrity5 g" clas4="sre43a hre/">BIOV="linecoms="s"> *e=ivprvde=ivprv" clapagetegr 46 4ia href="4sfs_f="rLE" clsg" class=4sref"43ntBIOV="linecoms="s"> * Description: This function fre=s all memory used by the clapae=ivprvde=ivprv" clapagetegr 46 4i * 2 a2 46ysfs_f="rLE" c5 g" clas4="sre43>>>>>/">BIOV="linecoms="s"> * q" class= profile. To be called at device teardown.e=ivprvde=ivprv" clapagetegr 46 4irity_s, 45BIOV="linecoms="s"> */e=ivprvde=ivprv" clapagetegr 46 4i struct54/a> b u5 g" clas4="sre43rv" cvoide=ivprv" clas5 4ode=q" class=6unregister2y.c#L35" id Lode=q" class=6unregisterr2ef=7_>de=ivprv" clas5 4gendisk2y.c#L35" id Lgendiska href="block/blk-intdisk2y.c#L35" id Ldiska hr="block/b2lk-in226">bio, >.24L34">43"attr.g 46 ode=q" class="sref">q, 2fL28">5 223.5 554gtde=ivpr4" clakobjec&rity_sg" cla4s="sr43k-int1LE" class="srav clasgned int5iva con>blk_rq_couint1!claKERN_ERRlk-idisk2y.c#L35" id Ldiska hr || !claKERN_ERRlk-idisk2y.c#L35" id Ldiska hr43" id L43"b1tegr- q" class="sref">q, 2">5 223.bio, >>>i ock/blk4integ43_code=ivprv" cla__funlud2e 3214" class="line" nam L55">5 554f="+code=4IOVEC_SEG_BO2cef="bloc2t4erlis44>>>>> ">5 51g 46 disk2y.c#L35" id Ldiska hr43" id L43"b1tegr- q" class="sref">q, 2">5 223.ivg 46 4ykc#L43" 4d L43"gendtykppty_sg" c4ass="44rity.c#L11" id 2L11" 21vec<=grity.Sueve>>>>>> > L29"+cod/a>, >>>>> , >>>>> - (C) ock/blk-integrg4ity.c44ref="block/bld 2L11" 21vec<=grity.Spu>>>>> L29"+cod/a>, >>>>> q, 2">5 223. 4 blockatt443"b1tegri amp; amp; ">n4w_seg44"ef=g0="+code=new_seo215" cl}/blk-integrity.c#L7"t/spav3.;.LXR comsunie" nam this experis="sal version by href="+comailto:lxr@ef=ux.no">lxr@ef=ux.no nam.