Skip to contentSkip to conversation

get_block

DISCUSSION Alberich de megres 2 participants 2 messages May 18, 2009 VFS

lore
Share & tools
lore
#0 lore raw

Hi!

Again, i got another question this time is about get_block function used on "mpage_writepages" for address_space_operations writepage.

It is supposed to map the number of blocks passed in sector_t iblock parameter? or it is asking for the block number iblock?

thanks!!

#1 lore raw
Quoted 9 lines · Alberich de megres

Hi!

Again, i got another question this time is about get_block function used on "mpage_writepages" for address_space_operations writepage.

It is supposed to map the number of blocks passed in sector_t iblock parameter? or it is asking for the block number iblock?

thanks!!

iblock is the relative block # in the inode that you want to map. Whatever you set as bh_result->b_size is how much will be mapped, so its usually something like

bh_result->b_size = num_of_blocks_we_want << inode->i_blkbits;

Hope that helps,

Josef