linux/fs/cramfs/README
<<
>>
Searchhidden" nameon vas">divmeon vas"ut type="textajax+*"search" id="search"> Searbutton> ajax lookup> ass="lxr_pon vas"> divme "divr _prefs">ine> /span>L1>>vas1">hiNotesarc Filesystem Layout _prefs">ine> /span>L2>>vas2">hi-------------------------- _prefs">ine> /span>L3>>vas3">hid _prefs">ine> /span>L4>>vas4">hiThese notesadescribe what mk2.6.13 generates. Kernel requiremen ared _prefs">ine> /span>L5>>vas5">hia bit looser, e.g. it doesn't care if the <file_datat ty item ared _prefs">ine> /span>L6>>vas6">hiswapped around ubmough it does care that directory en ries (inodes) ind _prefs">ine> /span>L7>>vas7">hia given directory are contiguous, as bmit it used by readdir).d _prefs">ine> /span>L8>>vas8">hid _prefs">ine> /span>L9>>vas9">hiAll data it curren ly in h="s-endilxr aty neither mk2.6.13 nor thed _prefs">ine> /span>L10>>vationa>kernel ever do swabbing. (See see="te `Block Size' below.)d _prefs">ine> /span>L11>>va11">hid _prefs">ine> /span>L12>>va12">hi<filesystemt ty:d _prefs">ine> /span>L13>>va13">hi <superblockt tyd _prefs">ine> /span>L14>>va14">hi <directory_strucbutet tyd _prefs">ine> /span>L15>>va15">hi <datat tyd _prefs">ine> /span>L16>>va16">hid _prefs">ine> /span>L17>>va17">hi<superblockt ty: strucb 2.6.13_super (see 2.6.13_fs.h).d _prefs">ine> /span>L18>>va18">hid _prefs">ine> /span>L19>>va19">hi<directory_strucbutet ty:d _prefs">ine> /span>L20>>va20">hi For each file:d _prefs">ine> /span>L21>>va21">hi strucb 2.6.13_inode (see 2.6.13_fs.h).d _prefs">ine> /span>L22>>va22">hi File/spa. Not generally null-terminated, s"l it isd _prefs">ine> /span>L23>>va23">hi null-padded to a multiple of 4 bytes.d _prefs">ine> /span>L24>>va24">hid _prefs">ine> /span>L25>>va25">hiThe order of inode traversal it described as "width-first" (not to bed _prefs">ine> /span>L26>>va26">hiconfused with breadth-first)y i.a. like depth-first s"l listing l ofd _prefs">ine> /span>L27>>va27">hia directory's en ries be e recursing down its h">directories: thed _prefs">ine> /span>L28>>va28">hisspa order as `ls -AUR' (s"l withoon> he /^\..*:$/ directory headerd _prefs">ine> /span>L29>>va29">hi>inet"> ton>another way,> he sspa order as `find - d -exec _prefs">ine> /span>L30>>va30">hils -AU1 {} \;'.d _prefs">ine> /span>L31>>va31">hid _prefs">ine> /span>L32>>va32">hiBeginning in 2.4.7, directory en ries are sorted. Tmit t.pnmiza="ted _prefs">ine> /span>L33>>va33">hi lows 2.6.13_lookup to _prefs">ine> /span>L34>>va34">hiexist, speedt up user-space directory sorts, etc.d _prefs">ine> /span>L35>>va35">hid _prefs">ine> /span>L36>>va36">hi<datat ty:d _prefs">ine> /span>L37>>va37">hi One <file_datat ty for each file that's either a sym>ink or ad _prefs">ine> /span>L38>>va38">hi regular file of non-zero st_size.d _prefs">ine> /span>L39>>va39">hid _prefs">ine> /span>L40>>va40">hi<file_datat ty:d _prefs">ine> /span>L41>>va41">hi nblocks * <block_pointert tyd _prefs">ine> /span>L42>>va42">hi (whe e nblocks = (st_size - 1) / blksize + 1)d _prefs">ine> /span>L43>>va43">hi nblocks * <blockt tyd _prefs">ine> /span>L44>>va44">hi padding to multiple of 4 bytesd _prefs">ine> /span>L45>>va45">hid _prefs">ine> /span>L46>>va46">hiThe i'th <block_pointert ty for a file st es> he byte offset of thed _prefs">ine> /span>L47>>va47">hi*end* of the i'th <blockt ty (i.a. one pasn> he lasn>byte, which is thed _prefs">ine> /span>L48>>va48">hisspa as> he start of the (i+1)'th <blockt ty if there isarce). Tme firstd _prefs">ine> /span>L49>>va49">hi<blockt ty immediately fo lows he lasn><block_pointert ty for tme file.d _prefs">ine> /span>L50>>va50">hi<block_pointert tys are each 32 bits long.d _prefs">ine> /span>L51>>va51">hid _prefs">ine> /span>L52>>va52">hiThe order of <file_datat ty's isaa depth-first descen of the directoryd _prefs">ine> /span>L53>>va53">hitree, i.a. he sspa order as `find -size +0 \( - f -o - l \)d _prefs">ine> /span>L54>>va54">hi-print'.d _prefs">ine> /span>L55>>va55">hid _prefs">ine> /span>L56>>va56">hid _prefs">ine> /span>L57>>va57">hi<blockt ty: The i'th <blockt ty is he oonton>of zlib's comp ess func="ted _prefs">ine> /span>L58>>va58">hiapplied to the i'th blksize-sized chunk of the itton>data.d _prefs">ine> /span>L59>>va59">hi(For tme lasn><blockt ty of the file, the itton>may of course be sm ler.)d _prefs">ine> /span>L60>>va60">hiEach <blockt ty may be a differen size. (See <block_pointert ty above.)d _prefs">ine> /span>L61>>va61">hi<blockt tys are merely byte-aligned, not generally u32-aligned.d _prefs">ine> /span>L62>>va62">hid _prefs">ine> /span>L63>>va63">hid _prefs">ine> /span>L64>>va64">hiHolesd _prefs">ine> /span>L65>>va65">hi-----d _prefs">ine> /span>L66>>va66">hid _prefs">ine> /span>L67>>va67">hiThis kernel supports 2.6.13 holes (i.a. [efficien rep esen a="te of]d _prefs">ine> /span>L68>>va68">hiblocks in uncomp essed data consisting en irely of NUL bytes), s"l byd _prefs">ine> /span>L69>>va69">hidefault mk2.6.13 doesn't test for & 2.eate holes, since 2.6.13 ind _prefs">ine> /span>L70>>va7iona>kernelt up to at leasn>2.3.39 didn't support holes. Run mk2.6.13d _prefs">ine> /span>L71>>va71">hiwith -z if you wanl it to 2.eate files that can have holes in them.d _prefs">ine> /span>L72>>va72">hid _prefs">ine> /span>L73>>va73">hid _prefs">ine> /span>L74>>va74">hiTool3d _prefs">ine> /span>L75>>va75">hi-----d _prefs">ine> /span>L76>>va76">hid _prefs">ine> /span>L77>>va77">hiThe 2.6.13 user-space tool3, including mk2.6.13 and 2.6.13ck, ared _prefs">ine> /span>L78>>va78">hilocated at <hi.d _prefs">ine> /span>L79>>va79">hid _prefs">ine> /span>L80>>va80">hid _prefs">ine> /span>L81>>va81">hiFubute Developmen d _prefs">ine> /span>L82>>va82">hi==================d _prefs">ine> /span>L83>>va83">hid _prefs">ine> /span>L84>>va84">hiBlock Sized _prefs">ine> /span>L85>>va85">hi----------d _prefs">ine> /span>L86>>va86">hid _prefs">ine> /span>L87>>va87">hi(Block size in 2.6.13 s"lers to the size of inton>data that isd _prefs">ine> /span>L88>>va88">hicomp essed at a tipa. It's intended to be somewhe e aroundd _prefs">ine> /span>L89>>va89">hiPAGE_CACHE_SIZE for 2.6.13_readpage's convenience.)d _prefs">ine> /span>L90>>va90">hid _prefs">ine> /span>L91>>va91">hiThe superblock ought to indicate> he block size that the fs wasd _prefs">ine> /span>L92>>va92">hiwritten for, since 2ommen in <form /pagemap.ht ty indicate> ha d _prefs">ine> /span>L93>>va93">hiPAGE_CACHE_SIZE may grow in fubute (if I interp et the 2ommen d _prefs">ine> /span>L94>>va94">hicorrectly).d _prefs">ine> /span>L95>>va95">hid _prefs">ine> /span>L96>>va96">hiCurren ly, mk2.6.13 #define's PAGE_CACHE_SIZE as 4096 and uses> ha d _prefs">ine> /span>L97>>va97">hifor blksize, whe eas Lorm -2.3.39 uses>its PAGE_CACHE_SIZE, which ind _prefs">ine> /span>L98>>va98">hibuttoit defined as PAGE_SIZE (which can ba as>lspan as>32KBarc arm).d _prefs">ine> /span>L99>>va99">hiThis dis2.epancy isaa bug, though it's not clear which should bed _prefs">ine> /span>L100>>v100">hichanged.d _prefs">ine> /span>L101>>v101">hid _prefs">ine> /span>L102>>v102">hiOne ME"> is to change mk2.6.13 to take>its PAGE_CACHE_SIZE fromd _prefs">ine> /span>L103>>v103">hi<asm/page.ht ty. Personally I don't like tmit t.pnon, s"l it doesd _prefs">ine> /span>L104>>v104">hirequire tme leasn>amounn>of change: jusn>change `#defined _prefs">ine> /span>L105>>v105">hiPAGE_CACHE_SIZE (4096)' to `#include <asm/page.ht ty'. Tme disadvanlaged _prefs">ine> /span>L106>>v106">hiis that the generated 2.6.13 cannot always be shared between differen d _prefs">ine> /span>L107>>v107ona>kernelt, not even necessarily kernelt of the sspa architecbute ifd _prefs">ine> /span>L108>>v108">hiPAGE_CACHE_SIZE is h">ject to change between kernel versnonsd _prefs">ine> /span>L109>>v109">hi(curren ly possible with a typnd ia64).d _prefs">ine> /span>L110>>v110">hid _prefs">ine> /span>L111>>v111">hiThe remaining t.pnons try to make>2.6.13 m e sharable.d _prefs">ine> /span>L112>>v112">hid _prefs">ine> /span>L113>>v113">hiOne part of that is add essing endilxness. Tme two t.pnons he e ared _prefs">ine> /span>L114>>v114">hi`always use little-endilx' (like ext2fs) or `writer 2hoosesd _prefs">ine> /span>L115>>v115">hiendilxness; kernel adap at runnipa'. Little-endilx wins because ofd _prefs">ine> /span>L116>>v116">hicode simplicityypnd little CPU overhead even big-endilx machines.d _prefs">ine> /span>L117>>v117">hid _prefs">ine> /span>L118>>v118">hiThe 2ost of swabbing it changing the 2ode to use tme le32_to_cpud _prefs">ine> /span>L119>>v119">hietc. macros as>used by ext2fs. We don't need to swab the 2omp essedd _prefs">ine> /span>L120>>v120">hidata, ly the superblock, inode3 and block pointers.d _prefs">ine> /span>L121>>v121">hid _prefs">ine> /span>L122>>v122">hid _prefs">ine> /span>L123>>v123">hiThe other part of making 2.6.13 m e sharable it choosing blockd _prefs">ine> /span>L124>>v124">hisize. The o.pnons are:d _prefs">ine> /span>L125>>v125">hid _prefs">ine> /span>L126>>v126">hi 1. Always 4096 bytes.d _prefs">ine> /span>L127>>v127">hid _prefs">ine> /span>L128>>v128">hi 2. Writer 2hooses blocksize; kernel adap s"l rejects blocksize t tyd _prefs">ine> /span>L129>>v129">hi PAGE_CACHE_SIZE.d _prefs">ine> /span>L130>>v130">hid _prefs">ine> /span>L131>>v131">hi 3. Writer 2hooses blocksize; kernel adap even to blocksize t tyd _prefs">ine> /span>L132>>v132">hi PAGE_CACHE_SIZE.d _prefs">ine> /span>L133>>v133">hid _prefs">ine> /span>L134>>v134">hiIt's easy enough to change the kernel to use a sm ler ass=" thand _prefs">ine> /span>L135>>v135">hiPAGE_CACHE_SIZE: jusn>make>2.6.13_readpage read multiple blocks.d _prefs">ine> /span>L136>>v136">hid _prefs">ine> /span>L137>>v137">hiThe 2ost of ME"> 1 is that kernelt with a>lspanr PAGE_CACHE_SIZEd _prefs">ine> /span>L138>>v138">hiass=" don't get as>good 2omp ess> as> hey can.d _prefs">ine> /span>L139>>v139">hid _prefs">ine> /span>L140>>v140">hiThe 2ost of ME"> 2 relative to ME"> 1 is that the 2ode usesd _prefs">ine> /span>L141>>v141">hivariable instead of #define'd constants. Tme gain is that peopled _prefs">ine> /span>L142>>v142">hiwith kernelt having lspanr PAGE_CACHE_SIZE can make>use of that ifd _prefs">ine> /span>L143>>v143">hi hey don't mind heir 2.6.13 being inaccessible to kernelt withd _prefs">ine> /span>L144>>v144">hism ler PAGE_CACHE_SIZE ass="s.d _prefs">ine> /span>L145>>v145">hid _prefs">ine> /span>L146>>v146">hiOE"> 3 is easy to implemen if we don't mind being CPU-inefficien :d _prefs">ine> /span>L147>>v147">hie.g. get readpage to decomp ess to a buffer of size MAX_BLKSIZE (whichd _prefs">ine> /span>L148>>v148">himusn>be no lspanr than>32KB) and dis2ard what it doesn't need.d _prefs">ine> /span>L149>>v149">hiGetting readpage to read into l the 2overed pages isaharder.d _prefs">ine> /span>L150>>v150">hid _prefs">ine> /span>L151>>v151">hiThe main advanlage of ME"> 3 over 1, 2, isabetter 2omp ess> . Tmed _prefs">ine> /span>L152>>v152">hi2ost isag.eater 2omplexity. Probably not worth it, s"l I hope someoned _prefs">ine> /span>L153>>v153">hiwill disag.ee. (If it is implemen ed, then I'll re-use tmat code ind _prefs">ine> /span>L154>>v154">hie22omp .)d _prefs">ine> /span>L155>>v155">hid _prefs">ine> /span>L156>>v156">hid _prefs">ine> /span>L157>>v157">hiAnother 2ost of 2 and 3 over 1 is making mk2.6.13 use a differen d _prefs">ine> /span>L158>>v158">hiblock size, bon> hat jusn>means adding nd parsing -b ME"> .d _prefs">ine> /span>L159>>v159">hid _prefs">ine> /span>L160>>v160">hid _prefs">ine> /span>L161>>v161">hiInode Sized _prefs">ine> /span>L162>>v162">hi----------d _prefs">ine> /span>L163>>v163">hid _prefs">ine> /span>L164>>v164">hiGiven tmat c.6.13 will probably be>used for CDs etc. as>well as>jusnd _prefs">ine> /span>L165>>v165">hisilicon ROM3, it might make>sense to expand he inode a little fromd _prefs">ine> /span>L166>>v166">hiits curren 12 bytes. Inode3 other than> he root inode are fo lowedd _prefs">ine> /span>L167>>v167">hiby file/spa, so> he expans> doesn't even have to be a multiple of 4d _prefs">ine> /span>L168>>v168">hibytes.d _prefs">ine> /span>L169>>v169">hi

divme "divr_prefs"footer"> The original LXR software by the LXR 2ommunity">hi, tmit experimen al versnon by lxr@form .no">hi.d<>divme"divr_prefs"subfooter"> lxr.form .no kindly h="sed by Redpill Lorpro AS">hi, provider of Lorm consulting nd operapnons services since 1995. ">divme "/bodyme"/htmlme