linux/fs/minix/itree_common.c
<<
tio2 /spa> 2 /form 2 a tio2 href="../linux+v3e="7/fs/minix/itree_common.c"> tio2 img src="../.static/gfx/right.png" alt=">>"> t /spa> t spa> class="lxr_search"> tio="+search" method="post" onsubmit="return do_search(this);"> tio2 input typn> hidden" namn> navtarget" tioon> "> tio2 input typn> text" namn> search" id> search"> tio2 butt typn> submit">Search t spa> class="lxr_prefs" 2 a href="+prefs?return=fs/minix/itree_common.c" tio2 onclick="return ajax_prefs();"> tio2 Prefs 2 /a> t /spa> io2 /div io2 form ac >="ajax+*" method="post" onsubmit="return false;"> t input typn> hidden" namn> ajax_lookup" id> ajax_lookup" tioon> "> io2 /form io2 div class="headingbott m">
search_results" class="search_results" 2 io2 /div div id> content"> div id> file_contents"
59/35/d7f9b97df2ccaaf23155f230703faf7c7351_3/0"

L1" class="line" namn>
L1">   1
/a>
spa> class="comment">/* Generic part */
/spa>
 
L2" class="line" namn>
L2">   2
/a> 
L3" class="line" namn>
L3">   3
/a>typndef struct { 
L4" class="line" namn>
L4">   4
/a>        
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=p" class="sref">p
/a>; 
L5" class="line" namn>
L5">   5
/a>        
a href="+code=block_t" class="sref">block_t
/a> 
a href="+code=key" class="sref">key
/a>; 
L6" class="line" namn>
L6">   6
/a>        struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>; 
L7" class="line" namn>
L7">   7
/a>} 
a href="+code=Indirect" class="sref">Indirect
/a>; 
L8" class="line" namn>
L8">   8
/a> 
L9" class="line" namn>
L9">   9
/a>static 
a href="+code=DEFINE_RWLOCK" class="sref">DEFINE_RWLOCK
/a>(
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L10" class="line" namn>
L10">  v3.1a> 
L11" class="line" namn>
L11">  11
/a>static 
a href="+code=inline" class="sref">inline
/a> void 
a href="+code=add_chain" class="sref">add_chain
/a>(
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=p" class="sref">p
/a>, struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=v" class="sref">v
/a>) 
L12" class="line" namn>
L12">  12
/a>{ 
L13" class="line" namn>
L13">  13
/a>        
a href="+code=p" class="sref">p
/a>->
a href="+code=key" class="sref">key
/a> = *(
a href="+code=p" class="sref">p
/a>->
a href="+code=p" class="sref">p
/a> = 
a href="+code=v" class="sref">v
/a>); 
L14" class="line" namn>
L14">  14
/a>        
a href="+code=p" class="sref">p
/a>->
a href="+code=bh" class="sref">bh
/a> = 
a href="+code=bh" class="sref">bh
/a>; 
L15" class="line" namn>
L15">  15
/a>} 
L16" class="line" namn>
L16">  16.1a> 
L17" class="line" namn>
L17">  17
/a>static 
a href="+code=inline" class="sref">inline
/a> int 
a href="+code=verify_chain" class="sref">verify_chain
/a>(
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=fr
m" class="sref">fr
m
/a>, 
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=to" class="sref">to
/a>) 
L18" class="line" namn>
L18">  18
/a>{ 
L19" class="line" namn>
L19">  19
/a>        while (
a href="+code=fr
m" class="sref">fr
m
/a> <= 
a href="+code=to" class="sref">to
/a> && 
a href="+code=fr
m" class="sref">fr
m
/a>->
a href="+code=key" class="sref">key
/a> == *
a href="+code=fr
m" class="sref">fr
m
/a>->
a href="+code=p" class="sref">p
/a>) 
L20" class="line" namn>
L20">  20
/a>                
a href="+code=fr
m" class="sref">fr
m
/a>++; 
L21" class="line" namn>
L21">  21
/a>        return (
a href="+code=fr
m" class="sref">fr
m
/a> > 
a href="+code=to" class="sref">to
/a>); 
L22" class="line" namn>
L22">  22
/a>} 
L23" class="line" namn>
L23">  23.1a> 
L24" class="line" namn>
L24">  24
/a>static 
a href="+code=inline" class="sref">inline
/a> 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=block_end" class="sref">block_end
/a>(struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>) 
L25" class="line" namn>
L25">  25
/a>{ 
L26" class="line" namn>
L26">  26
/a>        return (
a href="+code=block_t" class="sref">block_t
/a> *)((char*)
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a> + 
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_size" class="sref">b_size
/a>); 
L27" class="line" namn>
L27">  27
/a>} 
L28" class="line" namn>
L28">  28
/a> 
L29" class="line" namn>
L29">  29
/a>static 
a href="+code=inline" class="sref">inline
/a> 
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=get_branch" class="sref">get_branch
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
L30" class="line" namn>
L30">  30
/a>                                        int 
a href="+code=depth" class="sref">depth
/a>, 
L31" class="line" namn>
L31">  31
/a>                                        int *
a href="+code=offsets" class="sref">offsets
/a>, 
L32" class="line" namn>
L32">  32
/a>                                        
a href="+code=Indirect" class="sref">Indirect
/a> 
a href="+code=chain" class="sref">chain
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>], 
L33" class="line" namn>
L33">  33
/a>                                        int *
a href="+code=err" class="sref">err
/a>) 
L34" class="line" namn>
L34">  34
/a>{ 
L35" class="line" namn>
L35">  35
/a>        struct 
a href="+code=super_block" class="sref">super_block
/a> *
a href="+code=sb" class="sref">sb
/a> = 
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_sb" class="sref">i_sb
/a>; 
L36" class="line" namn>
L36">  36
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=p" class="sref">p
/a> = 
a href="+code=chain" class="sref">chain
/a>; 
L37" class="line" namn>
L37">  37
/a>        struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>; 
L38" class="line" namn>
L38">  38
/a> 
L39" class="line" namn>
L39">  39
/a>        *
a href="+code=err" class="sref">err
/a> = 0; 
L40" class="line" namn>
L40">  40
/a>        
spa> class="comment">/* i_data is not going away, no lock needed */
/spa>
 
L41" class="line" namn>
L41">  41
/a>        
a href="+code=add_chain" class="sref">add_chain
/a> (
a href="+code=chain" class="sref">chain
/a>, 
a href="+code=NULL" class="sref">NULL
/a>, 
a href="+code=i_data" class="sref">i_data
/a>(
a href="+code=inode" class="sref">inode
/a>) + *
a href="+code=offsets" class="sref">offsets
/a>); 
L42" class="line" namn>
L42">  42
/a>        if (!
a href="+code=p" class="sref">p
/a>->
a href="+code=key" class="sref">key
/a>) 
L43" class="line" namn>
L43">  43
/a>                goto 
a href="+code=no_block" class="sref">no_block
/a>; 
L44" class="line" namn>
L44">  44
/a>        while (--
a href="+code=depth" class="sref">depth
/a>) { 
L45" class="line" namn>
L45">  45
/a>                
a href="+code=bh" class="sref">bh
/a> = 
a href="+code=sb_bread" class="sref">sb_bread
/a>(
a href="+code=sb" class="sref">sb
/a>, 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(
a href="+code=p" class="sref">p
/a>->
a href="+code=key" class="sref">key
/a>)); 
L46" class="line" namn>
L46">  46
/a>                if (!
a href="+code=bh" class="sref">bh
/a>) 
L47" class="line" namn>
L47">  47
/a>                        goto 
a href="+code=failure" class="sref">failure
/a>; 
L48" class="line" namn>
L48">  48
/a>                
a href="+code=read_lock" class="sref">read_lock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L49" class="line" namn>
L49">  49
/a>                if (!
a href="+code=verify_chain" class="sref">verify_chain
/a>(
a href="+code=chain" class="sref">chain
/a>, 
a href="+code=p" class="sref">p
/a>)) 
L50" class="line" namn>
L50">  50
/a>                        goto 
a href="+code=changed" class="sref">changed
/a>; 
L51" class="line" namn>
L51">  51
/a>                
a href="+code=add_chain" class="sref">add_chain
/a>(++
a href="+code=p" class="sref">p
/a>, 
a href="+code=bh" class="sref">bh
/a>, (
a href="+code=block_t" class="sref">block_t
/a> *)
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a> + *++
a href="+code=offsets" class="sref">offsets
/a>); 
L52" class="line" namn>
L52">  52
/a>                
a href="+code=read_unlock" class="sref">read_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L53" class="line" namn>
L53">  53
/a>                if (!
a href="+code=p" class="sref">p
/a>->
a href="+code=key" class="sref">key
/a>) 
L54" class="line" namn>
L54">  54
/a>                        goto 
a href="+code=no_block" class="sref">no_block
/a>; 
L55" class="line" namn>
L55">  55
/a>        } 
L56" class="line" namn>
L56">  56
/a>        return 
a href="+code=NULL" class="sref">NULL
/a>; 
L57" class="line" namn>
L57">  57
/a> 
L58" class="line" namn>
L58">  58
/a>
a href="+code=changed" class="sref">changed
/a>: 
L59" class="line" namn>
L59">  59
/a>        
a href="+code=read_unlock" class="sref">read_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L60" class="line" namn>
L60">  60
/a>        
a href="+code=brelse" class="sref">brelse
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L61" class="line" namn>
L61">  61
/a>        *
a href="+code=err" class="sref">err
/a> = -
a href="+code=EAGAIN" class="sref">EAGAIN
/a>; 
L62" class="line" namn>
L62">  62
/a>        goto 
a href="+code=no_block" class="sref">no_block
/a>; 
L63" class="line" namn>
L63">  63
/a>
a href="+code=failure" class="sref">failure
/a>: 
L64" class="line" namn>
L64">  64
/a>        *
a href="+code=err" class="sref">err
/a> = -
a href="+code=EIO" class="sref">EIO
/a>; 
L65" class="line" namn>
L65">  65
/a>
a href="+code=no_block" class="sref">no_block
/a>: 
L66" class="line" namn>
L66">  66
/a>        return 
a href="+code=p" class="sref">p
/a>; 
L67" class="line" namn>
L67">  67
/a>} 
L68" class="line" namn>
L68">  68
/a> 
L69" class="line" namn>
L69">  69
/a>static int 
a href="+code=alloc_branch" class="sref">alloc_branch
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
L70" class="line" namn>
L70">  70
/a>                             int 
a href="+code=num" class="sref">num
/a>, 
L71" class="line" namn>
L71">  71
/a>                             int *
a href="+code=offsets" class="sref">offsets
/a>, 
L72" class="line" namn>
L72">  72
/a>                             
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=branch" class="sref">branch
/a>) 
L73" class="line" namn>
L73">  73
/a>{ 
L74" class="line" namn>
L74">  74
/a>        int 
a href="+code=n" class="sref">n
/a> = 0; 
L75" class="line" namn>
L75">  75
/a>        int 
a href="+code=i" class="sref">i
/a>; 
L76" class="line" namn>
L76">  76
/a>        int 
a href="+code=parent" class="sref">parent
/a> = 
a href="+code=minix_new_block" class="sref">minix_new_block
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L77" class="line" namn>
L77">  77
/a> 
L78" class="line" namn>
L78">  78
/a>        
a href="+code=branch" class="sref">branch
/a>[0].
a href="+code=key" class="sref">key
/a> = 
a href="+code=cpu_to_block" class="sref">cpu_to_block
/a>(
a href="+code=parent" class="sref">parent
/a>); 
L79" class="line" namn>
L79">  79
/a>        if (
a href="+code=parent" class="sref">parent
/a>) for (
a href="+code=n" class="sref">n
/a> = 1; 
a href="+code=n" class="sref">n
/a> < 
a href="+code=num" class="sref">num
/a>; 
a href="+code=n" class="sref">n
/a>++) { 
L80" class="line" namn>
L80">  80
/a>                struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>; 
L81" class="line" namn>
L81">  81
/a>                
spa> class="comment">/* Allocate the next block */
/spa>
 
L82" class="line" namn>
L82">  82
/a>                int 
a href="+code=nr" class="sref">nr
/a> = 
a href="+code=minix_new_block" class="sref">minix_new_block
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L83" class="line" namn>
L83">  83
/a>                if (!
a href="+code=nr" class="sref">nr
/a>) 
L84" class="line" namn>
L84">  84
/a>                        break; 
L85" class="line" namn>
L85">  85
/a>                
a href="+code=branch" class="sref">branch
/a>[
a href="+code=n" class="sref">n
/a>].
a href="+code=key" class="sref">key
/a> = 
a href="+code=cpu_to_block" class="sref">cpu_to_block
/a>(
a href="+code=nr" class="sref">nr
/a>); 
L86" class="line" namn>
L86">  86
/a>                
a href="+code=bh" class="sref">bh
/a> = 
a href="+code=sb_getblk" class="sref">sb_getblk
/a>(
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_sb" class="sref">i_sb
/a>, 
a href="+code=parent" class="sref">parent
/a>); 
L87" class="line" namn>
L87">  87
/a>                
a href="+code=lock_buffer" class="sref">lock_buffer
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L88" class="line" namn>
L88">  88
/a>                
a href="+code=memset" class="sref">memset
/a>(
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a>, 0, 
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_size" class="sref">b_size
/a>); 
L89" class="line" namn>
L89">  89
/a>                
a href="+code=branch" class="sref">branch
/a>[
a href="+code=n" class="sref">n
/a>].
a href="+code=bh" class="sref">bh
/a> = 
a href="+code=bh" class="sref">bh
/a>; 
L90" class="line" namn>
L90">  90
/a>                
a href="+code=branch" class="sref">branch
/a>[
a href="+code=n" class="sref">n
/a>].
a href="+code=p" class="sref">p
/a> = (
a href="+code=block_t" class="sref">block_t
/a>*) 
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a> + 
a href="+code=offsets" class="sref">offsets
/a>[
a href="+code=n" class="sref">n
/a>]; 
L91" class="line" namn>
L91">  91
/a>                *
a href="+code=branch" class="sref">branch
/a>[
a href="+code=n" class="sref">n
/a>].
a href="+code=p" class="sref">p
/a> = 
a href="+code=branch" class="sref">branch
/a>[
a href="+code=n" class="sref">n
/a>].
a href="+code=key" class="sref">key
/a>; 
L92" class="line" namn>
L92">  92
/a>                
a href="+code=set_buffer_uptodate" class="sref">set_buffer_uptodate
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L93" class="line" namn>
L93">  93
/a>                
a href="+code=unlock_buffer" class="sref">unlock_buffer
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L94" class="line" namn>
L94">  94
/a>                
a href="+code=mark_buffer_dirty_inode" class="sref">mark_buffer_dirty_inode
/a>(
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=inode" class="sref">inode
/a>); 
L95" class="line" namn>
L95">  95
/a>                
a href="+code=parent" class="sref">parent
/a> = 
a href="+code=nr" class="sref">nr
/a>; 
L96" class="line" namn>
L96">  96
/a>        } 
L97" class="line" namn>
L97">  97
/a>        if (
a href="+code=n" class="sref">n
/a> == 
a href="+code=num" class="sref">num
/a>) 
L98" class="line" namn>
L98">  98
/a>                return 0; 
L99" class="line" namn>
L99">  99
/a> 
L100" class="line" namn>
L100"> 100
/a>        
spa> class="comment">/* Allocat 
  failed, free what we already allocated */
/spa>
 
L101" class="line" namn>
L101"> 101
/a>        for (
a href="+code=i" class="sref">i
/a> = 1; 
a href="+code=i" class="sref">i
/a> < 
a href="+code=n" class="sref">n
/a>; 
a href="+code=i" class="sref">i
/a>++) 
L102" class="line" namn>
L102"> 102
/a>                
a href="+code=bforget" class="sref">bforget
/a>(
a href="+code=branch" class="sref">branch
/a>[
a href="+code=i" class="sref">i
/a>].
a href="+code=bh" class="sref">bh
/a>); 
L103" class="line" namn>
L103"> 103
/a>        for (
a href="+code=i" class="sref">i
/a> = 0; 
a href="+code=i" class="sref">i
/a> < 
a href="+code=n" class="sref">n
/a>; 
a href="+code=i" class="sref">i
/a>++) 
L104" class="line" namn>
L104"> 104
/a>                
a href="+code=minix_free_block" class="sref">minix_free_block
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(
a href="+code=branch" class="sref">branch
/a>[
a href="+code=i" class="sref">i
/a>].
a href="+code=key" class="sref">key
/a>)); 
L105" class="line" namn>
L105"> 105
/a>        return -
a href="+code=ENOSPC" class="sref">ENOSPC
/a>; 
L106" class="line" namn>
L106"> 106
/a>} 
L107" class="line" namn>
L107"> 107
/a> 
L108" class="line" namn>
L108"> 108
/a>static 
a href="+code=inline" class="sref">inline
/a> int 
a href="+code=splice_branch" class="sref">splice_branch
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
L109" class="line" namn>
L109"> 109
/a>                                     
a href="+code=Indirect" class="sref">Indirect
/a> 
a href="+code=chain" class="sref">chain
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>], 
L110" class="line" namn>
L110"> 110
/a>                                     
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=where" class="sref">where
/a>, 
L111" class="line" namn>
L111"> 111
/a>                                     int 
a href="+code=num" class="sref">num
/a>) 
L112" class="line" namn>
L112"> 112
/a>{ 
L113" class="line" namn>
L113"> 113
/a>        int 
a href="+code=i" class="sref">i
/a>; 
L114" class="line" namn>
L114"> 114
/a> 
L115" class="line" namn>
L115"> 115
/a>        
a href="+code=write_lock" class="sref">write_lock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L116" class="line" namn>
L116"> 116.1a> 
L117" class="line" namn>
L117"> 117
/a>        
spa> class="comment">/* Verify that place we are splicing to is still there and vacant */
/spa>
 
L118" class="line" namn>
L118"> 118
/a>        if (!
a href="+code=verify_chain" class="sref">verify_chain
/a>(
a href="+code=chain" class="sref">chain
/a>, 
a href="+code=where" class="sref">where
/a>-1) || *
a href="+code=where" class="sref">where
/a>->
a href="+code=p" class="sref">p
/a>) 
L119" class="line" namn>
L119"> 119
/a>                goto 
a href="+code=changed" class="sref">changed
/a>; 
L120" class="line" namn>
L120"> 123.1a> 
L121" class="line" namn>
L121"> 121
/a>        *
a href="+code=where" class="sref">where
/a>->
a href="+code=p" class="sref">p
/a> = 
a href="+code=where" class="sref">where
/a>->
a href="+code=key" class="sref">key
/a>; 
L122" class="line" namn>
L122"> 122
/a> 
L123" class="line" namn>
L123"> 123
/a>        
a href="+code=write_unlock" class="sref">write_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L124" class="line" namn>
L124"> 124
/a> 
L125" class="line" namn>
L125"> 125
/a>        
spa> class="comment">/* We are done with atomic stuff, now do the rest of housekeeping */
/spa>
 
L126" class="line" namn>
L126"> 126.1a> 
L127" class="line" namn>
L127"> 127
/a>        
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_ctime" class="sref">i_ctime
/a> = 
a href="+code=CURRENT_TIME_SEC" class="sref">CURRENT_TIME_SEC
/a>; 
L128" class="line" namn>
L128"> 128
/a> 
L129" class="line" namn>
L129"> 129
/a>        
spa> class="comment">/* had we spliced it onto indirect block? */
/spa>
 
L130" class="line" namn>
L130"> 130
/a>        if (
a href="+code=where" class="sref">where
/a>->
a href="+code=bh" class="sref">bh
/a>) 
L131" class="line" namn>
L131"> 131
/a>                
a href="+code=mark_buffer_dirty_inode" class="sref">mark_buffer_dirty_inode
/a>(
a href="+code=where" class="sref">where
/a>->
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=inode" class="sref">inode
/a>); 
L132" class="line" namn>
L132"> 132
/a> 
L133" class="line" namn>
L133"> 133
/a>        
a href="+code=mark_inode_dirty" class="sref">mark_inode_dirty
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L134" class="line" namn>
L134"> 134
/a>        return 0; 
L135" class="line" namn>
L135"> 135
/a> 
L136" class="line" namn>
L136"> 136
/a>
a href="+code=changed" class="sref">changed
/a>: 
L137" class="line" namn>
L137"> 137
/a>        
a href="+code=write_unlock" class="sref">write_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L138" class="line" namn>
L138"> 138
/a>        for (
a href="+code=i" class="sref">i
/a> = 1; 
a href="+code=i" class="sref">i
/a> < 
a href="+code=num" class="sref">num
/a>; 
a href="+code=i" class="sref">i
/a>++) 
L139" class="line" namn>
L139"> 139
/a>                
a href="+code=bforget" class="sref">bforget
/a>(
a href="+code=where" class="sref">where
/a>[
a href="+code=i" class="sref">i
/a>].
a href="+code=bh" class="sref">bh
/a>); 
L140" class="line" namn>
L140"> 140
/a>        for (
a href="+code=i" class="sref">i
/a> = 0; 
a href="+code=i" class="sref">i
/a> < 
a href="+code=num" class="sref">num
/a>; 
a href="+code=i" class="sref">i
/a>++) 
L141" class="line" namn>
L141"> 141
/a>                
a href="+code=minix_free_block" class="sref">minix_free_block
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(
a href="+code=where" class="sref">where
/a>[
a href="+code=i" class="sref">i
/a>].
a href="+code=key" class="sref">key
/a>)); 
L142" class="line" namn>
L142"> 142
/a>        return -
a href="+code=EAGAIN" class="sref">EAGAIN
/a>; 
L143" class="line" namn>
L143"> 143
/a>} 
L144" class="line" namn>
L144"> 144
/a> 
L145" class="line" namn>
L145"> 145
/a>static 
a href="+code=inline" class="sref">inline
/a> int 
a href="+code=get_block" class="sref">get_block
/a>(struct 
a href="+code=inode" class="sref">inode
/a> * 
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=sector_t" class="sref">sector_t
/a> 
a href="+code=block" class="sref">block
/a>, 
L146" class="line" namn>
L146"> 146
/a>                        struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> *
a href="+code=bh" class="sref">bh
/a>, int 
a href="+code=create" class="sref">create
/a>) 
L147" class="line" namn>
L147"> 147
/a>{ 
L148" class="line" namn>
L148"> 148
/a>        int 
a href="+code=err" class="sref">err
/a> = -
a href="+code=EIO" class="sref">EIO
/a>; 
L149" class="line" namn>
L149"> 149
/a>        int 
a href="+code=offsets" class="sref">offsets
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>]; 
L150" class="line" namn>
L150"> 150
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> 
a href="+code=chain" class="sref">chain
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>]; 
L151" class="line" namn>
L151"> 151
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=partial" class="sref">partial
/a>; 
L152" class="line" namn>
L152"> 152
/a>        int 
a href="+code=left" class="sref">left
/a>; 
L153" class="line" namn>
L153"> 153
/a>        int 
a href="+code=depth" class="sref">depth
/a> = 
a href="+code=block_to_path" class="sref">block_to_path
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=block" class="sref">block
/a>, 
a href="+code=offsets" class="sref">offsets
/a>); 
L154" class="line" namn>
L154"> 154
/a> 
L155" class="line" namn>
L155"> 155
/a>        if (
a href="+code=depth" class="sref">depth
/a> == 0) 
L156" class="line" namn>
L156"> 156
/a>                goto 
a href="+code=out" class="sref">out
/a>; 
L157" class="line" namn>
L157"> 157
/a> 
L158" class="line" namn>
L158"> 158
/a>
a href="+code=reread" class="sref">reread
/a>: 
L159" class="line" namn>
L159"> 159
/a>        
a href="+code=partial" class="sref">partial
/a> = 
a href="+code=get_branch" class="sref">get_branch
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=depth" class="sref">depth
/a>, 
a href="+code=offsets" class="sref">offsets
/a>, 
a href="+code=chain" class="sref">chain
/a>, &
a href="+code=err" class="sref">err
/a>); 
L160" class="line" namn>
L160"> 163.1a> 
L161" class="line" namn>
L161"> 161
/a>        
spa> class="comment">/* Simplest case - block found, no allocat 
  needed */
