diff options
Diffstat (limited to 'fs')
| -rw-r--r-- | fs/xfs/xfs_log_priv.h | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index 8f285149681f..4518b188ade6 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
| @@ -494,10 +494,8 @@ typedef struct log { | |||
| 494 | 494 | ||
| 495 | #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) | 495 | #define XLOG_FORCED_SHUTDOWN(log) ((log)->l_flags & XLOG_IO_ERROR) |
| 496 | 496 | ||
| 497 | #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ | 497 | #define XLOG_GRANT_SUB_SPACE(log,bytes,type) \ |
| 498 | xlog_grant_sub_space(log,bytes,type) | 498 | { \ |
| 499 | static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) | ||
| 500 | { | ||
| 501 | if (type == 'w') { \ | 499 | if (type == 'w') { \ |
| 502 | (log)->l_grant_write_bytes -= (bytes); \ | 500 | (log)->l_grant_write_bytes -= (bytes); \ |
| 503 | if ((log)->l_grant_write_bytes < 0) { \ | 501 | if ((log)->l_grant_write_bytes < 0) { \ |
| @@ -511,13 +509,9 @@ static inline void xlog_grant_sub_space(struct log *log, int bytes, int type) | |||
| 511 | (log)->l_grant_reserve_cycle--; \ | 509 | (log)->l_grant_reserve_cycle--; \ |
| 512 | } \ | 510 | } \ |
| 513 | } \ | 511 | } \ |
| 514 | } | 512 | } |
| 515 | 513 | #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ | |
| 516 | #define XLOG_GRANT_ADD_SPACE(log,bytes,type) \ | 514 | { \ |
| 517 | xlog_grant_add_space(log,bytes,type) | ||
| 518 | static inline void | ||
| 519 | xlog_grant_add_space(struct log *log, int bytes, int type) | ||
| 520 | { | ||
| 521 | if (type == 'w') { \ | 515 | if (type == 'w') { \ |
| 522 | (log)->l_grant_write_bytes += (bytes); \ | 516 | (log)->l_grant_write_bytes += (bytes); \ |
| 523 | if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ | 517 | if ((log)->l_grant_write_bytes > (log)->l_logsize) { \ |
| @@ -531,12 +525,9 @@ xlog_grant_add_space(struct log *log, int bytes, int type) | |||
| 531 | (log)->l_grant_reserve_cycle++; \ | 525 | (log)->l_grant_reserve_cycle++; \ |
| 532 | } \ | 526 | } \ |
| 533 | } \ | 527 | } \ |
| 534 | } | 528 | } |
| 535 | 529 | #define XLOG_INS_TICKETQ(q, tic) \ | |
| 536 | #define XLOG_INS_TICKETQ(q, tic) xlog_ins_ticketq(q, tic) | 530 | { \ |
| 537 | static inline void | ||
| 538 | xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) | ||
| 539 | { \ | ||
| 540 | if (q) { \ | 531 | if (q) { \ |
| 541 | (tic)->t_next = (q); \ | 532 | (tic)->t_next = (q); \ |
| 542 | (tic)->t_prev = (q)->t_prev; \ | 533 | (tic)->t_prev = (q)->t_prev; \ |
| @@ -547,12 +538,9 @@ xlog_ins_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) | |||
| 547 | (q) = (tic); \ | 538 | (q) = (tic); \ |
| 548 | } \ | 539 | } \ |
| 549 | (tic)->t_flags |= XLOG_TIC_IN_Q; \ | 540 | (tic)->t_flags |= XLOG_TIC_IN_Q; \ |
| 550 | } | 541 | } |
| 551 | 542 | #define XLOG_DEL_TICKETQ(q, tic) \ | |
| 552 | #define XLOG_DEL_TICKETQ(q, tic) xlog_del_ticketq(q, tic) | 543 | { \ |
| 553 | static inline void | ||
| 554 | xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) | ||
| 555 | { \ | ||
| 556 | if ((tic) == (tic)->t_next) { \ | 544 | if ((tic) == (tic)->t_next) { \ |
| 557 | (q) = NULL; \ | 545 | (q) = NULL; \ |
| 558 | } else { \ | 546 | } else { \ |
| @@ -562,7 +550,7 @@ xlog_del_ticketq(struct xlog_ticket *q, struct xlog_ticket *tic) | |||
| 562 | } \ | 550 | } \ |
| 563 | (tic)->t_next = (tic)->t_prev = NULL; \ | 551 | (tic)->t_next = (tic)->t_prev = NULL; \ |
| 564 | (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ | 552 | (tic)->t_flags &= ~XLOG_TIC_IN_Q; \ |
| 565 | } | 553 | } |
| 566 | 554 | ||
| 567 | /* common routines */ | 555 | /* common routines */ |
| 568 | extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); | 556 | extern xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); |
