diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-08-12 06:49:29 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-08-12 17:13:10 -0400 |
commit | c7298202e5df6fad66c7c8146bf2ed55ba07aff0 (patch) | |
tree | b2aa33f8869ac927af3aa4185cd4fee4f6ac788d /fs/xfs/xfs_format.h | |
parent | 2a3c0acc351baf1e5e584d8d0692f41d5067582c (diff) |
xfs: introduce xfs_rtalloc_defs.h
There are quite a few realtime device definitions shared with
userspace. Move them from xfs_rtalloc.h to xfs_rt_alloc_defs.h
so we don't need to share xfs_rtalloc.h with userspace anymore.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_format.h')
-rw-r--r-- | fs/xfs/xfs_format.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/fs/xfs/xfs_format.h b/fs/xfs/xfs_format.h index 2b4f16668123..62053744a0a6 100644 --- a/fs/xfs/xfs_format.h +++ b/fs/xfs/xfs_format.h | |||
@@ -28,6 +28,47 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* | 30 | /* |
31 | * RealTime Device format definitions | ||
32 | */ | ||
33 | |||
34 | /* Min and max rt extent sizes, specified in bytes */ | ||
35 | #define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */ | ||
36 | #define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */ | ||
37 | #define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */ | ||
38 | |||
39 | #define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize) | ||
40 | #define XFS_BLOCKMASK(mp) ((mp)->m_blockmask) | ||
41 | #define XFS_BLOCKWSIZE(mp) ((mp)->m_blockwsize) | ||
42 | #define XFS_BLOCKWMASK(mp) ((mp)->m_blockwmask) | ||
43 | |||
44 | /* | ||
45 | * RT Summary and bit manipulation macros. | ||
46 | */ | ||
47 | #define XFS_SUMOFFS(mp,ls,bb) ((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb))) | ||
48 | #define XFS_SUMOFFSTOBLOCK(mp,s) \ | ||
49 | (((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog) | ||
50 | #define XFS_SUMPTR(mp,bp,so) \ | ||
51 | ((xfs_suminfo_t *)((bp)->b_addr + \ | ||
52 | (((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp)))) | ||
53 | |||
54 | #define XFS_BITTOBLOCK(mp,bi) ((bi) >> (mp)->m_blkbit_log) | ||
55 | #define XFS_BLOCKTOBIT(mp,bb) ((bb) << (mp)->m_blkbit_log) | ||
56 | #define XFS_BITTOWORD(mp,bi) \ | ||
57 | ((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp))) | ||
58 | |||
59 | #define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b)) | ||
60 | #define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b)) | ||
61 | |||
62 | #define XFS_RTLOBIT(w) xfs_lowbit32(w) | ||
63 | #define XFS_RTHIBIT(w) xfs_highbit32(w) | ||
64 | |||
65 | #if XFS_BIG_BLKNOS | ||
66 | #define XFS_RTBLOCKLOG(b) xfs_highbit64(b) | ||
67 | #else | ||
68 | #define XFS_RTBLOCKLOG(b) xfs_highbit32(b) | ||
69 | #endif | ||
70 | |||
71 | /* | ||
31 | * Dquot and dquot block format definitions | 72 | * Dquot and dquot block format definitions |
32 | */ | 73 | */ |
33 | #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ | 74 | #define XFS_DQUOT_MAGIC 0x4451 /* 'DQ' */ |