diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_log.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index ad0cac378e9a..30fec0a2a213 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c | |||
@@ -150,6 +150,15 @@ xlog_grant_add_space( | |||
150 | } while (head_val != old); | 150 | } while (head_val != old); |
151 | } | 151 | } |
152 | 152 | ||
153 | STATIC void | ||
154 | xlog_grant_head_init( | ||
155 | struct xlog_grant_head *head) | ||
156 | { | ||
157 | xlog_assign_grant_head(&head->grant, 1, 0); | ||
158 | INIT_LIST_HEAD(&head->waiters); | ||
159 | spin_lock_init(&head->lock); | ||
160 | } | ||
161 | |||
153 | STATIC bool | 162 | STATIC bool |
154 | xlog_reserveq_wake( | 163 | xlog_reserveq_wake( |
155 | struct log *log, | 164 | struct log *log, |
@@ -1070,12 +1079,9 @@ xlog_alloc_log(xfs_mount_t *mp, | |||
1070 | xlog_assign_atomic_lsn(&log->l_tail_lsn, 1, 0); | 1079 | xlog_assign_atomic_lsn(&log->l_tail_lsn, 1, 0); |
1071 | xlog_assign_atomic_lsn(&log->l_last_sync_lsn, 1, 0); | 1080 | xlog_assign_atomic_lsn(&log->l_last_sync_lsn, 1, 0); |
1072 | log->l_curr_cycle = 1; /* 0 is bad since this is initial value */ | 1081 | log->l_curr_cycle = 1; /* 0 is bad since this is initial value */ |
1073 | xlog_assign_grant_head(&log->l_reserve_head.grant, 1, 0); | 1082 | |
1074 | xlog_assign_grant_head(&log->l_write_head.grant, 1, 0); | 1083 | xlog_grant_head_init(&log->l_reserve_head); |
1075 | INIT_LIST_HEAD(&log->l_reserve_head.waiters); | 1084 | xlog_grant_head_init(&log->l_write_head); |
1076 | INIT_LIST_HEAD(&log->l_write_head.waiters); | ||
1077 | spin_lock_init(&log->l_reserve_head.lock); | ||
1078 | spin_lock_init(&log->l_write_head.lock); | ||
1079 | 1085 | ||
1080 | error = EFSCORRUPTED; | 1086 | error = EFSCORRUPTED; |
1081 | if (xfs_sb_version_hassector(&mp->m_sb)) { | 1087 | if (xfs_sb_version_hassector(&mp->m_sb)) { |