aboutsummaryrefslogtreecommitdiffstats
path: root/fs/exofs/exofs.h
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-09-28 07:43:09 -0400
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-04 06:13:59 -0400
commitd866d875f68fdeae63df334d291fe138dc636d96 (patch)
tree9606674db2311ab869640526ef245aaa7fbf4ea8 /fs/exofs/exofs.h
parenteb507bc18969f63b8968034144fd69706c492516 (diff)
ore/exofs: Change the type of the devices array (API change)
In the pNFS obj-LD the device table at the layout level needs to point to a device_cache node, where it is possible and likely that many layouts will point to the same device-nodes. In Exofs we have a more orderly structure where we have a single array of devices that repeats twice for a round-robin view of the device table This patch moves to a model that can be used by the pNFS obj-LD where struct ore_components holds an array of ore_dev-pointers. (ore_dev is newly defined and contains a struct osd_dev *od member) Each pointer in the array of pointers will point to a bigger user-defined dev_struct. That can be accessed by use of the container_of macro. In Exofs an __alloc_dev_table() function allocates the ore_dev-pointers array as well as an exofs_dev array, in one allocation and does the addresses dance to set everything pointing correctly. It still keeps the double allocation trick for the inodes round-robin view of the table. The device table is always allocated dynamically, also for the single device case. So it is unconditionally freed at umount. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/exofs.h')
-rw-r--r--fs/exofs/exofs.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/exofs/exofs.h b/fs/exofs/exofs.h
index 3b2e0478f363..006fd6f33571 100644
--- a/fs/exofs/exofs.h
+++ b/fs/exofs/exofs.h
@@ -53,6 +53,10 @@
53/* u64 has problems with printk this will cast it to unsigned long long */ 53/* u64 has problems with printk this will cast it to unsigned long long */
54#define _LLU(x) (unsigned long long)(x) 54#define _LLU(x) (unsigned long long)(x)
55 55
56struct exofs_dev {
57 struct ore_dev ored;
58 unsigned did;
59};
56/* 60/*
57 * our extension to the in-memory superblock 61 * our extension to the in-memory superblock
58 */ 62 */
@@ -69,7 +73,6 @@ struct exofs_sb_info {
69 struct ore_layout layout; /* Default files layout */ 73 struct ore_layout layout; /* Default files layout */
70 struct ore_comp one_comp; /* id & cred of partition id=0*/ 74 struct ore_comp one_comp; /* id & cred of partition id=0*/
71 struct ore_components oc; /* comps for the partition */ 75 struct ore_components oc; /* comps for the partition */
72 struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
73}; 76};
74 77
75/* 78/*
@@ -214,13 +217,14 @@ static inline void exofs_init_comps(struct ore_components *oc,
214 one_comp->obj.id = oid; 217 one_comp->obj.id = oid;
215 exofs_make_credential(one_comp->cred, &one_comp->obj); 218 exofs_make_credential(one_comp->cred, &one_comp->obj);
216 219
217 oc->numdevs = sbi->oc.numdevs; 220 oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 *
221 sbi->layout.group_count;
218 oc->single_comp = EC_SINGLE_COMP; 222 oc->single_comp = EC_SINGLE_COMP;
219 oc->comps = one_comp; 223 oc->comps = one_comp;
220 224
221 /* Round robin device view of the table */ 225 /* Round robin device view of the table */
222 first_dev = (dev_mod * sbi->layout.mirrors_p1) % sbi->oc.numdevs; 226 first_dev = (dev_mod * sbi->layout.mirrors_p1) % sbi->oc.numdevs;
223 oc->ods = sbi->oc.ods + first_dev; 227 oc->ods = &sbi->oc.ods[first_dev];
224} 228}
225 229
226#endif 230#endif