about ext3_readpage

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

 



Hi, all
when I read ext3_readpage function following
ext3_readpage->mpage_readpage->do_mpage_readpage, there are:

nblocks = map_bh->b_size >> blkbits;
        if (buffer_mapped(map_bh) && block_in_file > *first_logical_block &&
                        block_in_file < (*first_logical_block + nblocks)) {
                unsigned map_offset = block_in_file - *first_logical_block;
                unsigned last = nblocks - map_offset;

                for (relative_block = 0; ; relative_block++) {
                        if (relative_block == last) {
                                clear_buffer_mapped(map_bh);
                                break;
                        }
                        if (page_block == blocks_per_page)
                                break;
                        blocks[page_block] = map_bh->b_blocknr + map_offset +
                                                relative_block;
                        page_block++;
                        block_in_file++;
                }
                bdev = map_bh->b_bdev;
        }

Since map_bh->b_size is the size of the block buffer, and blkbits is
associated with the block in inode, why does he do the operation >> ?
And what is the meaning and usage of  first_logical_block? the initial
value of it is 0.

Hope someone will help me!
Thanks!

-- 
National Research Center for Intelligent Computing Systems
Institute of Computing Technology, Chinese Academy of Sciences
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux