From 3bd9856857339d7ee8c4ad50030583f1b9415c39 Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Wed, 28 Sep 2011 12:04:23 +0300 Subject: ore: Support for partial component table Users like the objlayout-driver would like to only pass a partial device table that covers the IO in question. For example exofs divides the file into raid-group-sized chunks and only serves group_width number of devices at a time. The partiality is communicated by setting ore_componets->first_dev and the array covers all logical devices from oc->first_dev upto (oc->first_dev + oc->numdevs) The ore_comp_dev() API receives a logical device index and returns the actual present device in the table. An out-of-range dev_index will BUG. Logical device index is the theoretical device index as if all the devices of a file are present. .i.e: total_devs = group_width * mirror_p1 * group_count 0 <= dev_index < total_devs Signed-off-by: Boaz Harrosh --- fs/exofs/exofs.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/exofs/exofs.h') diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h index 006fd6f3357..51f4b4c40f0 100644 --- a/fs/exofs/exofs.h +++ b/fs/exofs/exofs.h @@ -217,6 +217,7 @@ static inline void exofs_init_comps(struct ore_components *oc, one_comp->obj.id = oid; exofs_make_credential(one_comp->cred, &one_comp->obj); + oc->first_dev = 0; oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 * sbi->layout.group_count; oc->single_comp = EC_SINGLE_COMP; -- cgit v1.2.3-70-g09d2