diff options
Diffstat (limited to 'fs/xfs/xfs_rtalloc.h')
-rw-r--r-- | fs/xfs/xfs_rtalloc.h | 53 |
1 files changed, 2 insertions, 51 deletions
diff --git a/fs/xfs/xfs_rtalloc.h b/fs/xfs/xfs_rtalloc.h index f7f3a359c1c5..b2a1a24c0e2f 100644 --- a/fs/xfs/xfs_rtalloc.h +++ b/fs/xfs/xfs_rtalloc.h | |||
@@ -18,58 +18,11 @@ | |||
18 | #ifndef __XFS_RTALLOC_H__ | 18 | #ifndef __XFS_RTALLOC_H__ |
19 | #define __XFS_RTALLOC_H__ | 19 | #define __XFS_RTALLOC_H__ |
20 | 20 | ||
21 | /* kernel only definitions and functions */ | ||
22 | |||
21 | struct xfs_mount; | 23 | struct xfs_mount; |
22 | struct xfs_trans; | 24 | struct xfs_trans; |
23 | 25 | ||
24 | /* Min and max rt extent sizes, specified in bytes */ | ||
25 | #define XFS_MAX_RTEXTSIZE (1024 * 1024 * 1024) /* 1GB */ | ||
26 | #define XFS_DFL_RTEXTSIZE (64 * 1024) /* 64kB */ | ||
27 | #define XFS_MIN_RTEXTSIZE (4 * 1024) /* 4kB */ | ||
28 | |||
29 | /* | ||
30 | * Constants for bit manipulations. | ||
31 | */ | ||
32 | #define XFS_NBBYLOG 3 /* log2(NBBY) */ | ||
33 | #define XFS_WORDLOG 2 /* log2(sizeof(xfs_rtword_t)) */ | ||
34 | #define XFS_NBWORDLOG (XFS_NBBYLOG + XFS_WORDLOG) | ||
35 | #define XFS_NBWORD (1 << XFS_NBWORDLOG) | ||
36 | #define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1) | ||
37 | |||
38 | #define XFS_BLOCKSIZE(mp) ((mp)->m_sb.sb_blocksize) | ||
39 | #define XFS_BLOCKMASK(mp) ((mp)->m_blockmask) | ||
40 | #define XFS_BLOCKWSIZE(mp) ((mp)->m_blockwsize) | ||
41 | #define XFS_BLOCKWMASK(mp) ((mp)->m_blockwmask) | ||
42 | |||
43 | /* | ||
44 | * Summary and bit manipulation macros. | ||
45 | */ | ||
46 | #define XFS_SUMOFFS(mp,ls,bb) ((int)((ls) * (mp)->m_sb.sb_rbmblocks + (bb))) | ||
47 | #define XFS_SUMOFFSTOBLOCK(mp,s) \ | ||
48 | (((s) * (uint)sizeof(xfs_suminfo_t)) >> (mp)->m_sb.sb_blocklog) | ||
49 | #define XFS_SUMPTR(mp,bp,so) \ | ||
50 | ((xfs_suminfo_t *)((bp)->b_addr + \ | ||
51 | (((so) * (uint)sizeof(xfs_suminfo_t)) & XFS_BLOCKMASK(mp)))) | ||
52 | |||
53 | #define XFS_BITTOBLOCK(mp,bi) ((bi) >> (mp)->m_blkbit_log) | ||
54 | #define XFS_BLOCKTOBIT(mp,bb) ((bb) << (mp)->m_blkbit_log) | ||
55 | #define XFS_BITTOWORD(mp,bi) \ | ||
56 | ((int)(((bi) >> XFS_NBWORDLOG) & XFS_BLOCKWMASK(mp))) | ||
57 | |||
58 | #define XFS_RTMIN(a,b) ((a) < (b) ? (a) : (b)) | ||
59 | #define XFS_RTMAX(a,b) ((a) > (b) ? (a) : (b)) | ||
60 | |||
61 | #define XFS_RTLOBIT(w) xfs_lowbit32(w) | ||
62 | #define XFS_RTHIBIT(w) xfs_highbit32(w) | ||
63 | |||
64 | #if XFS_BIG_BLKNOS | ||
65 | #define XFS_RTBLOCKLOG(b) xfs_highbit64(b) | ||
66 | #else | ||
67 | #define XFS_RTBLOCKLOG(b) xfs_highbit32(b) | ||
68 | #endif | ||
69 | |||
70 | |||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | #ifdef CONFIG_XFS_RT | 26 | #ifdef CONFIG_XFS_RT |
74 | /* | 27 | /* |
75 | * Function prototypes for exported functions. | 28 | * Function prototypes for exported functions. |
@@ -161,6 +114,4 @@ xfs_rtmount_init( | |||
161 | # define xfs_rtunmount_inodes(m) | 114 | # define xfs_rtunmount_inodes(m) |
162 | #endif /* CONFIG_XFS_RT */ | 115 | #endif /* CONFIG_XFS_RT */ |
163 | 116 | ||
164 | #endif /* __KERNEL__ */ | ||
165 | |||
166 | #endif /* __XFS_RTALLOC_H__ */ | 117 | #endif /* __XFS_RTALLOC_H__ */ |