<div dir="ltr">I was able to resolve the issue. This was indeed related to conversion between FSB to actual data block in image file. I would like to thanks Dave for showing the direction. <div>So to summarize the extent data (128 bits, format =2) gives absolute block number which is in term of XFS file system block this need to be converted into actual disk block.</div>
<div><br></div><div>I've used two macros for it.</div><div>1. <span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">#define </span><a href="http://lxr.free-electrons.com/ident?i=XFS_FSB_TO_AGNO" style="border-bottom-style:dotted;border-bottom-width:1px;font-size:14px;text-decoration:none;font-family:Monaco,'Courier New',Courier,monospace;font-weight:bold;border-bottom-color:rgb(153,153,153)" target="_blank">XFS_FSB_TO_AGNO</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">(mp,fsbno)</span><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold"> </span></div>
<div><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">2.#define </span><a href="http://lxr.free-electrons.com/ident?i=XFS_FSB_TO_AGBNO" style="border-bottom-style:dotted;border-bottom-width:1px;font-size:14px;text-decoration:none;font-family:Monaco,'Courier New',Courier,monospace;font-weight:bold;border-bottom-color:rgb(153,153,153)" target="_blank">XFS_FSB_TO_AGBNO</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">(mp,fsbno).</span></div>
<div><br></div><div>First one give the actual AG number and the second one gives the block number in that AG.</div><div><br></div><div>Now coming back to my previous example which I posted</div><div>My extent data was.</div>
<div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"> 00 00 00 00 00 00 00 00 00 00 00 04 99 80 00 01 (LSB)</span><br></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">After unpacking, absolute block number = 9420 (0x24cc).</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Converting to actual data block using above two macros gives me AG No. = 1, AG Block No = 1228. So final block (1*6400 + 1228 = 7628) which is correct.(I was able to get correct file contents)</span></div>
<div><font face="arial, sans-serif">Please let me know if above computation is correct. It seems correct to me as I'm able to retrieve all the files.</font></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">Still I couldn't get two macros.</span></div><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px">1. </span><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">#define </span><a href="http://lxr.free-electrons.com/ident?i=XFS_FSS_TO_BB" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">XFS_FSS_TO_BB</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">(mp,</span><a href="http://lxr.free-electrons.com/ident?i=sec" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">sec</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">) ((</span><a href="http://lxr.free-electrons.com/ident?i=sec" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">sec</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">) << (mp)->m_sectbb_log).</span></div>
<div><font color="#787878" face="Monaco, Courier New, Courier, monospace"><b>2. </b></font><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">#define </span><a href="http://lxr.free-electrons.com/ident?i=XFS_BB_TO_FSBT" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">XFS_BB_TO_FSBT</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">(mp,</span><a href="http://lxr.free-electrons.com/ident?i=bb" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">bb</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">) ((</span><a href="http://lxr.free-electrons.com/ident?i=bb" style="font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold;text-decoration:none;border-bottom-width:1px;border-bottom-style:dotted;border-bottom-color:rgb(153,153,153);color:black">bb</a><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold">) >> (mp)->m_blkbb_log).</span></div>
<div><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold"><br></span></div><div>I couldn't find m_sectbb_log and m_blkbb_log fields. Please someone share more knowledge on above </div>
<div>macros like where they are used and also description of input and output field</div><div><br></div><div>Thanks and Regards,</div><div>Pradeep</div><div><br></div><div><span style="color:rgb(120,120,120);font-family:Monaco,'Courier New',Courier,monospace;font-size:14px;font-weight:bold"><br>
</span></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 22 October 2013 10:08, Pradeep Kumar <span dir="ltr"><<a href="mailto:praks411@gmail.com" target="_blank">praks411@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Dave,<div><br><div>Thanks for the reply. I think I may get my solution. Can you explain the difference between the two?</div>
<div>I've created sample xfs file using mkfs.xfs with mostly default parameter </div>
<div>1. Sector Size = 512</div><div>2. Block size = 4096</div><div>3. AG Number = 2</div><div>4. Number of blocks per AG = 6400.</div><div><br></div><div>So when I get absolute block 9420 from file extent data I'm going to (6400 + 3020) , 3020 block of second AG which is wrong. The file start from 7628 absolute block or (6400 + 1228), 1228 block of second AG. </div>
<div>Please describe in some detail above the conversion which you are talking about.</div><div><br></div><div>Thanks and Regards,</div><div>Pradeep</div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">
On 22 October 2013 02:12, Dave Chinner <span dir="ltr"><<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>On Tue, Oct 22, 2013 at 01:32:22AM +0200, Pradeep Kumar wrote:<br>
> Hi,<br>
><br>
> I'm writing a small utility to parse XFS fs image on windows.<br>
> I'm able to fetch the files in the first AG (0).<br>
> However when it comes to the files which are in different AG I'm facing<br>
> some problem in parsing extent bmap 128bits data of file inode (format ==<br>
> 2).<br>
<br>
</div>Extents use filesystem block encodings, not disk addresses. Look up<br>
the macros XFS_DADDR_TO_FSB and XFS_FSB_TO_DADDR.<br>
<br>
Cheers,<br>
<br>
Dave.<br>
<span><font color="#888888">--<br>
Dave Chinner<br>
<a href="mailto:david@fromorbit.com" target="_blank">david@fromorbit.com</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>