<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi all,</div><div><br></div><div>Sorry to bother.</div><div>for ext2_find_near(), why we tro to find near block by tring priveous block? Why not forward?</div><div><br>
         </div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><br>static ext2_fsblk_t ext2_find_near(struct inode *inode, Indirect *ind)<br>{<br> struct ext2_inode_info *ei = EXT2_I(inode);<br> __le32 *start = ind->bh ? (__le32 *) ind->bh->b_data : ei->i_data;<br> __le32 *p;<br> ext2_fsblk_t bg_start;<br> ext2_fsblk_t colour;<br><br> /* Try to find previous block */<br> for (p = ind->p - 1; p >= start; p--)<br> if (*p)<br> return le32_to_cpu(*p);<br><br> /* No such thing, so let's try location of indirect block */<br> if (ind->bh)<br>
return ind->bh->b_blocknr;<br><br><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><a href="mailto:kernelnewbies@kernelnewbies.org"><br></a></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;">Thank you!<br></div></div></body></html>