File: [Development] / xfs-linux / xfs_sb.h (download)
Revision 1.7, Fri Dec 10 00:22:31 1993 UTC (23 years, 10 months ago) by ajs
Branch: MAIN
Changes since 1.6: +10 -4
lines
Change counters to more counter-like types.
|
#ifndef _FS_XFS_SB_H
#define _FS_XFS_SB_H
#ident "$Revision: 1.6 $"
/*
* Super block
*/
#define XFS_SB_MAGIC 0x58465342 /* 'XFSB' */
#define XFS_SB_VERSION 1
typedef struct xfs_sb
{
uuid_t sb_uuid; /* file system unique id */
xfs_fsblock_t sb_dblocks; /* number of data blocks */
__uint32_t sb_blocksize; /* logical block size, bytes */
/*
* sb_magic is at offset 28 to be at the same location as fs_magic
* in an EFS filesystem, thus ensuring there is no confusion.
*/
__uint32_t sb_magicnum; /* magic number == XFS_SB_MAGIC */
xfs_fsblock_t sb_rblocks; /* number of realtime blocks */
xfs_fsblock_t sb_rbitmap; /* bitmap for realtime blocks */
xfs_fsblock_t sb_rsummary; /* summary for xfs_rbitmap */
xfs_ino_t sb_rootino; /* root inode number */
xfs_agblock_t sb_rextsize; /* realtime extent size, blocks */
xfs_agblock_t sb_agblocks; /* size of an allocation group */
xfs_agnumber_t sb_agcount; /* number of allocation groups */
__uint16_t sb_versionnum; /* header version == XFS_SB_VERSION */
__uint16_t sb_sectsize; /* volume sector size, bytes */
__uint16_t sb_inodesize; /* inode size, bytes */
__uint16_t sb_inopblock; /* inodes per block */
char sb_fname[6]; /* file system name */
char sb_fpack[6]; /* file system pack name */
__uint8_t sb_blocklog; /* log2 of xfs_blocksize */
__uint8_t sb_sectlog; /* log2 of xfs_sectsize */
__uint8_t sb_inodelog; /* log2 of xfs_inodesize */
__uint8_t sb_inopblog; /* log2 of xfs_inopblock */
__uint8_t sb_smallfiles; /* set if small files in inodes */
/* other inode config information? */
/* statistics */
/*
* These fields must remain contiguous. If you really
* want to change their layout, make sure you fix the
* code in xfs_trans_apply_sb_deltas().
*/
__uint64_t sb_icount; /* allocated inodes */
__uint64_t sb_ifree; /* free inodes */
__uint64_t sb_fdblocks; /* free data blocks */
__uint32_t sb_frextents; /* free realtime extents */
} xfs_sb_t;
#define XFS_SB_UUID 0x0000001
#define XFS_SB_DBLOCKS 0x0000002
#define XFS_SB_BLOCKSIZE 0x0000004
#define XFS_SB_MAGICNUM 0x0000008
#define XFS_SB_RBLOCKS 0x0000010
#define XFS_SB_RBITMAP 0x0000020
#define XFS_SB_RSUMMARY 0x0000040
#define XFS_SB_ROOTINO 0x0000080
#define XFS_SB_REXTSIZE 0x0000100
#define XFS_SB_AGBLOCKS 0x0000200
#define XFS_SB_AGCOUNT 0x0000400
#define XFS_SB_VERSIONNUM 0x0000800
#define XFS_SB_SECTSIZE 0x0001000
#define XFS_SB_INODESIZE 0x0002000
#define XFS_SB_INOPBLOCK 0x0004000
#define XFS_SB_FNAME 0x0008000
#define XFS_SB_FPACK 0x0010000
#define XFS_SB_BLOCKLOG 0x0020000
#define XFS_SB_SECTLOG 0x0040000
#define XFS_SB_INODELOG 0x0080000
#define XFS_SB_INOPBLOG 0x0100000
#define XFS_SB_SMALLFILES 0x0200000
#define XFS_SB_ICOUNT 0x0400000
#define XFS_SB_IFREE 0x0800000
#define XFS_SB_FDBLOCKS 0x1000000
#define XFS_SB_FREXTENTS 0x2000000
#define XFS_SB_NUM_BITS 26
#define XFS_SB_ALL_BITS ((1 << XFS_SB_NUM_BITS) - 1)
#define XFS_SB_DADDR ((daddr_t)0) /* daddr in filesystem */
#define XFS_SB_FSB ((xfs_fsblock_t)0) /* fsblock in filesystem */
#define XFS_SB_BLOCK ((xfs_agblock_t)0) /* block number in the AG */
#define xfs_daddr_to_fsb(s,d) \
((xfs_fsblock_t)((d) >> ((s)->sb_blocklog - BBSHIFT)))
#define xfs_fsb_to_daddr(s,fsbno) \
((daddr_t)((fsbno) << ((s)->sb_blocklog - BBSHIFT)))
#define xfs_btod(s,l) ((l) << ((s)->sb_blocklog - BBSHIFT))
#define xfs_dtobt(s,l) ((l) >> ((s)->sb_blocklog - BBSHIFT))
#define xfs_buf_to_sbp(buf) ((xfs_sb_t *)(buf)->b_un.b_addr)
#endif /* !_FS_XFS_SB_H */