.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "EXT2_GET_BRANCH" "9" "09 October 2005" "" ""
.SH NAME
ext2_get_branch \- read the chain of indirect blocks leading to data
.SH SYNOPSIS
"SYNOPSIS"
.sp
\fB
.sp
Indirect * ext2_get_branch (struct inode * \fIinode\fB, int \fIdepth\fB, int * \fIoffsets\fB, Indirect \fIchain[4]\fB, int * \fIerr\fB);
\fR
.SH "ARGUMENTS"
.TP
\fB\fIinode\fB\fR
inode in question
.TP
\fB\fIdepth\fB\fR
depth of the chain (1 - direct pointer, etc.)
.TP
\fB\fIoffsets\fB\fR
offsets of pointers in inode/indirect blocks
.TP
\fB\fIchain[4]\fB\fR
place to store the result
.TP
\fB\fIerr\fB\fR
here we store the error value
.SH "DESCRIPTION"
.PP
Function fills the array of triples and returns NULL
if everything went OK or the pointer to the last filled triple
(incomplete one) otherwise. Upon the return chain[i].key contains
the number of (i+1)-th block in the chain (as it is stored in memory,
i.e. little-endian 32-bit), chain[i].p contains the address of that
number (it points into struct inode for i==0 and into the bh->b_data
for i>0) and chain[i].bh points to the buffer_head of i-th indirect
block for i>0 and NULL for i==0. In other words, it holds the block
numbers of the chain, addresses they were taken from (and where we can
verify that chain did not change) and buffer_heads hosting these
numbers.
.PP
Function stops when it stumbles upon zero pointer (absent block)
(pointer to last triple returned, *\fIerr\fR == 0)
or when it gets an IO error reading an indirect block
(ditto, *\fIerr\fR == -EIO)
or when it notices that chain had been changed while it was reading
(ditto, *\fIerr\fR == -EAGAIN)
or when it reads all \fIdepth\fR-1 indirect blocks successfully and finds
the whole chain, all way to the data (returns NULL, *err == 0).