Home | History | Annotate | Download | only in ext2

Lines Matching refs:block

2  * The logical block -> physical block routine.
17 block_t block)
31 if (block < index[i].ei_block)
43 /* handle the ext4 extents to get the phsical block number */
46 bmap_extent(struct inode *inode, uint32_t block, size_t *nblocks)
54 leaf = ext4_find_leaf(fs, &PVT(inode)->i_extent_hdr, block);
62 if (block < ext[i].ee_block)
66 printf("ERROR, not find the right block\n");
71 block -= ext[i].ee_block;
72 if (block >= ext[i].ee_len)
77 *nblocks = ext[i].ee_len - block;
79 return start + block;
113 * The actual indirect block map handling - the block passed in should
114 * be relative to the beginning of the particular block hierarchy.
117 bmap_indirect(struct fs_info *fs, uint32_t start, uint32_t block,
132 index = (block >> (levels * addr_shift)) & (addr_count - 1);
140 * Handle the traditional block map, like indirect, double indirect
144 bmap_traditional(struct inode *inode, block_t block, size_t *nblocks)
155 if (block < direct_blocks)
156 return scan_set_nblocks(&PVT(inode)->i_block[block],
157 direct_blocks - block, nblocks);
160 block -= direct_blocks;
161 if (block < indirect_blocks)
163 block, 1, nblocks);
166 block -= indirect_blocks;
167 if (block < double_blocks)
169 block, 2, nblocks);
171 /* triple indirect block */
172 block -= double_blocks;
173 if (block < triple_blocks)
175 block, 3, nblocks);
183 * Map the logical block to physic block where the file data stores.
185 * EXT4 uses a inode flag to mark extent file and indirect block file.
189 * @block: the logical block to be mapped.
191 * @retrun: the physical block number.
194 block_t ext2_bmap(struct inode *inode, block_t block, size_t *nblocks)
199 ret = bmap_extent(inode, block, nblocks);
201 ret = bmap_traditional(inode, block, nblocks);
215 block_t block;
218 block = ext2_bmap(inode, lstart >> blktosec, &nblocks);
220 if (!block)
224 ((sector_t)block << blktosec) | (lstart & blkmask);