3636#include <linux/fs.h>
3737#include <linux/time.h>
3838#include <linux/backing-dev.h>
39- #include <linux/pnfs_osd_xdr.h>
39+ #include <scsi/osd_ore.h>
40+
4041#include "common.h"
4142
4243#define EXOFS_ERR (fmt , a ...) printk(KERN_ERR "exofs: " fmt, ##a)
5253/* u64 has problems with printk this will cast it to unsigned long long */
5354#define _LLU (x ) (unsigned long long)(x)
5455
55- struct exofs_comp {
56- struct osd_obj_id obj ;
57- u8 cred [OSD_CAP_LEN ];
58- };
59-
60- struct exofs_layout {
61- /* Our way of looking at the data_map */
62- unsigned stripe_unit ;
63- unsigned mirrors_p1 ;
64-
65- unsigned group_width ;
66- u64 group_depth ;
67- unsigned group_count ;
68- };
69-
70- struct exofs_components {
71- unsigned numdevs ; /* Num of devices in array */
72- /* If @single_comp == EC_SINGLE_COMP, @comps points to a single
73- * component. else there are @numdevs components
74- */
75- enum EC_COMP_USAGE {
76- EC_SINGLE_COMP = 0 , EC_MULTPLE_COMPS = 0xffffffff
77- } single_comp ;
78- struct exofs_comp * comps ;
79- struct osd_dev * * ods ; /* osd_dev array */
80- };
81-
8256/*
8357 * our extension to the in-memory superblock
8458 */
@@ -95,9 +69,9 @@ struct exofs_sb_info {
9569 struct pnfs_osd_data_map data_map ; /* Default raid to use
9670 * FIXME: Needed ?
9771 */
98- struct exofs_layout layout ; /* Default files layout */
99- struct exofs_comp one_comp ; /* id & cred of partition id=0*/
100- struct exofs_components comps ; /* comps for the partition */
72+ struct ore_layout layout ; /* Default files layout */
73+ struct ore_comp one_comp ; /* id & cred of partition id=0*/
74+ struct ore_components comps ; /* comps for the partition */
10175 struct osd_dev * _min_one_dev [1 ]; /* Place holder for one dev */
10276};
10377
@@ -111,62 +85,15 @@ struct exofs_i_info {
11185 uint32_t i_data [EXOFS_IDATA ];/*short symlink names and device #s*/
11286 uint32_t i_dir_start_lookup ; /* which page to start lookup */
11387 uint64_t i_commit_size ; /* the object's written length */
114- struct exofs_comp one_comp ; /* same component for all devices */
115- struct exofs_components comps ; /* inode view of the device table */
88+ struct ore_comp one_comp ; /* same component for all devices */
89+ struct ore_components comps ; /* inode view of the device table */
11690};
11791
11892static inline osd_id exofs_oi_objno (struct exofs_i_info * oi )
11993{
12094 return oi -> vfs_inode .i_ino + EXOFS_OBJ_OFF ;
12195}
12296
123- struct exofs_io_state ;
124- typedef void (* exofs_io_done_fn )(struct exofs_io_state * ios , void * private );
125-
126- struct exofs_io_state {
127- struct kref kref ;
128-
129- void * private ;
130- exofs_io_done_fn done ;
131-
132- struct exofs_layout * layout ;
133- struct exofs_components * comps ;
134-
135- /* Global read/write IO*/
136- loff_t offset ;
137- unsigned long length ;
138- void * kern_buff ;
139-
140- struct page * * pages ;
141- unsigned nr_pages ;
142- unsigned pgbase ;
143- unsigned pages_consumed ;
144-
145- /* Attributes */
146- unsigned in_attr_len ;
147- struct osd_attr * in_attr ;
148- unsigned out_attr_len ;
149- struct osd_attr * out_attr ;
150-
151- bool reading ;
152-
153- /* Variable array of size numdevs */
154- unsigned numdevs ;
155- struct exofs_per_dev_state {
156- struct osd_request * or ;
157- struct bio * bio ;
158- loff_t offset ;
159- unsigned length ;
160- unsigned dev ;
161- } per_dev [];
162- };
163-
164- static inline unsigned exofs_io_state_size (unsigned numdevs )
165- {
166- return sizeof (struct exofs_io_state ) +
167- sizeof (struct exofs_per_dev_state ) * numdevs ;
168- }
169-
17097/*
17198 * our inode flags
17299 */
@@ -219,30 +146,8 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
219146 * function declarations *
220147 *************************/
221148
222- /* ios.c */
223- int exofs_get_rw_state (struct exofs_layout * layout ,
224- struct exofs_components * comps ,
225- bool is_reading , u64 offset , u64 length ,
226- struct exofs_io_state * * ios );
227- int exofs_get_io_state (struct exofs_layout * layout ,
228- struct exofs_components * comps ,
229- struct exofs_io_state * * ios );
230- void exofs_put_io_state (struct exofs_io_state * ios );
231-
232- int exofs_check_io (struct exofs_io_state * ios , u64 * resid );
233-
234- int exofs_sbi_create (struct exofs_io_state * ios );
235- int exofs_sbi_remove (struct exofs_io_state * ios );
236- int exofs_sbi_write (struct exofs_io_state * ios );
237- int exofs_sbi_read (struct exofs_io_state * ios );
238- int exofs_truncate (struct exofs_layout * layout , struct exofs_components * comps ,
239- u64 size );
240-
241- int extract_attr_from_ios (struct exofs_io_state * ios , struct osd_attr * attr );
242- extern const struct osd_attr g_attr_logical_length ;
243-
244149/* inode.c */
245- unsigned exofs_max_io_pages (struct exofs_layout * layout ,
150+ unsigned exofs_max_io_pages (struct ore_layout * layout ,
246151 unsigned expected_pages );
247152int exofs_setattr (struct dentry * , struct iattr * );
248153int exofs_write_begin (struct file * file , struct address_space * mapping ,
@@ -292,8 +197,8 @@ extern const struct inode_operations exofs_special_inode_operations;
292197extern const struct inode_operations exofs_symlink_inode_operations ;
293198extern const struct inode_operations exofs_fast_symlink_inode_operations ;
294199
295- /* exofs_init_comps will initialize an exofs_components device array
296- * pointing to a single exofs_comp struct, and a round-robin view
200+ /* exofs_init_comps will initialize an ore_components device array
201+ * pointing to a single ore_comp struct, and a round-robin view
297202 * of the device table.
298203 * The first device of each inode is the [inode->ino % num_devices]
299204 * and the rest of the devices sequentially following where the
@@ -302,8 +207,8 @@ extern const struct inode_operations exofs_fast_symlink_inode_operations;
302207 * bigger and that the device table repeats twice.
303208 * See: exofs_read_lookup_dev_table()
304209 */
305- static inline void exofs_init_comps (struct exofs_components * comps ,
306- struct exofs_comp * one_comp ,
210+ static inline void exofs_init_comps (struct ore_components * comps ,
211+ struct ore_comp * one_comp ,
307212 struct exofs_sb_info * sbi , osd_id oid )
308213{
309214 unsigned dev_mod = (unsigned )oid , first_dev ;
0 commit comments