36
36
#include <linux/fs.h>
37
37
#include <linux/time.h>
38
38
#include <linux/backing-dev.h>
39
- #include <linux/pnfs_osd_xdr.h>
39
+ #include <scsi/osd_ore.h>
40
+
40
41
#include "common.h"
41
42
42
43
#define EXOFS_ERR (fmt , a ...) printk(KERN_ERR "exofs: " fmt, ##a)
52
53
/* u64 has problems with printk this will cast it to unsigned long long */
53
54
#define _LLU (x ) (unsigned long long)(x)
54
55
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
-
82
56
/*
83
57
* our extension to the in-memory superblock
84
58
*/
@@ -95,9 +69,9 @@ struct exofs_sb_info {
95
69
struct pnfs_osd_data_map data_map ; /* Default raid to use
96
70
* FIXME: Needed ?
97
71
*/
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 */
101
75
struct osd_dev * _min_one_dev [1 ]; /* Place holder for one dev */
102
76
};
103
77
@@ -111,62 +85,15 @@ struct exofs_i_info {
111
85
uint32_t i_data [EXOFS_IDATA ];/*short symlink names and device #s*/
112
86
uint32_t i_dir_start_lookup ; /* which page to start lookup */
113
87
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 */
116
90
};
117
91
118
92
static inline osd_id exofs_oi_objno (struct exofs_i_info * oi )
119
93
{
120
94
return oi -> vfs_inode .i_ino + EXOFS_OBJ_OFF ;
121
95
}
122
96
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
-
170
97
/*
171
98
* our inode flags
172
99
*/
@@ -219,30 +146,8 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
219
146
* function declarations *
220
147
*************************/
221
148
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
-
244
149
/* inode.c */
245
- unsigned exofs_max_io_pages (struct exofs_layout * layout ,
150
+ unsigned exofs_max_io_pages (struct ore_layout * layout ,
246
151
unsigned expected_pages );
247
152
int exofs_setattr (struct dentry * , struct iattr * );
248
153
int exofs_write_begin (struct file * file , struct address_space * mapping ,
@@ -292,8 +197,8 @@ extern const struct inode_operations exofs_special_inode_operations;
292
197
extern const struct inode_operations exofs_symlink_inode_operations ;
293
198
extern const struct inode_operations exofs_fast_symlink_inode_operations ;
294
199
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
297
202
* of the device table.
298
203
* The first device of each inode is the [inode->ino % num_devices]
299
204
* and the rest of the devices sequentially following where the
@@ -302,8 +207,8 @@ extern const struct inode_operations exofs_fast_symlink_inode_operations;
302
207
* bigger and that the device table repeats twice.
303
208
* See: exofs_read_lookup_dev_table()
304
209
*/
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 ,
307
212
struct exofs_sb_info * sbi , osd_id oid )
308
213
{
309
214
unsigned dev_mod = (unsigned )oid , first_dev ;
0 commit comments