/spa>
 
L162" class="line" namn>
L162"> 162
/a>        if (!
a href="+code=partial" class="sref">partial
/a>) { 
L163" class="line" namn>
L163"> 163
/a>
a href="+code=got_it" class="sref">got_it
/a>: 
L164" class="line" namn>
L164"> 164
/a>                
a href="+code=map_bh" class="sref">map_bh
/a>(
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_sb" class="sref">i_sb
/a>, 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(
a href="+code=chain" class="sref">chain
/a>[
a href="+code=depth" class="sref">depth
/a>-1].
a href="+code=key" class="sref">key
/a>)); 
L165" class="line" namn>
L165"> 165
/a>                
spa> class="comment">/* Clea> up and exit */
/spa>
 
L166" class="line" namn>
L166"> 166
/a>                
a href="+code=partial" class="sref">partial
/a> = 
a href="+code=chain" class="sref">chain
/a>+
a href="+code=depth" class="sref">depth
/a>-1; 
spa> class="comment">/* the whole chain */
/spa>
 
L167" class="line" namn>
L167"> 167
/a>                goto 
a href="+code=clea>up" class="sref">clea>up
/a>; 
L168" class="line" namn>
L168"> 168
/a>        } 
L169" class="line" namn>
L169"> 169
/a> 
L170" class="line" namn>
L170"> 170
/a>        
spa> class="comment">/* Next simple case - plain lookup or failed read of indirect block */
/spa>
 
