public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* Conversion Routine Help
@ 2011-12-29 14:12 Vijay Chauhan
  2011-12-29 16:44 ` Amit Sahrawat
  2011-12-29 21:54 ` Dave Chinner
  0 siblings, 2 replies; 4+ messages in thread
From: Vijay Chauhan @ 2011-12-29 14:12 UTC (permalink / raw)
  To: xfs

Hi list,

Can anyone please provide me links about the basic explanations of XFS
basic blocks and filesystem logical block mapping and conversion
routines?

I tried to understand from code but its not clear to me:
#define XFS_FSB_TO_BB(mp,fsbno) ((fsbno) << (mp)->m_blkbb_log)
#define XFS_BB_TO_FSB(mp,bb)    \
       (((bb) + (XFS_FSB_TO_BB(mp,1) - 1)) >> (mp)->m_blkbb_log)
#define XFS_BB_TO_FSBT(mp,bb)   ((bb) >> (mp)->m_blkbb_log)
#define XFS_BB_FSB_OFFSET(mp,bb) ((bb) & ((mp)->m_bsize - 1))

lets consider the last one:
#define XFS_BB_FSB_OFFSET(mp,bb) ((bb) & ((mp)->m_bsize - 1))

if basic block (512 byte size) number is 7 and m_bsize is 12
(considering FS block size 4096), then this will return 3 [e.g. ( 7 &
11) ]. then what does 3 means here? what offset value it is denoting?

Thanks in advance.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-04  7:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-29 14:12 Conversion Routine Help Vijay Chauhan
2011-12-29 16:44 ` Amit Sahrawat
2011-12-29 21:54 ` Dave Chinner
2012-01-04  7:56   ` Vijay Chauhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox