summaryrefslogtreecommitdiffstats
path: root/fs/exofs/exofs.h
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2011-09-28 13:43:09 +0200
committerBoaz Harrosh <bharrosh@panasas.com>2011-10-04 12:13:59 +0200
commitd866d875f68fdeae63df334d291fe138dc636d96 (patch)
tree9606674db2311ab869640526ef245aaa7fbf4ea8 /fs/exofs/exofs.h
parentore: Make ore_striping_info and ore_calc_stripe_info public (diff)
downloadlinux-d866d875f68fdeae63df334d291fe138dc636d96.tar.xz
linux-d866d875f68fdeae63df334d291fe138dc636d96.zip
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 @@
/* u64 has problems with printk this will cast it to unsigned long long */
#define _LLU(x) (unsigned long long)(x)
+struct exofs_dev {
+ struct ore_dev ored;
+ unsigned did;
+};
/*
* our extension to the in-memory superblock
*/
@@ -69,7 +73,6 @@ struct exofs_sb_info {
struct ore_layout layout; /* Default files layout */
struct ore_comp one_comp; /* id & cred of partition id=0*/
struct ore_components oc; /* comps for the partition */
- struct osd_dev *_min_one_dev[1]; /* Place holder for one dev */
};
/*
@@ -214,13 +217,14 @@ 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->numdevs = sbi->oc.numdevs;
+ oc->numdevs = sbi->layout.group_width * sbi->layout.mirrors_p1 *
+ sbi->layout.group_count;
oc->single_comp = EC_SINGLE_COMP;
oc->comps = one_comp;
/* Round robin device view of the table */
first_dev = (dev_mod * sbi->layout.mirrors_p1) % sbi->oc.numdevs;
- oc->ods = sbi->oc.ods + first_dev;
+ oc->ods = &sbi->oc.ods[first_dev];
}
#endif