L171" class="line" namn>
L171"> 171
/a>        if (!
a href="+code=create" class="sref">create
/a> || 
a href="+code=err" class="sref">err
/a> == -
a href="+code=EIO" class="sref">EIO
/a>) { 
L172" class="line" namn>
L172"> 172
/a>
a href="+code=clea>up" class="sref">clea>up
/a>: 
L173" class="line" namn>
L173"> 173
/a>                while (
a href="+code=partial" class="sref">partial
/a> > 
a href="+code=chain" class="sref">chain
/a>) { 
L174" class="line" namn>
L174"> 174
/a>                        
a href="+code=brelse" class="sref">brelse
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>); 
L175" class="line" namn>
L175"> 175
/a>                        
a href="+code=partial" class="sref">partial
/a>--; 
L176" class="line" namn>
L176"> 176
/a>                } 
L177" class="line" namn>
L177"> 177
/a>
a href="+code=out" class="sref">out
/a>: 
L178" class="line" namn>
L178"> 178
/a>                return 
a href="+code=err" class="sref">err
/a>; 
L179" class="line" namn>
L179"> 179
/a>        } 
L180" class="line" namn>
L180"> 183.1a> 
L181" class="line" namn>
L181"> 181
/a>        
spa> class="comment">/*
/spa>
 
L182" class="line" namn>
L182"> 182
/a>
spa> class="comment">         * Indirect block might be removed by truncate while we were
/spa>
 
L183" class="line" namn>
L183"> 183
/a>
spa> class="comment">         * reading it. Handling of that case (forget what we've got and
/spa>
 
L184" class="line" namn>
L184"> 184
/a>
spa> class="comment">         * reread) is taken out of the main path.
/spa>
 
L185" class="line" namn>
L185"> 185
/a>
spa> class="comment">         */
/spa>
 
