From 5a51c0c7e9a913649aa65d8233470682bcbb7694 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Wed, 28 Sep 2011 13:18:45 +0300 Subject: ore/exofs: Define new ore_verify_layout All users of the ore will need to check if current code supports the given layout. For example RAID5/6 is not currently supported. So move all the checks from exofs/super.c to a new ore_verify_layout() to be used by ore users. Note that any new layout should be passed through the ore_verify_layout() because the ore engine will prepare and verify some internal members of ore_layout, and assumes it's called. Signed-off-by: Boaz Harrosh --- include/scsi/osd_ore.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/scsi') diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h index 492b70d43bb6..716dbeae8cd2 100644 --- a/include/scsi/osd_ore.h +++ b/include/scsi/osd_ore.h @@ -42,6 +42,13 @@ struct ore_layout { unsigned group_width; u64 group_depth; unsigned group_count; + + /* Cached often needed calculations filled in by + * ore_verify_layout + */ + unsigned long max_io_length; /* Max length that should be passed to + * ore_get_rw_state + */ }; struct ore_dev { @@ -138,6 +145,7 @@ static inline unsigned ore_io_state_size(unsigned numdevs) } /* ore.c */ +int ore_verify_layout(unsigned total_comps, struct ore_layout *layout); int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps, bool is_reading, u64 offset, u64 length, struct ore_io_state **ios); -- cgit v1.2.1