diff options
author | Nathan Scott <nathans@sgi.com> | 2005-11-25 00:42:28 -0500 |
---|---|---|
committer | Nathan Scott <nathans@sgi.com> | 2005-11-25 00:42:28 -0500 |
commit | 551c81e2d32c5867fb592091365d8c37e1509dce (patch) | |
tree | 29d2b0f738a8e40a19fd01960f3ff9bd5e007355 /fs | |
parent | e0144ca55391556d781cb1c90fd6f00bb0c20760 (diff) |
[XFS] Resolve the xlog_grant_log_space hang, revert inline to macro.
SGI-PV: 946205
SGI-Modid: xfs-linux-melb:xfs-kern:24567a
Signed-off-by: Nathan Scott <nathans@sgi.com>
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); |