diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-19 21:31:23 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-02-22 23:17:00 -0500 |
commit | cfb7cdca0aca5ee2e2ef491284bf1edc3b581885 (patch) | |
tree | 2d3398752711b7b0215cba1aa2cc06fc8a44163d /fs | |
parent | 5b03ff1b2444ddf7b8084b7505101e97257aff5a (diff) |
xfs: cleanup xfs_log_space_wake
Remove the now unused opportunistic parameter, and use the the
xlog_writeq_wake and xlog_reserveq_wake helpers now that we don't have
to care about the opportunistic wakeups.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/xfs_log.c | 35 | ||||
-rw-r--r-- | fs/xfs/xfs_log.h | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_ail.c | 4 |
3 files changed, 8 insertions, 34 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 9161e8a76e77..2db39df5a57d 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -762,18 +762,13 @@ xfs_log_item_init( | |||
762 | 762 | ||
763 | /* | 763 | /* |
764 | * Wake up processes waiting for log space after we have moved the log tail. | 764 | * Wake up processes waiting for log space after we have moved the log tail. |
765 | * | ||
766 | * If opportunistic is set wake up one waiter even if we do not have enough | ||
767 | * free space by our strict accounting. | ||
768 | */ | 765 | */ |
769 | void | 766 | void |
770 | xfs_log_space_wake( | 767 | xfs_log_space_wake( |
771 | struct xfs_mount *mp, | 768 | struct xfs_mount *mp) |
772 | bool opportunistic) | ||
773 | { | 769 | { |
774 | struct xlog_ticket *tic; | ||
775 | struct log *log = mp->m_log; | 770 | struct log *log = mp->m_log; |
776 | int need_bytes, free_bytes; | 771 | int free_bytes; |
777 | 772 | ||
778 | if (XLOG_FORCED_SHUTDOWN(log)) | 773 | if (XLOG_FORCED_SHUTDOWN(log)) |
779 | return; | 774 | return; |
@@ -783,16 +778,7 @@ xfs_log_space_wake( | |||
783 | 778 | ||
784 | spin_lock(&log->l_grant_write_lock); | 779 | spin_lock(&log->l_grant_write_lock); |
785 | free_bytes = xlog_space_left(log, &log->l_grant_write_head); | 780 | free_bytes = xlog_space_left(log, &log->l_grant_write_head); |
786 | list_for_each_entry(tic, &log->l_writeq, t_queue) { | 781 | xlog_writeq_wake(log, &free_bytes); |
787 | ASSERT(tic->t_flags & XLOG_TIC_PERM_RESERV); | ||
788 | |||
789 | if (free_bytes < tic->t_unit_res && !opportunistic) | ||
790 | break; | ||
791 | opportunistic = false; | ||
792 | free_bytes -= tic->t_unit_res; | ||
793 | trace_xfs_log_regrant_write_wake_up(log, tic); | ||
794 | wake_up(&tic->t_wait); | ||
795 | } | ||
796 | spin_unlock(&log->l_grant_write_lock); | 782 | spin_unlock(&log->l_grant_write_lock); |
797 | } | 783 | } |
798 | 784 | ||
@@ -801,18 +787,7 @@ xfs_log_space_wake( | |||
801 | 787 | ||
802 | spin_lock(&log->l_grant_reserve_lock); | 788 | spin_lock(&log->l_grant_reserve_lock); |
803 | free_bytes = xlog_space_left(log, &log->l_grant_reserve_head); | 789 | free_bytes = xlog_space_left(log, &log->l_grant_reserve_head); |
804 | list_for_each_entry(tic, &log->l_reserveq, t_queue) { | 790 | xlog_reserveq_wake(log, &free_bytes); |
805 | if (tic->t_flags & XLOG_TIC_PERM_RESERV) | ||
806 | need_bytes = tic->t_unit_res*tic->t_cnt; | ||
807 | else | ||
808 | need_bytes = tic->t_unit_res; | ||
809 | if (free_bytes < need_bytes && !opportunistic) | ||
810 | break; | ||
811 | opportunistic = false; | ||
812 | free_bytes -= need_bytes; | ||
813 | trace_xfs_log_grant_wake_up(log, tic); | ||
814 | wake_up(&tic->t_wait); | ||
815 | } | ||
816 | spin_unlock(&log->l_grant_reserve_lock); | 791 | spin_unlock(&log->l_grant_reserve_lock); |
817 | } | 792 | } |
818 | } | 793 | } |
@@ -2748,7 +2723,7 @@ xlog_ungrant_log_space(xlog_t *log, | |||
2748 | 2723 | ||
2749 | trace_xfs_log_ungrant_exit(log, ticket); | 2724 | trace_xfs_log_ungrant_exit(log, ticket); |
2750 | 2725 | ||
2751 | xfs_log_space_wake(log->l_mp, false); | 2726 | xfs_log_space_wake(log->l_mp); |
2752 | } | 2727 | } |
2753 | 2728 | ||
2754 | /* | 2729 | /* |
diff --git a/fs/xfs/xfs_log.h b/fs/xfs/xfs_log.h index 58d858074e6b..fe32c6927877 100644 --- a/fs/xfs/xfs_log.h +++ b/fs/xfs/xfs_log.h | |||
@@ -161,8 +161,7 @@ int xfs_log_mount(struct xfs_mount *mp, | |||
161 | int num_bblocks); | 161 | int num_bblocks); |
162 | int xfs_log_mount_finish(struct xfs_mount *mp); | 162 | int xfs_log_mount_finish(struct xfs_mount *mp); |
163 | xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); | 163 | xfs_lsn_t xlog_assign_tail_lsn(struct xfs_mount *mp); |
164 | void xfs_log_space_wake(struct xfs_mount *mp, | 164 | void xfs_log_space_wake(struct xfs_mount *mp); |
165 | bool opportunistic); | ||
166 | int xfs_log_notify(struct xfs_mount *mp, | 165 | int xfs_log_notify(struct xfs_mount *mp, |
167 | struct xlog_in_core *iclog, | 166 | struct xlog_in_core *iclog, |
168 | xfs_log_callback_t *callback_entry); | 167 | xfs_log_callback_t *callback_entry); |
diff --git a/fs/xfs/xfs_trans_ail.c b/fs/xfs/xfs_trans_ail.c index 9d5fc089ea2e..1dead07f092c 100644 --- a/fs/xfs/xfs_trans_ail.c +++ b/fs/xfs/xfs_trans_ail.c | |||
@@ -671,7 +671,7 @@ xfs_trans_ail_update_bulk( | |||
671 | 671 | ||
672 | if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) { | 672 | if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) { |
673 | xlog_assign_tail_lsn(ailp->xa_mount); | 673 | xlog_assign_tail_lsn(ailp->xa_mount); |
674 | xfs_log_space_wake(ailp->xa_mount, false); | 674 | xfs_log_space_wake(ailp->xa_mount); |
675 | } | 675 | } |
676 | } | 676 | } |
677 | 677 | ||
@@ -733,7 +733,7 @@ xfs_trans_ail_delete_bulk( | |||
733 | 733 | ||
734 | if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) { | 734 | if (mlip_changed && !XFS_FORCED_SHUTDOWN(ailp->xa_mount)) { |
735 | xlog_assign_tail_lsn(ailp->xa_mount); | 735 | xlog_assign_tail_lsn(ailp->xa_mount); |
736 | xfs_log_space_wake(ailp->xa_mount, false); | 736 | xfs_log_space_wake(ailp->xa_mount); |
737 | } | 737 | } |
738 | } | 738 | } |
739 | 739 | ||