EXT3_BLOCK_TO_PATH

Section: ()
Updated: 06 October 2005
Index Return to Main Contents

 

NAME

ext3_block_to_path - parse the block number into array of offsets  

SYNOPSIS

"SYNOPSIS"

int ext3_block_to_path (struct inode * inode, long i_block, int * offsets, int * boundary);  

ARGUMENTS

inode
inode in question (we are only interested in its superblock)
i_block
block number to be parsed
offsets
array to store the offsets in
boundary
set this non-zero if the referred-to block is likely to be followed (on disk) by an indirect block.
 

DESCRIPTION

To store the locations of file's data ext3 uses a data structure common for UNIX filesystems - tree of pointers anchored in the inode, with data blocks at leaves and indirect blocks in intermediate nodes. This function translates the block number into path in that tree - return value is the path length and offsets[n] is the offset of pointer to (n+1)th node in the nth one. If block is out of range (negative or too large) warning is printed and zero returned.  

NOTE

function doesn't find node addresses, so no IO is needed. All we need to know is the capacity of indirect blocks (taken from the inode->i_sb).


 

Index

NAME
SYNOPSIS
ARGUMENTS
DESCRIPTION
NOTE

This document was created by man2html, using the manual pages.
Time: 04:40:44 GMT, October 06, 2005