aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_trans.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_trans.h')
-rw-r--r--fs/xfs/xfs_trans.h120
1 files changed, 59 insertions, 61 deletions
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h
index 0f333fba187c..6381669a34ac 100644
--- a/fs/xfs/xfs_trans.h
+++ b/fs/xfs/xfs_trans.h
@@ -234,68 +234,67 @@ typedef struct xfs_log_item_chunk {
234 * lic_unused to the right value (0 matches all free). The 234 * lic_unused to the right value (0 matches all free). The
235 * lic_descs.lid_index values are set up as each desc is allocated. 235 * lic_descs.lid_index values are set up as each desc is allocated.
236 */ 236 */
237#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT)
238void xfs_lic_init(xfs_log_item_chunk_t *cp);
239#define XFS_LIC_INIT(cp) xfs_lic_init(cp) 237#define XFS_LIC_INIT(cp) xfs_lic_init(cp)
240#else 238static inline void xfs_lic_init(xfs_log_item_chunk_t *cp)
241#define XFS_LIC_INIT(cp) ((cp)->lic_free = XFS_LIC_FREEMASK) 239{
242#endif 240 cp->lic_free = XFS_LIC_FREEMASK;
243#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_INIT_SLOT) 241}
244void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot); 242
245#define XFS_LIC_INIT_SLOT(cp,slot) xfs_lic_init_slot(cp, slot) 243#define XFS_LIC_INIT_SLOT(cp,slot) xfs_lic_init_slot(cp, slot)
246#else 244static inline void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot)
247#define XFS_LIC_INIT_SLOT(cp,slot) \ 245{
248 ((cp)->lic_descs[slot].lid_index = (unsigned char)(slot)) 246 cp->lic_descs[slot].lid_index = (unsigned char)(slot);
249#endif 247}
250#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_VACANCY) 248
251int xfs_lic_vacancy(xfs_log_item_chunk_t *cp);
252#define XFS_LIC_VACANCY(cp) xfs_lic_vacancy(cp) 249#define XFS_LIC_VACANCY(cp) xfs_lic_vacancy(cp)
253#else 250static inline int xfs_lic_vacancy(xfs_log_item_chunk_t *cp)
254#define XFS_LIC_VACANCY(cp) (((cp)->lic_free) & XFS_LIC_FREEMASK) 251{
255#endif 252 return cp->lic_free & XFS_LIC_FREEMASK;
256#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ALL_FREE) 253}
257void xfs_lic_all_free(xfs_log_item_chunk_t *cp); 254
258#define XFS_LIC_ALL_FREE(cp) xfs_lic_all_free(cp) 255#define XFS_LIC_ALL_FREE(cp) xfs_lic_all_free(cp)
259#else 256static inline void xfs_lic_all_free(xfs_log_item_chunk_t *cp)
260#define XFS_LIC_ALL_FREE(cp) ((cp)->lic_free = XFS_LIC_FREEMASK) 257{
261#endif 258 cp->lic_free = XFS_LIC_FREEMASK;
262#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ARE_ALL_FREE) 259}
263int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp); 260
264#define XFS_LIC_ARE_ALL_FREE(cp) xfs_lic_are_all_free(cp) 261#define XFS_LIC_ARE_ALL_FREE(cp) xfs_lic_are_all_free(cp)
265#else 262static inline int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp)
266#define XFS_LIC_ARE_ALL_FREE(cp) (((cp)->lic_free & XFS_LIC_FREEMASK) ==\ 263{
267 XFS_LIC_FREEMASK) 264 return ((cp->lic_free & XFS_LIC_FREEMASK) == XFS_LIC_FREEMASK);
268#endif 265}
269#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_ISFREE) 266
270int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot);
271#define XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot) 267#define XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot)
272#else 268static inline int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot)
273#define XFS_LIC_ISFREE(cp,slot) ((cp)->lic_free & (1 << (slot))) 269{
274#endif 270 return (cp->lic_free & (1 << slot));
275#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_CLAIM) 271}
276void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot); 272
277#define XFS_LIC_CLAIM(cp,slot) xfs_lic_claim(cp,slot) 273#define XFS_LIC_CLAIM(cp,slot) xfs_lic_claim(cp,slot)
278#else 274static inline void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot)
279#define XFS_LIC_CLAIM(cp,slot) ((cp)->lic_free &= ~(1 << (slot))) 275{
280#endif 276 cp->lic_free &= ~(1 << slot);
281#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_RELSE) 277}
282void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot); 278
283#define XFS_LIC_RELSE(cp,slot) xfs_lic_relse(cp,slot) 279#define XFS_LIC_RELSE(cp,slot) xfs_lic_relse(cp,slot)
284#else 280static inline void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot)
285#define XFS_LIC_RELSE(cp,slot) ((cp)->lic_free |= 1 << (slot)) 281{
286#endif 282 cp->lic_free |= 1 << slot;
287#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_SLOT) 283}
288xfs_log_item_desc_t *xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot); 284
289#define XFS_LIC_SLOT(cp,slot) xfs_lic_slot(cp,slot) 285#define XFS_LIC_SLOT(cp,slot) xfs_lic_slot(cp,slot)
290#else 286static inline xfs_log_item_desc_t *
291#define XFS_LIC_SLOT(cp,slot) (&((cp)->lic_descs[slot])) 287xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot)
292#endif 288{
293#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_SLOT) 289 return &(cp->lic_descs[slot]);
294int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp); 290}
291
295#define XFS_LIC_DESC_TO_SLOT(dp) xfs_lic_desc_to_slot(dp) 292#define XFS_LIC_DESC_TO_SLOT(dp) xfs_lic_desc_to_slot(dp)
296#else 293static inline int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp)
297#define XFS_LIC_DESC_TO_SLOT(dp) ((uint)((dp)->lid_index)) 294{
298#endif 295 return (uint)dp->lid_index;
296}
297
299/* 298/*
300 * Calculate the address of a chunk given a descriptor pointer: 299 * Calculate the address of a chunk given a descriptor pointer:
301 * dp - dp->lid_index give the address of the start of the lic_descs array. 300 * dp - dp->lid_index give the address of the start of the lic_descs array.
@@ -303,15 +302,14 @@ int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp);
303 * All of this yields the address of the chunk, which is 302 * All of this yields the address of the chunk, which is
304 * cast to a chunk pointer. 303 * cast to a chunk pointer.
305 */ 304 */
306#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_LIC_DESC_TO_CHUNK)
307xfs_log_item_chunk_t *xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp);
308#define XFS_LIC_DESC_TO_CHUNK(dp) xfs_lic_desc_to_chunk(dp) 305#define XFS_LIC_DESC_TO_CHUNK(dp) xfs_lic_desc_to_chunk(dp)
309#else 306static inline xfs_log_item_chunk_t *
310#define XFS_LIC_DESC_TO_CHUNK(dp) ((xfs_log_item_chunk_t*) \ 307xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp)
311 (((xfs_caddr_t)((dp) - (dp)->lid_index)) -\ 308{
312 (xfs_caddr_t)(((xfs_log_item_chunk_t*) \ 309 return (xfs_log_item_chunk_t*) \
313 0)->lic_descs))) 310 (((xfs_caddr_t)((dp) - (dp)->lid_index)) - \
314#endif 311 (xfs_caddr_t)(((xfs_log_item_chunk_t*)0)->lic_descs));
312}
315 313
316#ifdef __KERNEL__ 314#ifdef __KERNEL__
317/* 315/*
@@ -328,7 +326,7 @@ typedef struct xfs_log_busy_slot {
328#define XFS_LBC_NUM_SLOTS 31 326#define XFS_LBC_NUM_SLOTS 31
329typedef struct xfs_log_busy_chunk { 327typedef struct xfs_log_busy_chunk {
330 struct xfs_log_busy_chunk *lbc_next; 328 struct xfs_log_busy_chunk *lbc_next;
331 uint lbc_free; /* bitmask of free slots */ 329 uint lbc_free; /* free slots bitmask */
332 ushort lbc_unused; /* first unused */ 330 ushort lbc_unused; /* first unused */
333 xfs_log_busy_slot_t lbc_busy[XFS_LBC_NUM_SLOTS]; 331 xfs_log_busy_slot_t lbc_busy[XFS_LBC_NUM_SLOTS];
334} xfs_log_busy_chunk_t; 332} xfs_log_busy_chunk_t;