L186" class="line" namn>
L186"> 186
/a>        if (
a href="+code=err" class="sref">err
/a> == -
a href="+code=EAGAIN" class="sref">EAGAIN
/a>) 
L187" class="line" namn>
L187"> 187
/a>                goto 
a href="+code=changed" class="sref">changed
/a>; 
L188" class="line" namn>
L188"> 188
/a> 
L189" class="line" namn>
L189"> 189
/a>        
a href="+code=left" class="sref">left
/a> = (
a href="+code=chain" class="sref">chain
/a> + 
a href="+code=depth" class="sref">depth
/a>) - 
a href="+code=partial" class="sref">partial
/a>; 
L190" class="line" namn>
L190"> 190
/a>        
a href="+code=err" class="sref">err
/a> = 
a href="+code=alloc_branch" class="sref">alloc_branch
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=left" class="sref">left
/a>, 
a href="+code=offsets" class="sref">offsets
/a>+(
a href="+code=partial" class="sref">partial
/a>-
a href="+code=chain" class="sref">chain
/a>), 
a href="+code=partial" class="sref">partial
/a>); 
L191" class="line" namn>
L191"> 191
/a>        if (
a href="+code=err" class="sref">err
/a>) 
L192" class="line" namn>
L192"> 192
/a>                goto 
a href="+code=clea>up" class="sref">clea>up
/a>; 
L193" class="line" namn>
L193"> 193.1a> 
L194" class="line" namn>
L194"> 194
/a>        if (
a href="+code=splice_branch" class="sref">splice_branch
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=chain" class="sref">chain
/a>, 
a href="+code=partial" class="sref">partial
/a>, 
a href="+code=left" class="sref">left
/a>) < 0) 
L195" class="line" namn>
L195"> 195
/a>                goto 
a href="+code=changed" class="sref">changed
/a>; 
L196" class="line" namn>
L196"> 196.1a> 
L197" class="line" namn>
L197"> 197
/a>        
a href="+code=set_buffer_new" class="sref">set_buffer_new
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L198" class="line" namn>
L198"> 198
/a>        goto 
a href="+code=got_it" class="sref">got_it
/a>; 
L199" class="line" namn>
L199"> 199
/a> 
L200" class="line" namn>
L200"> 200
/a>
a href="+code=changed" class="sref">changed
/a>: 
L201" class="line" namn>
L201"> 201
/a>        while (
a href="+code=partial" class="sref">partial
/a> > 
a href="+code=chain" class="sref">chain
/a>) { 
L202" class="line" namn>
L202"> 202
/a>                
a href="+code=brelse" class="sref">brelse
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>); 
L203" class="line" namn>
L203"> 203
/a>                
a href="+code=partial" class="sref">partial
/a>--; 
L204" class="line" namn>
L204"> 204
/a>        } 
L205" class="line" namn>
L205"> 205
/a>        goto 
a href="+code=reread" class="sref">reread
/a>; 
L206" class="line" namn>
L206"> 206
/a>} 
L207" class="line" namn>
L207"> 207
/a> 
L208" class="line" namn>
L208"> 208
/a>static 
a href="+code=inline" class="sref">inline
/a> int 
a href="+code=all_zeroes" class="sref">all_zeroes
/a>(
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=p" class="sref">p
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=q" class="sref">q
/a>) 
L209" class="line" namn>
L209"> 209
/a>{ 
L210" class="line" namn>
L210"> 210
/a>        while (
a href="+code=p" class="sref">p
/a> < 
a href="+code=q" class="sref">q
/a>) 
L211" class="line" namn>
L211"> 211
/a>                if (*
a href="+code=p" class="sref">p
/a>++) 
L212" class="line" namn>
L212"> 212
/a>                        return 0; 
L213" class="line" namn>
L213"> 213
/a>        return 1; 
L214" class="line" namn>
L214"> 214
/a>} 
L215" class="line" namn>
L215"> 215
/a> 
L216" class="line" namn>
L216"> 216.1a>static 
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=find_shared" class="sref">find_shared
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
L217" class="line" namn>
L217"> 217
/a>                                int 
a href="+code=depth" class="sref">depth
/a>, 
L218" class="line" namn>
L218"> 218
/a>                                int 
a href="+code=offsets" class="sref">offsets
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>], 
L219" class="line" namn>
L219"> 219
/a>                                
a href="+code=Indirect" class="sref">Indirect
/a> 
a href="+code=chain" class="sref">chain
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>], 
L220" class="line" namn>
L220"> 220
/a>                                
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=top" class="sref">top
/a>) 
L221" class="line" namn>
L221"> 221
/a>{ 
L222" class="line" namn>
L222"> 222
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=partial" class="sref">partial
/a>, *
a href="+code=p" class="sref">p
/a>; 
L223" class="line" namn>
L223"> 223
/a>        int 
a href="+code=k" class="sref">k
/a>, 
a href="+code=err" class="sref">err
/a>; 
L224" class="line" namn>
L224"> 224
/a> 
L225" class="line" namn>
L225"> 225
/a>        *
a href="+code=top" class="sref">top
/a> = 0; 
L226" class="line" namn>
L226"> 226
/a>        for (
a href="+code=k" class="sref">k
/a> = 
a href="+code=depth" class="sref">depth
/a>; 
a href="+code=k" class="sref">k
/a> > 1 && !
a href="+code=offsets" class="sref">offsets
/a>[
a href="+code=k" class="sref">k
/a>-1]; 
a href="+code=k" class="sref">k
/a>--) 
L227" class="line" namn>
L227"> 227
/a>                ; 
L228" class="line" namn>
L228"> 228
/a>        
a href="+code=partial" class="sref">partial
/a> = 
a href="+code=get_branch" class="sref">get_branch
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=k" class="sref">k
/a>, 
a href="+code=offsets" class="sref">offsets
/a>, 
a href="+code=chain" class="sref">chain
/a>, &
a href="+code=err" class="sref">err
/a>); 
L229" class="line" namn>
L229"> 229
/a> 
L230" class="line" namn>
L230"> 230
/a>        
a href="+code=write_lock" class="sref">write_lock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L231" class="line" namn>
L231"> 231
/a>        if (!
a href="+code=partial" class="sref">partial
/a>) 
L232" class="line" namn>
L232"> 232
/a>                
a href="+code=partial" class="sref">partial
/a> = 
a href="+code=chain" class="sref">chain
/a> + 
a href="+code=k" class="sref">k
/a>-1; 
L233" class="line" namn>
L233"> 233
/a>        if (!
a href="+code=partial" class="sref">partial
/a>->
a href="+code=key" class="sref">key
/a> && *
a href="+code=partial" class="sref">partial
/a>->
a href="+code=p" class="sref">p
/a>) { 
L234" class="line" namn>
L234"> 234
/a>                
a href="+code=write_unlock" class="sref">write_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L235" class="line" namn>
L235"> 235
/a>                goto 
a href="+code=no_top" class="sref">no_top
/a>; 
L236" class="line" namn>
L236"> 236
/a>        } 
L237" class="line" namn>
L237"> 237
/a>        for (
a href="+code=p" class="sref">p
/a>=
a href="+code=partial" class="sref">partial
/a>;
a href="+code=p" class="sref">p
/a>>
a href="+code=chain" class="sref">chain
/a> && 
a href="+code=all_zeroes" class="sref">all_zeroes
/a>((
a href="+code=block_t" class="sref">block_t
/a>*)
a href="+code=p" class="sref">p
/a>->
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a>,
a href="+code=p" class="sref">p
/a>->
a href="+code=p" class="sref">p
/a>);
a href="+code=p" class="sref">p
/a>--) 
L238" class="line" namn>
L238"> 238
/a>                ; 
L239" class="line" namn>
L239"> 239
/a>        if (
a href="+code=p" class="sref">p
/a> == 
a href="+code=chain" class="sref">chain
/a> + 
a href="+code=k" class="sref">k
/a> - 1 && 
a href="+code=p" class="sref">p
/a> > 
a href="+code=chain" class="sref">chain
/a>) { 
L240" class="line" namn>
L240"> 240
/a>                
a href="+code=p" class="sref">p
/a>->
a href="+code=p" class="sref">p
/a>--; 
L241" class="line" namn>
L241"> 241
/a>        } else { 
L242" class="line" namn>
L242"> 242
/a>                *
a href="+code=top" class="sref">top
/a> = *
a href="+code=p" class="sref">p
/a>->
a href="+code=p" class="sref">p
/a>; 
L243" class="line" namn>
L243"> 243
/a>                *
a href="+code=p" class="sref">p
/a>->
a href="+code=p" class="sref">p
/a> = 0; 
L244" class="line" namn>
L244"> 244
/a>        } 
L245" class="line" namn>
L245"> 245
/a>        
a href="+code=write_unlock" class="sref">write_unlock
/a>(&
a href="+code=pointers_lock" class="sref">pointers_lock
/a>); 
L246" class="line" namn>
L246"> 246.1a> 
L247" class="line" namn>
L247"> 247
/a>        while(
a href="+code=partial" class="sref">partial
/a> > 
a href="+code=p" class="sref">p
/a>) 
L248" class="line" namn>
L248"> 248
/a>        { 
L249" class="line" namn>
L249"> 249
/a>                
a href="+code=brelse" class="sref">brelse
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>); 
L250" class="line" namn>
L250"> 250
/a>                
a href="+code=partial" class="sref">partial
/a>--; 
L251" class="line" namn>
L251"> 251
/a>        } 
L252" class="line" namn>
L252"> 252
/a>
a href="+code=no_top" class="sref">no_top
/a>: 
L253" class="line" namn>
L253"> 253
/a>        return 
a href="+code=partial" class="sref">partial
/a>; 
L254" class="line" namn>
L254"> 254
/a>} 
L255" class="line" namn>
L255"> 255
/a> 
L256" class="line" namn>
L256"> 256.1a>static 
a href="+code=inline" class="sref">inline
/a> void 
a href="+code=free_data" class="sref">free_data
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=p" class="sref">p
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=q" class="sref">q
/a>) 
L257" class="line" namn>
L257"> 257
/a>{ 
L258" class="line" namn>
L258"> 258
/a>        unsigned long 
a href="+code=nr" class="sref">nr
/a>; 
L259" class="line" namn>
L259"> 259
/a> 
L260" class="line" namn>
L260"> 260
/a>        for ( ; 
a href="+code=p" class="sref">p
/a> < 
a href="+code=q" class="sref">q
/a> ; 
a href="+code=p" class="sref">p
/a>++) { 
L261" class="line" namn>
L261"> 261
/a>                
a href="+code=nr" class="sref">nr
/a> = 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(*
a href="+code=p" class="sref">p
/a>); 
L262" class="line" namn>
L262"> 262
/a>                if (
a href="+code=nr" class="sref">nr
/a>) { 
L263" class="line" namn>
L263"> 263
/a>                        *
a href="+code=p" class="sref">p
/a> = 0; 
L264" class="line" namn>
L264"> 264
/a>                        
a href="+code=minix_free_block" class="sref">minix_free_block
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=nr" class="sref">nr
/a>); 
L265" class="line" namn>
L265"> 265
/a>                } 
L266" class="line" namn>
L266"> 266
/a>        } 
L267" class="line" namn>
L267"> 267
/a>} 
L268" class="line" namn>
L268"> 268
/a> 
L269" class="line" namn>
L269"> 269
/a>static void 
a href="+code=free_branches" class="sref">free_branches
/a>(struct 
a href="+code=inode" class="sref">inode
/a> *
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=p" class="sref">p
/a>, 
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=q" class="sref">q
/a>, int 
a href="+code=depth" class="sref">depth
/a>) 
L270" class="line" namn>
L270"> 270
/a>{ 
L271" class="line" namn>
L271"> 271
/a>        struct 
a href="+code=buffer_head" class="sref">buffer_head
/a> * 
a href="+code=bh" class="sref">bh
/a>; 
L272" class="line" namn>
L272"> 272
/a>        unsigned long 
a href="+code=nr" class="sref">nr
/a>; 
L273" class="line" namn>
L273"> 273.1a> 
L274" class="line" namn>
L274"> 274
/a>        if (
a href="+code=depth" class="sref">depth
/a>--) { 
L275" class="line" namn>
L275"> 275
/a>                for ( ; 
a href="+code=p" class="sref">p
/a> < 
a href="+code=q" class="sref">q
/a> ; 
a href="+code=p" class="sref">p
/a>++) { 
L276" class="line" namn>
L276"> 276
/a>                        
a href="+code=nr" class="sref">nr
/a> = 
a href="+code=block_to_cpu" class="sref">block_to_cpu
/a>(*
a href="+code=p" class="sref">p
/a>); 
L277" class="line" namn>
L277"> 277
/a>                        if (!
a href="+code=nr" class="sref">nr
/a>) 
L278" class="line" namn>
L278"> 278
/a>                                continue; 
L279" class="line" namn>
L279"> 279
/a>                        *
a href="+code=p" class="sref">p
/a> = 0; 
L280" class="line" namn>
L280"> 280
/a>                        
a href="+code=bh" class="sref">bh
/a> = 
a href="+code=sb_bread" class="sref">sb_bread
/a>(
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_sb" class="sref">i_sb
/a>, 
a href="+code=nr" class="sref">nr
/a>); 
L281" class="line" namn>
L281"> 281
/a>                        if (!
a href="+code=bh" class="sref">bh
/a>) 
L282" class="line" namn>
L282"> 282
/a>                                continue; 
L283" class="line" namn>
L283"> 283
/a>                        
a href="+code=free_branches" class="sref">free_branches
/a>(
a href="+code=inode" class="sref">inode
/a>, (
a href="+code=block_t" class="sref">block_t
/a>*)
a href="+code=bh" class="sref">bh
/a>->
a href="+code=b_data" class="sref">b_data
/a>, 
L284" class="line" namn>
L284"> 284
/a>                                      
a href="+code=block_end" class="sref">block_end
/a>(
a href="+code=bh" class="sref">bh
/a>), 
a href="+code=depth" class="sref">depth
/a>); 
L285" class="line" namn>
L285"> 285
/a>                        
a href="+code=bforget" class="sref">bforget
/a>(
a href="+code=bh" class="sref">bh
/a>); 
L286" class="line" namn>
L286"> 286
/a>                        
a href="+code=minix_free_block" class="sref">minix_free_block
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=nr" class="sref">nr
/a>); 
L287" class="line" namn>
L287"> 287
/a>                        
a href="+code=mark_inode_dirty" class="sref">mark_inode_dirty
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L288" class="line" namn>
L288"> 288
/a>                } 
L289" class="line" namn>
L289"> 289
/a>        } else 
L290" class="line" namn>
L290"> 290
/a>                
a href="+code=free_data" class="sref">free_data
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=p" class="sref">p
/a>, 
a href="+code=q" class="sref">q
/a>); 
L291" class="line" namn>
L291"> 291
/a>} 
L292" class="line" namn>
L292"> 292
/a> 
L293" class="line" namn>
L293"> 293.1a>static 
a href="+code=inline" class="sref">inline
/a> void 
a href="+code=truncate" class="sref">truncate
/a> (struct 
a href="+code=inode" class="sref">inode
/a> * 
a href="+code=inode" class="sref">inode
/a>) 
L294" class="line" namn>
L294"> 294
/a>{ 
L295" class="line" namn>
L295"> 295
/a>        struct 
a href="+code=super_block" class="sref">super_block
/a> *
a href="+code=sb" class="sref">sb
/a> = 
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_sb" class="sref">i_sb
/a>; 
L296" class="line" namn>
L296"> 296
/a>        
a href="+code=block_t" class="sref">block_t
/a> *
a href="+code=idata" class="sref">idata
/a> = 
a href="+code=i_data" class="sref">i_data
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L297" class="line" namn>
L297"> 297
/a>        int 
a href="+code=offsets" class="sref">offsets
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>]; 
L298" class="line" namn>
L298"> 298
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> 
a href="+code=chain" class="sref">chain
/a>[
a href="+code=DEPTH" class="sref">DEPTH
/a>]; 
L299" class="line" namn>
L299"> 299
/a>        
a href="+code=Indirect" class="sref">Indirect
/a> *
a href="+code=partial" class="sref">partial
/a>; 
L300" class="line" namn>
L300"> 300
/a>        
a href="+code=block_t" class="sref">block_t
/a> 
a href="+code=nr" class="sref">nr
/a> = 0; 
L301" class="line" namn>
L301"> 301
/a>        int 
a href="+code=n" class="sref">n
/a>; 
L302" class="line" namn>
L302"> 302
/a>        int 
a href="+code=first_whole" class="sref">first_whole
/a>; 
L303" class="line" namn>
L303"> 303
/a>        long 
a href="+code=iblock" class="sref">iblock
/a>; 
L304" class="line" namn>
L304"> 304
/a> 
L305" class="line" namn>
L305"> 305
/a>        
a href="+code=iblock" class="sref">iblock
/a> = (
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_size" class="sref">i_size
/a> + 
a href="+code=sb" class="sref">sb
/a>->
a href="+code=s_blocksize" class="sref">s_blocksize
/a> -1) >> 
a href="+code=sb" class="sref">sb
/a>->
a href="+code=s_blocksize_bits" class="sref">s_blocksize_bits
/a>; 
L306" class="line" namn>
L306"> 306
/a>        
a href="+code=block_truncate_page" class="sref">block_truncate_page
/a>(
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_mapping" class="sref">i_mapping
/a>, 
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_size" class="sref">i_size
/a>, 
a href="+code=get_block" class="sref">get_block
/a>); 
L307" class="line" namn>
L307"> 307
/a> 
L308" class="line" namn>
L308"> 308
/a>        
a href="+code=n" class="sref">n
/a> = 
a href="+code=block_to_path" class="sref">block_to_path
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=iblock" class="sref">iblock
/a>, 
a href="+code=offsets" class="sref">offsets
/a>); 
L309" class="line" namn>
L309"> 309
/a>        if (!
a href="+code=n" class="sref">n
/a>) 
L310" class="line" namn>
L310"> 310
/a>                return; 
L311" class="line" namn>
L311"> 311
/a> 
L312" class="line" namn>
L312"> 312
/a>        if (
a href="+code=n" class="sref">n
/a> == 1) { 
L313" class="line" namn>
L313"> 313
/a>                
a href="+code=free_data" class="sref">free_data
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=idata" class="sref">idata
/a>+
a href="+code=offsets" class="sref">offsets
/a>[0], 
a href="+code=idata" class="sref">idata
/a> + 
a href="+code=DIRECT" class="sref">DIRECT
/a>); 
L314" class="line" namn>
L314"> 314
/a>                
a href="+code=first_whole" class="sref">first_whole
/a> = 0; 
L315" class="line" namn>
L315"> 315
/a>                goto 
a href="+code=do_indirects" class="sref">do_indirects
/a>; 
L316" class="line" namn>
L316"> 316
/a>        } 
L317" class="line" namn>
L317"> 317
/a> 
L318" class="line" namn>
L318"> 318
/a>        
a href="+code=first_whole" class="sref">first_whole
/a> = 
a href="+code=offsets" class="sref">offsets
/a>[0] + 1 - 
a href="+code=DIRECT" class="sref">DIRECT
/a>; 
L319" class="line" namn>
L319"> 319
/a>        
a href="+code=partial" class="sref">partial
/a> = 
a href="+code=find_shared" class="sref">find_shared
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=n" class="sref">n
/a>, 
a href="+code=offsets" class="sref">offsets
/a>, 
a href="+code=chain" class="sref">chain
/a>, &
a href="+code=nr" class="sref">nr
/a>); 
L320" class="line" namn>
L320"> 320
/a>        if (
a href="+code=nr" class="sref">nr
/a>) { 
L321" class="line" namn>
L321"> 321
/a>                if (
a href="+code=partial" class="sref">partial
/a> == 
a href="+code=chain" class="sref">chain
/a>) 
L322" class="line" namn>
L322"> 322
/a>                        
a href="+code=mark_inode_dirty" class="sref">mark_inode_dirty
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L323" class="line" namn>
L323"> 323
/a>                else 
L324" class="line" namn>
L324"> 324
/a>                        
a href="+code=mark_buffer_dirty_inode" class="sref">mark_buffer_dirty_inode
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=inode" class="sref">inode
/a>); 
L325" class="line" namn>
L325"> 325
/a>                
a href="+code=free_branches" class="sref">free_branches
/a>(
a href="+code=inode" class="sref">inode
/a>, &
a href="+code=nr" class="sref">nr
/a>, &
a href="+code=nr" class="sref">nr
/a>+1, (
a href="+code=chain" class="sref">chain
/a>+
a href="+code=n" class="sref">n
/a>-1) - 
a href="+code=partial" class="sref">partial
/a>); 
L326" class="line" namn>
L326"> 326
/a>        } 
L327" class="line" namn>
L327"> 327
/a>        
spa> class="comment">/* Clear the ends of indirect blocks on the shared branch */
/spa>
 
