diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-02-01 11:59:05 -0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 08:56:03 -0700 |
commit | fb86b1f07120b66769a39c445da5c4300069dd44 (patch) | |
tree | 4d97d78e2c703b289801a91e3a480fa1620914a8 /fs/ocfs2/slot_map.c | |
parent | fc881fa0d59596c02f8707b5572567c369d4789a (diff) | |
download | op-kernel-dev-fb86b1f07120b66769a39c445da5c4300069dd44.zip op-kernel-dev-fb86b1f07120b66769a39c445da5c4300069dd44.tar.gz |
ocfs2: Define the contents of the slot_map file.
The slot map file is merely an array of __le16. Wrap it in a structure for
cleaner reference.
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/slot_map.c')
-rw-r--r-- | fs/ocfs2/slot_map.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/ocfs2/slot_map.c b/fs/ocfs2/slot_map.c index 65a61bf..e7e7a74 100644 --- a/fs/ocfs2/slot_map.c +++ b/fs/ocfs2/slot_map.c @@ -85,17 +85,17 @@ static void ocfs2_set_slot(struct ocfs2_slot_info *si, static void ocfs2_update_slot_info(struct ocfs2_slot_info *si) { int i; - __le16 *disk_info; + struct ocfs2_slot_map *sm; /* we don't read the slot block here as ocfs2_super_lock * should've made sure we have the most recent copy. */ - disk_info = (__le16 *) si->si_bh[0]->b_data; + sm = (struct ocfs2_slot_map *)si->si_bh[0]->b_data; for (i = 0; i < si->si_num_slots; i++) { - if (le16_to_cpu(disk_info[i]) == (u16)OCFS2_INVALID_SLOT) + if (le16_to_cpu(sm->sm_slots[i]) == (u16)OCFS2_INVALID_SLOT) ocfs2_invalidate_slot(si, i); else - ocfs2_set_slot(si, i, le16_to_cpu(disk_info[i])); + ocfs2_set_slot(si, i, le16_to_cpu(sm->sm_slots[i])); } } @@ -135,15 +135,16 @@ static int ocfs2_update_disk_slots(struct ocfs2_super *osb, struct ocfs2_slot_info *si) { int status, i; - __le16 *disk_info = (__le16 *) si->si_bh[0]->b_data; + struct ocfs2_slot_map *sm; spin_lock(&osb->osb_lock); + sm = (struct ocfs2_slot_map *)si->si_bh[0]->b_data; for (i = 0; i < si->si_num_slots; i++) { if (si->si_slots[i].sl_valid) - disk_info[i] = + sm->sm_slots[i] = cpu_to_le16(si->si_slots[i].sl_node_num); else - disk_info[i] = cpu_to_le16(OCFS2_INVALID_SLOT); + sm->sm_slots[i] = cpu_to_le16(OCFS2_INVALID_SLOT); } spin_unlock(&osb->osb_lock); |