0].url = '?' + ajc/css/lxr 0].url = '?' + ajc/top"../].u> s/lxr 0spplil = '?'m p_ead> css 0spplil = '?'m p_logo"..a" title="" <body class="full" u --ss/lxr 0sppliid="m p_priif s/lxr "t"> 0meth a_frag="+priif= 0/methss/lxr 0/spplss/lxr 0sppliid="m p_save s/lxr "t"> 0meth a_frag="+save= 0/methss/lxr 0/spplss/lxr 0/spplss s/lxr 0].url = '?'m p_; iucss 0spplil = '?'m p_versragcss 0a"s s)" title="script" sr5.7 0meth a_frag=" s s) /spagss s) /formss s) a s s) href="../linux+v3.6.1/fs/jffs2/compr_rtime.c">s s) img src="../.static/gfx/right.png" alt=">>">s /spagsss spag class="lxr_search">s
s s) input typdi"hidden" namdi"navtarget" ) { di"">s s) input typdi"text" namdi"search" idi"search">s s) buttagmtypdi"submit">Searchs s)Prefss s) /a>s /spagss s) ) /divss s) ) form acfrag="ajax+*" method="post" onsubmit="return false;">s input typdi"hidden" namdi"ajax_lookup" idi"ajax_lookup" ) { di"">s s) ) /formsss s) ) div class="headingbottam">s div idi"file_contents"s
) )1 /a> spag class="comment">/* /spagss) )2 /a> spag class="comment"> * JFFS2 -- Journalling Flash File System, Versragm2. /spagss) )3 /a> spag class="comment"> * /spagss) )4 /a> spag class="comment"> * Copyright © 2001-2007 Red Hat, Inc. /spagss) )5 /a> spag class="comment"> * Copyright © 2004-2010 David Woodhouse <dwmw2@infradead.org> /spagss) )6 /a> spag class="comment"> * /spagss) )7 /a> spag class="comment"> * Created by Arjagm) n de Ven <arjagv@redhat.com> /spagss) )8 /a> spag class="comment"> * /spagss) )9 /a> spag class="comment"> * For licensing informafrag, see the file 'LICENCE' in this directory. /spagss) 10 spag class="comment"> * /spagss) 11 /a> spag class="comment"> * /spagss) 12 /a> spag class="comment"> * /spagss) 13 /a> spag class="comment"> * Very simple lz77-ish encoder. /spagss) 14 /a> spag class="comment"> * /spagss) 15 /a> spag class="comment"> * Theory of operafrag: Both encoder and decoder have a list of "last /spagss) 16 /a> spag class="comment"> * occurrences" for every possible source-) { d; after sending the /spagss) 17 /a> spag class="comment"> * first source-byte, the second byte indicated the "run" length of /spagss) 18 /a> spag class="comment"> * mafches /spagss) 19 /a> spag class="comment"> * /spagss) 20 spag class="comment"> * The algorithm is intended to only send "whole bytes", no bit-messing. /spagss) 21 /a> spag class="comment"> * /spagss) 22 /a> spag class="comment"> */ /spagss) 23 /a>s) 24 /a>#include <linux/kernel.h /a>>s) 25 /a>#include <linux/typds.h /a>>s) 26 /a>#include <linux/errno.h /a>>s) 27 /a>#include <linux/string.h /a>>s) 28 /a>#include <linux/jffs2.h /a>>s) 29 /a>#include "compr.h /a>"s) 30 /a>s) 31 /a> spag class="comment">/* _compress returns the compressed size, -1 if bigger */ /spagss) 32 /a>static int) a href="+code=jffs2_rtime_compress" class="sref">jffs2_rtime_compress /a>(unsigned char * a href="+code=data_in" class="sref">data_in /a>,s) 33 /a>                                unsigned char * a href="+code=cpage_out" class="sref">cpage_out /a>,s) 34 /a>                                 a href="+code=uint32_t" class="sref">uint32_t /a> * a href="+code=sourcelen" class="sref">sourcelen /a>,  a href="+code=uint32_t" class="sref">uint32_t /a> * a href="+code=dstlen" class="sref">dstlen /a>)s) 35 /a>{s) 36 /a>        short) a href="+code=posifrags" class="sref">posifrags /a>[256];s) 37 /a>        int) a href="+code=outpos" class="sref">outpos /a> = 0;s) 38 /a>        int) a href="+code=pos" class="sref">pos /a>=0;s) 39 /a>s) 40 /a>         a href="+code=memset" class="sref">memset /a>( a href="+code=posifrags" class="sref">posifrags /a>,0,sizeof( a href="+code=posifrags" class="sref">posifrags /a>));s) 41 /a>s) 42 /a>        while ( a href="+code=pos" class="sref">pos /a> < (* a href="+code=sourcelen" class="sref">sourcelen /a>) &&) a href="+code=outpos" class="sref">outpos /a> <= (* a href="+code=dstlen" class="sref">dstlen /a>)-2) {s) 43 /a>                int) a href="+code=backpos" class="sref">backpos /a>,  a href="+code=runlen" class="sref">runlen /a>=0;s) 44 /a>                unsigned char  a href="+code=) { d" class="sref">) { d /a>;s) 45 /a>s) 46 /a>                 a href="+code=) { d" class="sref">) { d /a> =  a href="+code=data_in" class="sref">data_in /a>[ a href="+code=pos" class="sref">pos /a>];s) 47 /a>s) 48 /a>                 a href="+code=cpage_out" class="sref">cpage_out /a>[ a href="+code=outpos" class="sref">outpos /a>++] =  a href="+code=data_in" class="sref">data_in /a>[ a href="+code=pos" class="sref">pos /a>++];s) 49 /a>s) 50 /a>                 a href="+code=backpos" class="sref">backpos /a> =  a href="+code=posifrags" class="sref">posifrags /a>[ a href="+code=) { d" class="sref">) { d /a>];s) 51 /a>                 a href="+code=posifrags" class="sref">posifrags /a>[ a href="+code=) { d" class="sref">) { d /a>]= a href="+code=pos" class="sref">pos /a>;s) 52 /a>s) 53 /a>                while (( a href="+code=backpos" class="sref">backpos /a> <  a href="+code=pos" class="sref">pos /a>) &&)( a href="+code=pos" class="sref">pos /a> < (* a href="+code=sourcelen" class="sref">sourcelen /a>)) &&s) 54 /a>                       ( a href="+code=data_in" class="sref">data_in /a>[ a href="+code=pos" class="sref">pos /a>]== a href="+code=data_in" class="sref">data_in /a>[ a href="+code=backpos" class="sref">backpos /a>++]) &&)( a href="+code=runlen" class="sref">runlen /a><255)) {s) 55 /a>                         a href="+code=pos" class="sref">pos /a>++;s) 56 /a>                         a href="+code=runlen" class="sref">runlen /a>++;s) 57 /a>                }s) 58 /a>                 a href="+code=cpage_out" class="sref">cpage_out /a>[ a href="+code=outpos" class="sref">outpos /a>++] =  a href="+code=runlen" class="sref">runlen /a>;s) 59 /a>        }s) 60 /a>s) 61 /a>        if)( a href="+code=outpos" class="sref">outpos /a> >=  a href="+code=pos" class="sref">pos /a>) {s) 62 /a>                 spag class="comment">/* We failed */ /spagss) 63 /a>                return -1;s) 64 /a>        }s) 65 /a>s) 66 /a>         spag class="comment">/* Tell the caller how much we managed to compress, and how much space it took */ /spagss) 67 /a>        * a href="+code=sourcelen" class="sref">sourcelen /a> =  a href="+code=pos" class="sref">pos /a>;s) 68 /a>        * a href="+code=dstlen" class="sref">dstlen /a> =  a href="+code=outpos" class="sref">outpos /a>;s) 69 /a>        return 0;s) 70 /a>}s) 71 /a>s) 72 /a>s) 73 /a>static int) a href="+code=jffs2_rtime_decompress" class="sref">jffs2_rtime_decompress /a>(unsigned char * a href="+code=data_in" class="sref">data_in /a>,s) 74 /a>                                  unsigned char * a href="+code=cpage_out" class="sref">cpage_out /a>,s) 75 /a>                                   a href="+code=uint32_t" class="sref">uint32_t /a>  a href="+code=srclen" class="sref">srclen /a>,  a href="+code=uint32_t" class="sref">uint32_t /a>  a href="+code=destlen" class="sref">destlen /a>)s) 76 /a>{s) 77 /a>        short) a href="+code=posifrags" class="sref">posifrags /a>[256];s) 78 /a>        int) a href="+code=outpos" class="sref">outpos /a> = 0;s) 79 /a>        int) a href="+code=pos" class="sref">pos /a>=0;s) 80 /a>s) 81 /a>         a href="+code=memset" class="sref">memset /a>( a href="+code=posifrags" class="sref">posifrags /a>,0,sizeof( a href="+code=posifrags" class="sref">posifrags /a>));s) 82 /a>sst83 /a>        hai"L8/a>st83 /a> fragss/lss) opf1e128 /a>#include &os /a> >=  a href="+code=pos" cla8"sref">d8ta_in /a>,s) 44 /a>                unsigned char  a href="+code=) { d" cla8ref">cpa8e_out /a>,sd8stlen /a>)s) 76 /a>{s) 46 /a>                 a href="+code=) { d" class="sref">) { d /a> =  a href="+code=data_in" class="sref">data_in /a>[ a href="+code=pos" clas8ef">outp8s /a> = 0;s) 58 /a>                 a href="+code=cpage_out" class="sref">cpage_out /a>[ a href="+cod>) 44 /a>                unsig#L66" idi"L66" class="liness="lidi"Lverbimemss=pie> spag ch we managed to compress, and how much spa9s="sref"9pos /a>=0;s) { d /a> =  a href="+code=data_in" class="sref">data_in /a>[ a href="+code=pos" clas9namdi"L89">) 80 /a>sbackpos /a> =  a href="+code=posifrags" class="sref">posifrags /a>[ a href="+code=) { d" clas9f">posif9ags /a>));s) 82 /a>s) 51 /a>                 a href="+code=posifrags" class="sref">posifrags /a>[ a hrefcode=dstlen" class="sref">dstlen /a> =  a href="+code=outpos" clas9"sref">d9ta_in /a>,s >=  a href="+code=pos" cla9ref">cpa9e_out /a>,sdstle&os /a> >=  a href="+code=pos" cla9"sref">d9stlen /a>)s >=  a href="+code=pos" cla9amdi"L769>) 76 /a>{s) 58 /a>                 a href="+code=cpage_out" class="sref">cpage_out /a>[ a href="+codne" namdi"L58">) 58 /a>                 a href="+codenamdoef=ta_in" class="sref"oef=unsi">data_in /a>[ a href="+code=pos" clas9edhat.co9m> /spagss[ a href="+code=pos" clas9="commentt"> * /spagss >=  a href="+code=pos" cla10"comment"0> * /spagss)cpyline" namdi"L81">)cpy /a> ref=""L58" class="line" namdi"L58">) 58 /a>                 a href="+code=cpage_out" class="sref">cpage_],ref=""L58" class="line" namdi"L58">) 58 /a>                 a href="+codenamdoef=ta_in" class="sref"oef=unsi], idi"L61" classrepea"line" namdi"L81repea"unsi&ata_in /a>[ a href="+code=pos" clas10"comment"0> * /spagsscpage_orags /a>[ a hrefrepea"line" namdi"L81repea"unsigned char  a href="+code=) { d" cla10"comment"0> * /spagss * /spagss) 69 10 sending 0the /spagss * mafc0hes /spagss >=  a href="+code=pos" cla1is directoory. /spagss> * /spagss * /spagss) 58 /a>  e_ouunsi       a href="+coass="_COMPR_RTIMEline" namdi"L81ass="_COMPR_RTIMEchar * a href="+code=cpage_out" class="1="comment""> * /spagss) 32 /a>static int) a href="+code=jffs2 * a href="+code=cpage_out" class="1=ish encodder. /spagss) 73 /a>static incode=jffs2_rti   ref=""L58" class="lis="line" namdi"L73">) 73 /a>static int) a href="+code=jffs2_rti * a href="+code=cpage_out" class="1="comment""> * /spagss * mafcches /spagss) 11 /a> spag class="s directo"> * /spagss) 69 1 bit-mess1ing. /spagss> * /spagss voidt /a>  a href="+code=destlen" class1"comment"1> */ /spagss) 23 /a>sstatic int) a href="+"+counsi&ata_in /a>[ a href="+code=pos" clas1nux/kerne1l.h /a>>s>s>s voidt /a>  a href="+code=destlen" class1"t; lengthg.h /a>>s * mafc2.h /a>>sstatic int) a href="+"+counsi&ata_in /a>[ a href="+code=pos" clas1f">compr.1h /a>"s) 30 /a>ss 

 idi"search_r 30 /a>footer">
ss="e" ginal LXR softwar"> *idi"Lime.c#L70http://67 /a>forge.net/jfojects/lxr">LXR  claun nyunsi,censinexperiass=al v"commen *iime.c#L70mailto:lxr@lude .no">lxr@lude .nounsi.
 idi"serch_r 30 /a>subfooter">
lxr.lude .no kindly hos"line" ime.c#L70http://www.redpill-ludjfo.no">Redpill Ludjfo ASunsi,cjfovicommof Ludux  cnivssnces">/*namdi"L15s services since 1995.
 idi"sear/bodyser/htmls