L328" class="line" namn>
L328"> 328
/a>        while (
a href="+code=partial" class="sref">partial
/a> > 
a href="+code=chain" class="sref">chain
/a>) { 
L329" class="line" namn>
L329"> 329
/a>                
a href="+code=free_branches" class="sref">free_branches
/a>(
a href="+code=inode" class="sref">inode
/a>, 
a href="+code=partial" class="sref">partial
/a>->
a href="+code=p" class="sref">p
/a> + 1, 
a href="+code=block_end" class="sref">block_end
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>), 
L330" class="line" namn>
L330"> 330
/a>                                (
a href="+code=chain" class="sref">chain
/a>+
a href="+code=n" class="sref">n
/a>-1) - 
a href="+code=partial" class="sref">partial
/a>); 
L331" class="line" namn>
L331"> 331
/a>                
a href="+code=mark_buffer_dirty_inode" class="sref">mark_buffer_dirty_inode
/a>(
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>, 
a href="+code=inode" class="sref">inode
/a>); 
L332" class="line" namn>
L332"> 332
/a>                
a href="+code=brelse" class="sref">brelse
/a> (
a href="+code=partial" class="sref">partial
/a>->
a href="+code=bh" class="sref">bh
/a>); 
L333" class="line" namn>
L333"> 333
/a>                
a href="+code=partial" class="sref">partial
/a>--; 
L334" class="line" namn>
L334"> 334
/a>        } 
L335" class="line" namn>
L335"> 335
/a>
a href="+code=do_indirects" class="sref">do_indirects
/a>: 
L336" class="line" namn>
L336"> 336
/a>        
spa> class="comment">/* Kill the remaining (whole) subtrees */
/spa>
 
