aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r--fs/xfs/xfs_log_priv.h77
1 files changed, 5 insertions, 72 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index 4518b188ade6..34bcbf50789c 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -253,7 +253,6 @@ typedef __uint32_t xlog_tid_t;
253 253
254 254
255/* Ticket reservation region accounting */ 255/* Ticket reservation region accounting */
256#if defined(XFS_LOG_RES_DEBUG)
257#define XLOG_TIC_LEN_MAX 15 256#define XLOG_TIC_LEN_MAX 15
258#define XLOG_TIC_RESET_RES(t) ((t)->t_res_num = \ 257#define XLOG_TIC_RESET_RES(t) ((t)->t_res_num = \
259 (t)->t_res_arr_sum = (t)->t_res_num_ophdrs = 0) 258 (t)->t_res_arr_sum = (t)->t_res_num_ophdrs = 0)
@@ -278,15 +277,9 @@ typedef __uint32_t xlog_tid_t;
278 * we don't care about. 277 * we don't care about.
279 */ 278 */
280typedef struct xlog_res { 279typedef struct xlog_res {
281 uint r_len; 280 uint r_len; /* region length :4 */
282 uint r_type; 281 uint r_type; /* region's transaction type :4 */
283} xlog_res_t; 282} xlog_res_t;
284#else
285#define XLOG_TIC_RESET_RES(t)
286#define XLOG_TIC_ADD_OPHDR(t)
287#define XLOG_TIC_ADD_REGION(t, len, type)
288#endif
289
290 283
291typedef struct xlog_ticket { 284typedef struct xlog_ticket {
292 sv_t t_sema; /* sleep on this semaphore : 20 */ 285 sv_t t_sema; /* sleep on this semaphore : 20 */
@@ -301,14 +294,12 @@ typedef struct xlog_ticket {
301 char t_flags; /* properties of reservation : 1 */ 294 char t_flags; /* properties of reservation : 1 */
302 uint t_trans_type; /* transaction type : 4 */ 295 uint t_trans_type; /* transaction type : 4 */
303 296
304#if defined (XFS_LOG_RES_DEBUG)
305 /* reservation array fields */ 297 /* reservation array fields */
306 uint t_res_num; /* num in array : 4 */ 298 uint t_res_num; /* num in array : 4 */
307 xlog_res_t t_res_arr[XLOG_TIC_LEN_MAX]; /* array of res : X */
308 uint t_res_num_ophdrs; /* num op hdrs : 4 */ 299 uint t_res_num_ophdrs; /* num op hdrs : 4 */
309 uint t_res_arr_sum; /* array sum : 4 */ 300 uint t_res_arr_sum; /* array sum : 4 */
310 uint t_res_o_flow; /* sum overflow : 4 */ 301 uint t_res_o_flow; /* sum overflow : 4 */
311#endif 302 xlog_res_t t_res_arr[XLOG_TIC_LEN_MAX]; /* array of res : 8 * 15 */
312} xlog_ticket_t; 303} xlog_ticket_t;
313 304
314#endif 305#endif
@@ -494,71 +485,13 @@ typedef struct log {
494 485
495#define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) 486#define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR)
496 487
497#define XLOG_GRANT_SUB_SPACE(log,bytes,type) \
498 { \
499 if (type == 'w') { \
500 (log)->l_grant_write_bytes -= (bytes); \
501 if ((log)->l_grant_write_bytes < 0) { \
502 (log)->l_grant_write_bytes += (log)->l_logsize; \
503 (log)->l_grant_write_cycle--; \
504 } \
505 } else { \
506 (log)->l_grant_reserve_bytes -= (bytes); \
507 if ((log)->l_grant_reserve_bytes < 0) { \
508 (log)->l_grant_reserve_bytes += (log)->l_logsize;\
509 (log)->l_grant_reserve_cycle--; \
510 } \
511 } \
512 }
513#define XLOG_GRANT_ADD_SPACE(log,bytes,type) \
514 { \
515 if (type == 'w') { \
516 (log)->l_grant_write_bytes += (bytes); \
517 if ((log)->l_grant_write_bytes > (log)->l_logsize) { \
518 (log)->l_grant_write_bytes -= (log)->l_logsize; \
519 (log)->l_grant_write_cycle++; \
520 } \
521 } else { \
522 (log)->l_grant_reserve_bytes += (bytes); \
523 if ((log)->l_grant_reserve_bytes > (log)->l_logsize) { \
524 (log)->l_grant_reserve_bytes -= (log)->l_logsize;\
525 (log)->l_grant_reserve_cycle++; \
526 } \
527 } \
528 }
529#define XLOG_INS_TICKETQ(q, tic) \
530 { \
531 if (q) { \
532 (tic)->t_next = (q); \
533 (tic)->t_prev = (q)->t_prev; \
534 (q)->t_prev->t_next = (tic); \
535 (q)->t_prev = (tic); \
536 } else { \
537 (tic)->t_prev = (tic)->t_next = (tic); \
538 (q) = (tic); \
539 } \
540 (tic)->t_flags |= XLOG_TIC_IN_Q; \
541 }
542#define XLOG_DEL_TICKETQ(q, tic) \
543 { \
544 if ((tic) == (tic)->t_next) { \
545 (q) = NULL; \
546 } else { \
547 (q) = (tic)->t_next; \
548 (tic)->t_next->t_prev = (tic)->t_prev; \
549 (tic)->t_prev->t_next = (tic)->t_next; \
550 } \
551 (tic)->t_next = (tic)->t_prev = NULL; \
552 (tic)->t_flags &= ~XLOG_TIC_IN_Q; \
553 }
554 488
555/* common routines */ 489/* common routines */
556extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); 490extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp);
557extern int xlog_find_tail(xlog_t *log, 491extern int xlog_find_tail(xlog_t *log,
558 xfs_daddr_t *head_blk, 492 xfs_daddr_t *head_blk,
559 xfs_daddr_t *tail_blk, 493 xfs_daddr_t *tail_blk);
560 int readonly); 494extern int xlog_recover(xlog_t *log);
561extern int xlog_recover(xlog_t *log, int readonly);
562extern int xlog_recover_finish(xlog_t *log, int mfsi_flags); 495extern int xlog_recover_finish(xlog_t *log, int mfsi_flags);
563extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); 496extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int);
564extern void xlog_recover_process_iunlinks(xlog_t *log); 497extern void xlog_recover_process_iunlinks(xlog_t *log);