aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_da_btree.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-11-01 22:38:42 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 22:38:42 -0500
commita844f4510dce23c07f3923cb42138f5fdd745017 (patch)
treeffb37e9e60f02d5e92bd69bb53b568e1c991c17f /fs/xfs/xfs_da_btree.h
parent61c1e689fbde7cb50a76262bba190715d86beab6 (diff)
[XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot.
SGI-PV: 943122 SGI-Modid: xfs-linux:xfs-kern:23901a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_da_btree.h')
-rw-r--r--fs/xfs/xfs_da_btree.h68
1 files changed, 10 insertions, 58 deletions
diff --git a/fs/xfs/xfs_da_btree.h b/fs/xfs/xfs_da_btree.h
index a2199578b4c0..654956e9787c 100644
--- a/fs/xfs/xfs_da_btree.h
+++ b/fs/xfs/xfs_da_btree.h
@@ -92,72 +92,24 @@ typedef struct xfs_da_node_entry xfs_da_node_entry_t;
92 92
93#define XFS_DA_MAXHASH ((xfs_dahash_t)-1) /* largest valid hash value */ 93#define XFS_DA_MAXHASH ((xfs_dahash_t)-1) /* largest valid hash value */
94 94
95/* 95#define XFS_LBSIZE(mp) (mp)->m_sb.sb_blocksize
96 * Macros used by directory code to interface to the filesystem. 96#define XFS_LBLOG(mp) (mp)->m_sb.sb_blocklog
97 */
98#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBSIZE)
99int xfs_lbsize(struct xfs_mount *mp);
100#define XFS_LBSIZE(mp) xfs_lbsize(mp)
101#else
102#define XFS_LBSIZE(mp) ((mp)->m_sb.sb_blocksize)
103#endif
104#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LBLOG)
105int xfs_lblog(struct xfs_mount *mp);
106#define XFS_LBLOG(mp) xfs_lblog(mp)
107#else
108#define XFS_LBLOG(mp) ((mp)->m_sb.sb_blocklog)
109#endif
110
111/*
112 * Macros used by directory code to interface to the kernel
113 */
114 97
115/*
116 * Macros used to manipulate directory off_t's
117 */
118#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_BNOENTRY)
119__uint32_t xfs_da_make_bnoentry(struct xfs_mount *mp, xfs_dablk_t bno,
120 int entry);
121#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \ 98#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \
122 xfs_da_make_bnoentry(mp,bno,entry)
123#else
124#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \
125 (((bno) << (mp)->m_dircook_elog) | (entry)) 99 (((bno) << (mp)->m_dircook_elog) | (entry))
126#endif
127#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_MAKE_COOKIE)
128xfs_off_t xfs_da_make_cookie(struct xfs_mount *mp, xfs_dablk_t bno, int entry,
129 xfs_dahash_t hash);
130#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \ 100#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \
131 xfs_da_make_cookie(mp,bno,entry,hash)
132#else
133#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \
134 (((xfs_off_t)XFS_DA_MAKE_BNOENTRY(mp, bno, entry) << 32) | (hash)) 101 (((xfs_off_t)XFS_DA_MAKE_BNOENTRY(mp, bno, entry) << 32) | (hash))
135#endif 102#define XFS_DA_COOKIE_HASH(mp,cookie) ((xfs_dahash_t)cookie)
136#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_HASH) 103#define XFS_DA_COOKIE_BNO(mp,cookie) \
137xfs_dahash_t xfs_da_cookie_hash(struct xfs_mount *mp, xfs_off_t cookie); 104 ((((xfs_off_t)(cookie) >> 31) == -1LL ? \
138#define XFS_DA_COOKIE_HASH(mp,cookie) xfs_da_cookie_hash(mp,cookie)
139#else
140#define XFS_DA_COOKIE_HASH(mp,cookie) ((xfs_dahash_t)(cookie))
141#endif
142#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_BNO)
143xfs_dablk_t xfs_da_cookie_bno(struct xfs_mount *mp, xfs_off_t cookie);
144#define XFS_DA_COOKIE_BNO(mp,cookie) xfs_da_cookie_bno(mp,cookie)
145#else
146#define XFS_DA_COOKIE_BNO(mp,cookie) \
147 (((xfs_off_t)(cookie) >> 31) == -1LL ? \
148 (xfs_dablk_t)0 : \ 105 (xfs_dablk_t)0 : \
149 (xfs_dablk_t)((xfs_off_t)(cookie) >> ((mp)->m_dircook_elog + 32))) 106 (xfs_dablk_t)((xfs_off_t)(cookie) >> \
150#endif 107 ((mp)->m_dircook_elog + 32))))
151#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DA_COOKIE_ENTRY) 108#define XFS_DA_COOKIE_ENTRY(mp,cookie) \
152int xfs_da_cookie_entry(struct xfs_mount *mp, xfs_off_t cookie); 109 ((((xfs_off_t)(cookie) >> 31) == -1LL ? \
153#define XFS_DA_COOKIE_ENTRY(mp,cookie) xfs_da_cookie_entry(mp,cookie)
154#else
155#define XFS_DA_COOKIE_ENTRY(mp,cookie) \
156 (((xfs_off_t)(cookie) >> 31) == -1LL ? \
157 (xfs_dablk_t)0 : \ 110 (xfs_dablk_t)0 : \
158 (xfs_dablk_t)(((xfs_off_t)(cookie) >> 32) & \ 111 (xfs_dablk_t)(((xfs_off_t)(cookie) >> 32) & \
159 ((1 << (mp)->m_dircook_elog) - 1))) 112 ((1 << (mp)->m_dircook_elog) - 1))))
160#endif
161 113
162 114
163/*======================================================================== 115/*========================================================================