L337" class="line" namn>
L337"> 337
/a>        while (
a href="+code=first_whole" class="sref">first_whole
/a> < 
a href="+code=DEPTH" class="sref">DEPTH
/a>-1) { 
L338" class="line" namn>
L338"> 338
/a>                
a href="+code=nr" class="sref">nr
/a> = 
a href="+code=idata" class="sref">idata
/a>[
a href="+code=DIRECT" class="sref">DIRECT
/a>+
a href="+code=first_whole" class="sref">first_whole
/a>]; 
L339" class="line" namn>
L339"> 339
/a>                if (
a href="+code=nr" class="sref">nr
/a>) { 
L340" class="line" namn>
L340"> 340
/a>                        
a href="+code=idata" class="sref">idata
/a>[
a href="+code=DIRECT" class="sref">DIRECT
/a>+
a href="+code=first_whole" class="sref">first_whole
/a>] = 0; 
L341" class="line" namn>
L341"> 341
/a>                        
a href="+code=mark_inode_dirty" class="sref">mark_inode_dirty
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L342" class="line" namn>
L342"> 342
/a>                        
a href="+code=free_branches" class="sref">free_branches
/a>(
a href="+code=inode" class="sref">inode
/a>, &
a href="+code=nr" class="sref">nr
/a>, &
a href="+code=nr" class="sref">nr
/a>+1, 
a href="+code=first_whole" class="sref">first_whole
/a>+1); 
L343" class="line" namn>
L343"> 343
/a>                } 
L344" class="line" namn>
L344"> 344
/a>                
a href="+code=first_whole" class="sref">first_whole
/a>++; 
L345" class="line" namn>
L345"> 345
/a>        } 
L346" class="line" namn>
L346"> 346
/a>        
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_mtime" class="sref">i_mtime
/a> = 
a href="+code=inode" class="sref">inode
/a>->
a href="+code=i_ctime" class="sref">i_ctime
/a> = 
a href="+code=CURRENT_TIME_SEC" class="sref">CURRENT_TIME_SEC
/a>; 
L347" class="line" namn>
L347"> 347
/a>        
a href="+code=mark_inode_dirty" class="sref">mark_inode_dirty
/a>(
a href="+code=inode" class="sref">inode
/a>); 
L348" class="line" namn>
L348"> 348
/a>} 
L349" class="line" namn>
L349"> 349
/a> 
L350" class="line" namn>
L350"> 350
/a>static 
a href="+code=inline" class="sref">inline
/a> unsigned 
a href="+code=nblocks" class="sref">nblocks
/a>(
a href="+code=loff_t" class="sref">loff_t
/a> 
a href="+code=size" class="sref">size
/a>, struct 
a href="+code=super_block" class="sref">super_block
/a> *
a href="+code=sb" class="sref">sb
/a>) 
L351" class="line" namn>
L351"> 351
/a>{ 
L352" class="line" namn>
L352"> 352
/a>        int 
a href="+code=k" class="sref">k
/a> = 
a href="+code=sb" class="sref">sb
/a>->
a href="+code=s_blocksize_bits" class="sref">s_blocksize_bits
/a> - 10; 
L353" class="line" namn>
L353"> 353
/a>        unsigned 
a href="+code=blocks" class="sref">blocks
/a>, 
a href="+code=res" class="sref">res
/a>, 
a href="+code=direct" class="sref">direct
/a> = 
a href="+code=DIRECT" class="sref">DIRECT
/a>, 
a href="+code=i" class="sref">i
/a> = 
a href="+code=DEPTH" class="sref">DEPTH
/a>; 
L354" class="line" namn>
L354"> 354
/a>        
a href="+code=blocks" class="sref">blocks
/a> = (
a href="+code=size" class="sref">size
/a> + 
a href="+code=sb" class="sref">sb
/a>->
a href="+code=s_blocksize" class="sref">s_blocksize
/a> - 1) >> (
a href="+code=BLOCK_SIZE_BITS" class="sref">BLOCK_SIZE_BITS
/a> + 
a href="+code=k" class="sref">k
/a>); 
L355" class="line" namn>
L355"> 355
/a>        
a href="+code=res" class="sref">res
/a> = 
a href="+code=blocks" class="sref">blocks
/a>; 
L356" class="line" namn>
L356"> 356
/a>        while (--
a href="+code=i" class="sref">i
/a> && 
a href="+code=blocks" class="sref">blocks
/a> > 
a href="+code=direct" class="sref">direct
/a>) { 
Lcode=ref">loff_t
/a>g
a href="a hr-for (
a href="+codss="sref">blocks
/a> > 
a href="+code=blocks" class="sref">blocks/a>); 
L338" class="line" namn>
L33de=ref">loff_t
/a>g
a href="a hr+ int 
a href="+code=k" class="sref">k
/a> = 
a href="+code=sb" class="sref">sb
/a>->
a href="+code/f="+ofref="+code=inode" class="sref">inode
/a>, (
a hre/a>+a> + 
a href="+code=k" class="sref">k3r
/a>; 
L249" class="line" namn>
L249e=ref">loff_t
/a>g
a href="a hr/ int 
a href="+code=k" class="sref">k
/a> = 
a href="+code=sb" class="sref">sb
/a>->
a href="+code/f="+ofref="+code=inode" class="sref">inode
/a>, (
a hre/> + 
a href="+code=k" class="sref">k359
/a> 
L290" class="line" namn>
L29amn>
L355"> 355
/a>       + int 
a href="+coes" class="sref">res
/a> = 
a href="+code=blocks" class="sref">block>++) { 
L261" class="line" namn>
L26res" class="sref">res
/a>, 
a hrefa> + 
a href="+code=k" class="sref">k3
/a>); 
L262"d>
L348" class="line" namn>
L348"> 34/a>) { 
L263" class="line" namn>
L2amn>
L355"> 355
/a>      > + 
a href="+code=k" class="sref">k3

/a>; 
L254" class="line" namn>
L254"> 23
/a>); 


The original LXR software by6 /a> L254" clhttp://source .net/proj"+co/lxr">LXR > L2unik_inod,6 /is exa himn> al version by6 L254" clmailto:lxr@nixux.nocksxr@nixux.noinod. sxr.nixux.no kindly hostar ty> L254" clhttp://www.redpill-nixpro.nockRedpill Lixpro ASinod,6provider Lixux2"> sult sand oa h L3> s services since#L195.