diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-19 21:31:26 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-02-22 23:21:39 -0500 |
commit | c303c5b8c3b8eace41c4fba26205b50c0f8e4ca0 (patch) | |
tree | 61f959e5c3729349f79b9d47224b1a06ba443602 /fs/xfs/xfs_log.c | |
parent | 28496968a6ac37c8b8c44b5156e633c581bb8378 (diff) |
xfs: add xlog_grant_head_init
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/xfs/xfs_log.c')
-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)) { |