diff options
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index 1a1d452f15f9..eb7fdc6ebc32 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
@@ -335,18 +335,66 @@ typedef __uint32_t xlog_tid_t; | |||
335 | 335 | ||
336 | #define XLOG_COVER_OPS 5 | 336 | #define XLOG_COVER_OPS 5 |
337 | 337 | ||
338 | |||
339 | /* Ticket reservation region accounting */ | ||
340 | #if defined(XFS_LOG_RES_DEBUG) | ||
341 | #define XLOG_TIC_LEN_MAX 15 | ||
342 | #define XLOG_TIC_RESET_RES(t) ((t)->t_res_num = \ | ||
343 | (t)->t_res_arr_sum = (t)->t_res_num_ophdrs = 0) | ||
344 | #define XLOG_TIC_ADD_OPHDR(t) ((t)->t_res_num_ophdrs++) | ||
345 | #define XLOG_TIC_ADD_REGION(t, len, type) \ | ||
346 | do { \ | ||
347 | if ((t)->t_res_num == XLOG_TIC_LEN_MAX) { \ | ||
348 | /* add to overflow and start again */ \ | ||
349 | (t)->t_res_o_flow += (t)->t_res_arr_sum; \ | ||
350 | (t)->t_res_num = 0; \ | ||
351 | (t)->t_res_arr_sum = 0; \ | ||
352 | } \ | ||
353 | (t)->t_res_arr[(t)->t_res_num].r_len = (len); \ | ||
354 | (t)->t_res_arr[(t)->t_res_num].r_type = (type); \ | ||
355 | (t)->t_res_arr_sum += (len); \ | ||
356 | (t)->t_res_num++; \ | ||
357 | } while (0) | ||
358 | |||
359 | /* | ||
360 | * Reservation region | ||
361 | * As would be stored in xfs_log_iovec but without the i_addr which | ||
362 | * we don't care about. | ||
363 | */ | ||
364 | typedef struct xlog_res { | ||
365 | uint r_len; | ||
366 | uint r_type; | ||
367 | } xlog_res_t; | ||
368 | #else | ||
369 | #define XLOG_TIC_RESET_RES(t) | ||
370 | #define XLOG_TIC_ADD_OPHDR(t) | ||
371 | #define XLOG_TIC_ADD_REGION(t, len, type) | ||
372 | #endif | ||
373 | |||
374 | |||
338 | typedef struct xlog_ticket { | 375 | typedef struct xlog_ticket { |
339 | sv_t t_sema; /* sleep on this semaphore :20 */ | 376 | sv_t t_sema; /* sleep on this semaphore : 20 */ |
340 | struct xlog_ticket *t_next; /* : 4 */ | 377 | struct xlog_ticket *t_next; /* :4|8 */ |
341 | struct xlog_ticket *t_prev; /* : 4 */ | 378 | struct xlog_ticket *t_prev; /* :4|8 */ |
342 | xlog_tid_t t_tid; /* transaction identifier : 4 */ | 379 | xlog_tid_t t_tid; /* transaction identifier : 4 */ |
343 | int t_curr_res; /* current reservation in bytes : 4 */ | 380 | int t_curr_res; /* current reservation in bytes : 4 */ |
344 | int t_unit_res; /* unit reservation in bytes : 4 */ | 381 | int t_unit_res; /* unit reservation in bytes : 4 */ |
345 | __uint8_t t_ocnt; /* original count : 1 */ | 382 | char t_ocnt; /* original count : 1 */ |
346 | __uint8_t t_cnt; /* current count : 1 */ | 383 | char t_cnt; /* current count : 1 */ |
347 | __uint8_t t_clientid; /* who does this belong to; : 1 */ | 384 | char t_clientid; /* who does this belong to; : 1 */ |
348 | __uint8_t t_flags; /* properties of reservation : 1 */ | 385 | char t_flags; /* properties of reservation : 1 */ |
386 | uint t_trans_type; /* transaction type : 4 */ | ||
387 | |||
388 | #if defined (XFS_LOG_RES_DEBUG) | ||
389 | /* reservation array fields */ | ||
390 | uint t_res_num; /* num in array : 4 */ | ||
391 | xlog_res_t t_res_arr[XLOG_TIC_LEN_MAX]; /* array of res : X */ | ||
392 | uint t_res_num_ophdrs; /* num op hdrs : 4 */ | ||
393 | uint t_res_arr_sum; /* array sum : 4 */ | ||
394 | uint t_res_o_flow; /* sum overflow : 4 */ | ||
395 | #endif | ||
349 | } xlog_ticket_t; | 396 | } xlog_ticket_t; |
397 | |||
350 | #endif | 398 | #endif |
351 | 399 | ||
352 | 400 | ||