blocknumber to index conversion in ext2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am confused about what this below piece of code in function "static
int ext2_block_to_path()" is doing.

 161  }
 162  if (boundary)
 163   *boundary = final - 1 - (i_block & (ptrs - 1));
 164


As per comment it says this:

 103  *      @boundary: set this non-zero if the referred-to block is
likely to be
 104  *             followed (on disk) by an indirect block.

However it appears to be doing the reverse thing.  Consider the
simplest case when I try to lookup 5th block of my file. For it the
values will be

ptrs = 4096/4 = 1024
i_block = 5
final = 12

which results in 6. Note that the block 11 will be followed by an
indirect block and in that case this will return 0.

Of course I am missing something but what ???

-- 
Thanks & Regards,
********************************************
Manish Katiyar ( http://mkatiyar.googlepages.com )
3rd Floor, Fair Winds Block
EGL Software Park
Off Intermediate Ring Road
Bangalore 560071, India
***********************************************

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux