aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/journal.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-02-01 15:01:05 -0500
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:02 -0400
commitd85b20e4b300edfd290f21fc2d790ba16d2f225b (patch)
treea505db4d378420e5bbd1d8c18a0d97a0498e5ceb /fs/ocfs2/journal.c
parent8e8a4603b5422c9145880e73b23bc4c2c4de0098 (diff)
ocfs2: Make ocfs2_slot_info private.
Just use osb_lock around the ocfs2_slot_info data. This allows us to take the ocfs2_slot_info structure private in slot_info.c. All access is now via accessors. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r--fs/ocfs2/journal.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index c2e654ee703a..ed0c6d0850d7 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1079,7 +1079,6 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
1079{ 1079{
1080 int status = 0; 1080 int status = 0;
1081 int slot_num; 1081 int slot_num;
1082 struct ocfs2_slot_info *si = osb->slot_info;
1083 struct ocfs2_dinode *la_copy = NULL; 1082 struct ocfs2_dinode *la_copy = NULL;
1084 struct ocfs2_dinode *tl_copy = NULL; 1083 struct ocfs2_dinode *tl_copy = NULL;
1085 1084
@@ -1092,8 +1091,8 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
1092 * case we should've called ocfs2_journal_load instead. */ 1091 * case we should've called ocfs2_journal_load instead. */
1093 BUG_ON(osb->node_num == node_num); 1092 BUG_ON(osb->node_num == node_num);
1094 1093
1095 slot_num = ocfs2_node_num_to_slot(si, node_num); 1094 slot_num = ocfs2_node_num_to_slot(osb, node_num);
1096 if (slot_num == OCFS2_INVALID_SLOT) { 1095 if (slot_num == -ENOENT) {
1097 status = 0; 1096 status = 0;
1098 mlog(0, "no slot for this node, so no recovery required.\n"); 1097 mlog(0, "no slot for this node, so no recovery required.\n");
1099 goto done; 1098 goto done;
@@ -1183,23 +1182,24 @@ bail:
1183 * slot info struct has been updated from disk. */ 1182 * slot info struct has been updated from disk. */
1184int ocfs2_mark_dead_nodes(struct ocfs2_super *osb) 1183int ocfs2_mark_dead_nodes(struct ocfs2_super *osb)
1185{ 1184{
1186 int status, i, node_num; 1185 unsigned int node_num;
1187 struct ocfs2_slot_info *si = osb->slot_info; 1186 int status, i;
1188 1187
1189 /* This is called with the super block cluster lock, so we 1188 /* This is called with the super block cluster lock, so we
1190 * know that the slot map can't change underneath us. */ 1189 * know that the slot map can't change underneath us. */
1191 1190
1192 spin_lock(&si->si_lock); 1191 spin_lock(&osb->osb_lock);
1193 for(i = 0; i < si->si_num_slots; i++) { 1192 for (i = 0; i < osb->max_slots; i++) {
1194 if (i == osb->slot_num) 1193 if (i == osb->slot_num)
1195 continue; 1194 continue;
1196 if (ocfs2_is_empty_slot(si, i)) 1195
1196 status = ocfs2_slot_to_node_num_locked(osb, i, &node_num);
1197 if (status == -ENOENT)
1197 continue; 1198 continue;
1198 1199
1199 node_num = si->si_global_node_nums[i];
1200 if (ocfs2_node_map_test_bit(osb, &osb->recovery_map, node_num)) 1200 if (ocfs2_node_map_test_bit(osb, &osb->recovery_map, node_num))
1201 continue; 1201 continue;
1202 spin_unlock(&si->si_lock); 1202 spin_unlock(&osb->osb_lock);
1203 1203
1204 /* Ok, we have a slot occupied by another node which 1204 /* Ok, we have a slot occupied by another node which
1205 * is not in the recovery map. We trylock his journal 1205 * is not in the recovery map. We trylock his journal
@@ -1215,9 +1215,9 @@ int ocfs2_mark_dead_nodes(struct ocfs2_super *osb)
1215 goto bail; 1215 goto bail;
1216 } 1216 }
1217 1217
1218 spin_lock(&si->si_lock); 1218 spin_lock(&osb->osb_lock);
1219 } 1219 }
1220 spin_unlock(&si->si_lock); 1220 spin_unlock(&osb->osb_lock);
1221 1221
1222 status = 0; 1222 status = 0;
1223bail: 1223bail: