Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2005, 2006 |
Boaz Harrosh | 27d2e14 | 2009-06-14 17:23:09 +0300 | [diff] [blame] | 3 | * Avishay Traeger (avishay@gmail.com) |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 4 | * Copyright (C) 2008, 2009 |
| 5 | * Boaz Harrosh <bharrosh@panasas.com> |
| 6 | * |
| 7 | * This file is part of exofs. |
| 8 | * |
| 9 | * exofs is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation. Since it is based on ext2, and the only |
| 12 | * valid version of GPL for the Linux kernel is version 2, the only valid |
| 13 | * version of GPL for exofs is version 2. |
| 14 | * |
| 15 | * exofs is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with exofs; if not, write to the Free Software |
| 22 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 23 | */ |
| 24 | |
| 25 | #include <scsi/scsi_device.h> |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 26 | #include <asm/div64.h> |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 27 | |
| 28 | #include "exofs.h" |
| 29 | |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 30 | #define EXOFS_DBGMSG2(M...) do {} while (0) |
| 31 | /* #define EXOFS_DBGMSG2 EXOFS_DBGMSG */ |
| 32 | |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 33 | void exofs_make_credential(u8 cred_a[OSD_CAP_LEN], const struct osd_obj_id *obj) |
| 34 | { |
| 35 | osd_sec_init_nosec_doall_caps(cred_a, obj, false, true); |
| 36 | } |
| 37 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 38 | int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj, |
| 39 | u64 offset, void *p, unsigned length) |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 40 | { |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 41 | struct osd_request *or = osd_start_request(od, GFP_KERNEL); |
| 42 | /* struct osd_sense_info osi = {.key = 0};*/ |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 43 | int ret; |
| 44 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 45 | if (unlikely(!or)) { |
| 46 | EXOFS_DBGMSG("%s: osd_start_request failed.\n", __func__); |
| 47 | return -ENOMEM; |
| 48 | } |
| 49 | ret = osd_req_read_kern(or, obj, offset, p, length); |
| 50 | if (unlikely(ret)) { |
| 51 | EXOFS_DBGMSG("%s: osd_req_read_kern failed.\n", __func__); |
| 52 | goto out; |
| 53 | } |
| 54 | |
| 55 | ret = osd_finalize_request(or, 0, cred, NULL); |
| 56 | if (unlikely(ret)) { |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 57 | EXOFS_DBGMSG("Faild to osd_finalize_request() => %d\n", ret); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 58 | goto out; |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 59 | } |
| 60 | |
| 61 | ret = osd_execute_request(or); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 62 | if (unlikely(ret)) |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 63 | EXOFS_DBGMSG("osd_execute_request() => %d\n", ret); |
| 64 | /* osd_req_decode_sense(or, ret); */ |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 65 | |
| 66 | out: |
| 67 | osd_end_request(or); |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 68 | return ret; |
| 69 | } |
| 70 | |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 71 | int exofs_get_io_state(struct exofs_layout *layout, |
| 72 | struct exofs_io_state **pios) |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 73 | { |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 74 | struct exofs_io_state *ios; |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 75 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 76 | /*TODO: Maybe use kmem_cach per sbi of size |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 77 | * exofs_io_state_size(layout->s_numdevs) |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 78 | */ |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 79 | ios = kzalloc(exofs_io_state_size(layout->s_numdevs), GFP_KERNEL); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 80 | if (unlikely(!ios)) { |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 81 | EXOFS_DBGMSG("Faild kzalloc bytes=%d\n", |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 82 | exofs_io_state_size(layout->s_numdevs)); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 83 | *pios = NULL; |
| 84 | return -ENOMEM; |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 85 | } |
| 86 | |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 87 | ios->layout = layout; |
| 88 | ios->obj.partition = layout->s_pid; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 89 | *pios = ios; |
| 90 | return 0; |
| 91 | } |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 92 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 93 | void exofs_put_io_state(struct exofs_io_state *ios) |
| 94 | { |
| 95 | if (ios) { |
| 96 | unsigned i; |
| 97 | |
| 98 | for (i = 0; i < ios->numdevs; i++) { |
| 99 | struct exofs_per_dev_state *per_dev = &ios->per_dev[i]; |
| 100 | |
| 101 | if (per_dev->or) |
| 102 | osd_end_request(per_dev->or); |
| 103 | if (per_dev->bio) |
| 104 | bio_put(per_dev->bio); |
| 105 | } |
| 106 | |
| 107 | kfree(ios); |
| 108 | } |
| 109 | } |
| 110 | |
Boaz Harrosh | d9c740d | 2010-01-28 11:58:08 +0200 | [diff] [blame] | 111 | unsigned exofs_layout_od_id(struct exofs_layout *layout, |
| 112 | osd_id obj_no, unsigned layout_index) |
| 113 | { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 114 | /* switch (layout->lay_func) { |
| 115 | case LAYOUT_MOVING_WINDOW: |
| 116 | {*/ |
| 117 | unsigned dev_mod = obj_no; |
| 118 | |
| 119 | return (layout_index + dev_mod * layout->mirrors_p1) % |
| 120 | layout->s_numdevs; |
| 121 | /* } |
| 122 | case LAYOUT_FUNC_IMPLICT: |
| 123 | return layout->devs[layout_index]; |
| 124 | }*/ |
Boaz Harrosh | d9c740d | 2010-01-28 11:58:08 +0200 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | static inline struct osd_dev *exofs_ios_od(struct exofs_io_state *ios, |
| 128 | unsigned layout_index) |
| 129 | { |
| 130 | return ios->layout->s_ods[ |
| 131 | exofs_layout_od_id(ios->layout, ios->obj.id, layout_index)]; |
| 132 | } |
| 133 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 134 | static void _sync_done(struct exofs_io_state *ios, void *p) |
| 135 | { |
| 136 | struct completion *waiting = p; |
| 137 | |
| 138 | complete(waiting); |
| 139 | } |
| 140 | |
| 141 | static void _last_io(struct kref *kref) |
| 142 | { |
| 143 | struct exofs_io_state *ios = container_of( |
| 144 | kref, struct exofs_io_state, kref); |
| 145 | |
| 146 | ios->done(ios, ios->private); |
| 147 | } |
| 148 | |
| 149 | static void _done_io(struct osd_request *or, void *p) |
| 150 | { |
| 151 | struct exofs_io_state *ios = p; |
| 152 | |
| 153 | kref_put(&ios->kref, _last_io); |
| 154 | } |
| 155 | |
| 156 | static int exofs_io_execute(struct exofs_io_state *ios) |
| 157 | { |
| 158 | DECLARE_COMPLETION_ONSTACK(wait); |
| 159 | bool sync = (ios->done == NULL); |
| 160 | int i, ret; |
| 161 | |
| 162 | if (sync) { |
| 163 | ios->done = _sync_done; |
| 164 | ios->private = &wait; |
| 165 | } |
| 166 | |
| 167 | for (i = 0; i < ios->numdevs; i++) { |
| 168 | struct osd_request *or = ios->per_dev[i].or; |
| 169 | if (unlikely(!or)) |
| 170 | continue; |
| 171 | |
| 172 | ret = osd_finalize_request(or, 0, ios->cred, NULL); |
| 173 | if (unlikely(ret)) { |
| 174 | EXOFS_DBGMSG("Faild to osd_finalize_request() => %d\n", |
| 175 | ret); |
| 176 | return ret; |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | kref_init(&ios->kref); |
| 181 | |
| 182 | for (i = 0; i < ios->numdevs; i++) { |
| 183 | struct osd_request *or = ios->per_dev[i].or; |
| 184 | if (unlikely(!or)) |
| 185 | continue; |
| 186 | |
| 187 | kref_get(&ios->kref); |
| 188 | osd_execute_request_async(or, _done_io, ios); |
| 189 | } |
| 190 | |
| 191 | kref_put(&ios->kref, _last_io); |
| 192 | ret = 0; |
| 193 | |
| 194 | if (sync) { |
| 195 | wait_for_completion(&wait); |
| 196 | ret = exofs_check_io(ios, NULL); |
| 197 | } |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 198 | return ret; |
| 199 | } |
| 200 | |
Boaz Harrosh | 22ddc55 | 2010-01-19 19:24:45 +0200 | [diff] [blame] | 201 | static void _clear_bio(struct bio *bio) |
| 202 | { |
| 203 | struct bio_vec *bv; |
| 204 | unsigned i; |
| 205 | |
| 206 | __bio_for_each_segment(bv, bio, i, 0) { |
| 207 | unsigned this_count = bv->bv_len; |
| 208 | |
| 209 | if (likely(PAGE_SIZE == this_count)) |
| 210 | clear_highpage(bv->bv_page); |
| 211 | else |
| 212 | zero_user(bv->bv_page, bv->bv_offset, this_count); |
| 213 | } |
| 214 | } |
| 215 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 216 | int exofs_check_io(struct exofs_io_state *ios, u64 *resid) |
| 217 | { |
| 218 | enum osd_err_priority acumulated_osd_err = 0; |
| 219 | int acumulated_lin_err = 0; |
| 220 | int i; |
| 221 | |
| 222 | for (i = 0; i < ios->numdevs; i++) { |
| 223 | struct osd_sense_info osi; |
Boaz Harrosh | 22ddc55 | 2010-01-19 19:24:45 +0200 | [diff] [blame] | 224 | struct osd_request *or = ios->per_dev[i].or; |
| 225 | int ret; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 226 | |
Boaz Harrosh | 22ddc55 | 2010-01-19 19:24:45 +0200 | [diff] [blame] | 227 | if (unlikely(!or)) |
| 228 | continue; |
| 229 | |
| 230 | ret = osd_req_decode_sense(or, &osi); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 231 | if (likely(!ret)) |
| 232 | continue; |
| 233 | |
Boaz Harrosh | 22ddc55 | 2010-01-19 19:24:45 +0200 | [diff] [blame] | 234 | if (OSD_ERR_PRI_CLEAR_PAGES == osi.osd_err_pri) { |
| 235 | /* start read offset passed endof file */ |
| 236 | _clear_bio(ios->per_dev[i].bio); |
| 237 | EXOFS_DBGMSG("start read offset passed end of file " |
| 238 | "offset=0x%llx, length=0x%llx\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 239 | _LLU(ios->per_dev[i].offset), |
| 240 | _LLU(ios->per_dev[i].length)); |
Boaz Harrosh | 22ddc55 | 2010-01-19 19:24:45 +0200 | [diff] [blame] | 241 | |
| 242 | continue; /* we recovered */ |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 243 | } |
| 244 | |
| 245 | if (osi.osd_err_pri >= acumulated_osd_err) { |
| 246 | acumulated_osd_err = osi.osd_err_pri; |
| 247 | acumulated_lin_err = ret; |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | /* TODO: raid specific residual calculations */ |
| 252 | if (resid) { |
| 253 | if (likely(!acumulated_lin_err)) |
| 254 | *resid = 0; |
| 255 | else |
| 256 | *resid = ios->length; |
| 257 | } |
| 258 | |
| 259 | return acumulated_lin_err; |
| 260 | } |
| 261 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 262 | /* REMOVEME: After review |
| 263 | Some quoteing from the standard |
| 264 | |
| 265 | L = logical offset into the file |
| 266 | W = number of data components in a stripe |
| 267 | S = W * stripe_unit (S is Stripe length) |
| 268 | N = L / S (N is the stripe Number) |
| 269 | C = (L-(N*S)) / stripe_unit (C is the component) |
| 270 | O = (N*stripe_unit)+(L%stripe_unit) (O is the object's offset) |
| 271 | */ |
| 272 | |
| 273 | static void _offset_dev_unit_off(struct exofs_io_state *ios, u64 file_offset, |
| 274 | u64 *obj_offset, unsigned *dev, unsigned *unit_off) |
| 275 | { |
| 276 | unsigned stripe_unit = ios->layout->stripe_unit; |
| 277 | unsigned stripe_length = stripe_unit * ios->layout->group_width; |
| 278 | u64 stripe_no = file_offset; |
| 279 | unsigned stripe_mod = do_div(stripe_no, stripe_length); |
| 280 | |
| 281 | *unit_off = stripe_mod % stripe_unit; |
| 282 | *obj_offset = stripe_no * stripe_unit + *unit_off; |
| 283 | *dev = stripe_mod / stripe_unit * ios->layout->mirrors_p1; |
| 284 | } |
| 285 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 286 | static int _add_stripe_unit(struct exofs_io_state *ios, unsigned *cur_pg, |
| 287 | unsigned pgbase, struct exofs_per_dev_state *per_dev, |
| 288 | int cur_len) |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 289 | { |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 290 | unsigned pg = *cur_pg; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 291 | struct request_queue *q = |
| 292 | osd_request_queue(exofs_ios_od(ios, per_dev->dev)); |
| 293 | |
| 294 | per_dev->length += cur_len; |
| 295 | |
| 296 | if (per_dev->bio == NULL) { |
| 297 | unsigned pages_in_stripe = ios->layout->group_width * |
| 298 | (ios->layout->stripe_unit / PAGE_SIZE); |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 299 | unsigned bio_size = (ios->nr_pages + pages_in_stripe) / |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 300 | ios->layout->group_width; |
| 301 | |
| 302 | per_dev->bio = bio_kmalloc(GFP_KERNEL, bio_size); |
| 303 | if (unlikely(!per_dev->bio)) { |
| 304 | EXOFS_DBGMSG("Faild to allocate BIO size=%u\n", |
| 305 | bio_size); |
| 306 | return -ENOMEM; |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | while (cur_len > 0) { |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 311 | unsigned pglen = min_t(unsigned, PAGE_SIZE - pgbase, cur_len); |
| 312 | unsigned added_len; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 313 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 314 | BUG_ON(ios->nr_pages <= pg); |
| 315 | cur_len -= pglen; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 316 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 317 | added_len = bio_add_pc_page(q, per_dev->bio, ios->pages[pg], |
| 318 | pglen, pgbase); |
| 319 | if (unlikely(pglen != added_len)) |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 320 | return -ENOMEM; |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 321 | pgbase = 0; |
| 322 | ++pg; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 323 | } |
| 324 | BUG_ON(cur_len); |
| 325 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 326 | *cur_pg = pg; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 327 | return 0; |
| 328 | } |
| 329 | |
| 330 | static int _prepare_for_striping(struct exofs_io_state *ios) |
| 331 | { |
| 332 | u64 length = ios->length; |
| 333 | u64 offset = ios->offset; |
| 334 | unsigned stripe_unit = ios->layout->stripe_unit; |
| 335 | unsigned comp = 0; |
| 336 | unsigned stripes = 0; |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 337 | unsigned cur_pg = 0; |
| 338 | int ret = 0; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 339 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 340 | if (!ios->pages) { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 341 | if (ios->kern_buff) { |
| 342 | struct exofs_per_dev_state *per_dev = &ios->per_dev[0]; |
| 343 | unsigned unit_off; |
| 344 | |
| 345 | _offset_dev_unit_off(ios, offset, &per_dev->offset, |
| 346 | &per_dev->dev, &unit_off); |
| 347 | /* no cross device without page array */ |
| 348 | BUG_ON((ios->layout->group_width > 1) && |
| 349 | (unit_off + length > stripe_unit)); |
| 350 | } |
| 351 | ios->numdevs = ios->layout->mirrors_p1; |
| 352 | return 0; |
| 353 | } |
| 354 | |
| 355 | while (length) { |
| 356 | struct exofs_per_dev_state *per_dev = &ios->per_dev[comp]; |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 357 | unsigned cur_len, page_off; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 358 | |
| 359 | if (!per_dev->length) { |
| 360 | unsigned unit_off; |
| 361 | |
| 362 | _offset_dev_unit_off(ios, offset, &per_dev->offset, |
| 363 | &per_dev->dev, &unit_off); |
| 364 | stripes++; |
| 365 | cur_len = min_t(u64, stripe_unit - unit_off, length); |
| 366 | offset += cur_len; |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 367 | page_off = unit_off & ~PAGE_MASK; |
| 368 | BUG_ON(page_off != ios->pgbase); |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 369 | } else { |
| 370 | cur_len = min_t(u64, stripe_unit, length); |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 371 | page_off = 0; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 372 | } |
| 373 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 374 | ret = _add_stripe_unit(ios, &cur_pg, page_off , per_dev, |
| 375 | cur_len); |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 376 | if (unlikely(ret)) |
| 377 | goto out; |
| 378 | |
| 379 | comp += ios->layout->mirrors_p1; |
| 380 | comp %= ios->layout->s_numdevs; |
| 381 | |
| 382 | length -= cur_len; |
| 383 | } |
| 384 | out: |
| 385 | ios->numdevs = stripes * ios->layout->mirrors_p1; |
| 386 | return ret; |
| 387 | } |
| 388 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 389 | int exofs_sbi_create(struct exofs_io_state *ios) |
| 390 | { |
| 391 | int i, ret; |
| 392 | |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 393 | for (i = 0; i < ios->layout->s_numdevs; i++) { |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 394 | struct osd_request *or; |
| 395 | |
Boaz Harrosh | d9c740d | 2010-01-28 11:58:08 +0200 | [diff] [blame] | 396 | or = osd_start_request(exofs_ios_od(ios, i), GFP_KERNEL); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 397 | if (unlikely(!or)) { |
| 398 | EXOFS_ERR("%s: osd_start_request failed\n", __func__); |
| 399 | ret = -ENOMEM; |
| 400 | goto out; |
| 401 | } |
| 402 | ios->per_dev[i].or = or; |
| 403 | ios->numdevs++; |
| 404 | |
| 405 | osd_req_create_object(or, &ios->obj); |
| 406 | } |
| 407 | ret = exofs_io_execute(ios); |
| 408 | |
| 409 | out: |
| 410 | return ret; |
| 411 | } |
| 412 | |
| 413 | int exofs_sbi_remove(struct exofs_io_state *ios) |
| 414 | { |
| 415 | int i, ret; |
| 416 | |
Boaz Harrosh | 45d3abc | 2010-01-28 11:46:16 +0200 | [diff] [blame] | 417 | for (i = 0; i < ios->layout->s_numdevs; i++) { |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 418 | struct osd_request *or; |
| 419 | |
Boaz Harrosh | d9c740d | 2010-01-28 11:58:08 +0200 | [diff] [blame] | 420 | or = osd_start_request(exofs_ios_od(ios, i), GFP_KERNEL); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 421 | if (unlikely(!or)) { |
| 422 | EXOFS_ERR("%s: osd_start_request failed\n", __func__); |
| 423 | ret = -ENOMEM; |
| 424 | goto out; |
| 425 | } |
| 426 | ios->per_dev[i].or = or; |
| 427 | ios->numdevs++; |
| 428 | |
| 429 | osd_req_remove_object(or, &ios->obj); |
| 430 | } |
| 431 | ret = exofs_io_execute(ios); |
| 432 | |
| 433 | out: |
| 434 | return ret; |
| 435 | } |
| 436 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 437 | static int _sbi_write_mirror(struct exofs_io_state *ios, int cur_comp) |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 438 | { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 439 | struct exofs_per_dev_state *master_dev = &ios->per_dev[cur_comp]; |
| 440 | unsigned dev = ios->per_dev[cur_comp].dev; |
| 441 | unsigned last_comp = cur_comp + ios->layout->mirrors_p1; |
| 442 | int ret = 0; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 443 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 444 | for (; cur_comp < last_comp; ++cur_comp, ++dev) { |
| 445 | struct exofs_per_dev_state *per_dev = &ios->per_dev[cur_comp]; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 446 | struct osd_request *or; |
| 447 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 448 | or = osd_start_request(exofs_ios_od(ios, dev), GFP_KERNEL); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 449 | if (unlikely(!or)) { |
| 450 | EXOFS_ERR("%s: osd_start_request failed\n", __func__); |
| 451 | ret = -ENOMEM; |
| 452 | goto out; |
| 453 | } |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 454 | per_dev->or = or; |
| 455 | per_dev->offset = master_dev->offset; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 456 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 457 | if (ios->pages) { |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 458 | struct bio *bio; |
| 459 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 460 | if (per_dev != master_dev) { |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 461 | bio = bio_kmalloc(GFP_KERNEL, |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 462 | master_dev->bio->bi_max_vecs); |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 463 | if (unlikely(!bio)) { |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 464 | EXOFS_DBGMSG( |
| 465 | "Faild to allocate BIO size=%u\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 466 | master_dev->bio->bi_max_vecs); |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 467 | ret = -ENOMEM; |
| 468 | goto out; |
| 469 | } |
| 470 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 471 | __bio_clone(bio, master_dev->bio); |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 472 | bio->bi_bdev = NULL; |
| 473 | bio->bi_next = NULL; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 474 | per_dev->length = master_dev->length; |
| 475 | per_dev->bio = bio; |
| 476 | per_dev->dev = dev; |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 477 | } else { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 478 | bio = master_dev->bio; |
| 479 | /* FIXME: bio_set_dir() */ |
| 480 | bio->bi_rw |= (1 << BIO_RW); |
Boaz Harrosh | 04dc1e8 | 2009-11-16 16:03:05 +0200 | [diff] [blame] | 481 | } |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 482 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 483 | osd_req_write(or, &ios->obj, per_dev->offset, bio, |
| 484 | per_dev->length); |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 485 | EXOFS_DBGMSG("write(0x%llx) offset=0x%llx " |
| 486 | "length=0x%llx dev=%d\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 487 | _LLU(ios->obj.id), _LLU(per_dev->offset), |
| 488 | _LLU(per_dev->length), dev); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 489 | } else if (ios->kern_buff) { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 490 | ret = osd_req_write_kern(or, &ios->obj, per_dev->offset, |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 491 | ios->kern_buff, ios->length); |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 492 | if (unlikely(ret)) |
| 493 | goto out; |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 494 | EXOFS_DBGMSG2("write_kern(0x%llx) offset=0x%llx " |
| 495 | "length=0x%llx dev=%d\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 496 | _LLU(ios->obj.id), _LLU(per_dev->offset), |
| 497 | _LLU(ios->length), dev); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 498 | } else { |
| 499 | osd_req_set_attributes(or, &ios->obj); |
Boaz Harrosh | 34ce4e7 | 2009-12-15 19:34:17 +0200 | [diff] [blame] | 500 | EXOFS_DBGMSG2("obj(0x%llx) set_attributes=%d dev=%d\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 501 | _LLU(ios->obj.id), ios->out_attr_len, dev); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 502 | } |
| 503 | |
| 504 | if (ios->out_attr) |
| 505 | osd_req_add_set_attr_list(or, ios->out_attr, |
| 506 | ios->out_attr_len); |
| 507 | |
| 508 | if (ios->in_attr) |
| 509 | osd_req_add_get_attr_list(or, ios->in_attr, |
| 510 | ios->in_attr_len); |
| 511 | } |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 512 | |
| 513 | out: |
| 514 | return ret; |
| 515 | } |
| 516 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 517 | int exofs_sbi_write(struct exofs_io_state *ios) |
| 518 | { |
| 519 | int i; |
| 520 | int ret; |
| 521 | |
| 522 | ret = _prepare_for_striping(ios); |
| 523 | if (unlikely(ret)) |
| 524 | return ret; |
| 525 | |
| 526 | for (i = 0; i < ios->numdevs; i += ios->layout->mirrors_p1) { |
| 527 | ret = _sbi_write_mirror(ios, i); |
| 528 | if (unlikely(ret)) |
| 529 | return ret; |
| 530 | } |
| 531 | |
| 532 | ret = exofs_io_execute(ios); |
| 533 | return ret; |
| 534 | } |
| 535 | |
| 536 | static int _sbi_read_mirror(struct exofs_io_state *ios, unsigned cur_comp) |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 537 | { |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 538 | struct osd_request *or; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 539 | struct exofs_per_dev_state *per_dev = &ios->per_dev[cur_comp]; |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 540 | unsigned first_dev = (unsigned)ios->obj.id; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 541 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 542 | first_dev = per_dev->dev + first_dev % ios->layout->mirrors_p1; |
Boaz Harrosh | d9c740d | 2010-01-28 11:58:08 +0200 | [diff] [blame] | 543 | or = osd_start_request(exofs_ios_od(ios, first_dev), GFP_KERNEL); |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 544 | if (unlikely(!or)) { |
| 545 | EXOFS_ERR("%s: osd_start_request failed\n", __func__); |
| 546 | return -ENOMEM; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 547 | } |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 548 | per_dev->or = or; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 549 | |
Boaz Harrosh | 86093aa | 2010-01-28 18:24:06 +0200 | [diff] [blame^] | 550 | if (ios->pages) { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 551 | osd_req_read(or, &ios->obj, per_dev->offset, |
| 552 | per_dev->bio, per_dev->length); |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 553 | EXOFS_DBGMSG("read(0x%llx) offset=0x%llx length=0x%llx" |
| 554 | " dev=%d\n", _LLU(ios->obj.id), |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 555 | _LLU(per_dev->offset), _LLU(per_dev->length), |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 556 | first_dev); |
| 557 | } else if (ios->kern_buff) { |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 558 | int ret = osd_req_read_kern(or, &ios->obj, per_dev->offset, |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 559 | ios->kern_buff, ios->length); |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 560 | EXOFS_DBGMSG2("read_kern(0x%llx) offset=0x%llx " |
| 561 | "length=0x%llx dev=%d ret=>%d\n", |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 562 | _LLU(ios->obj.id), _LLU(per_dev->offset), |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 563 | _LLU(ios->length), first_dev, ret); |
| 564 | if (unlikely(ret)) |
| 565 | return ret; |
| 566 | } else { |
| 567 | osd_req_get_attributes(or, &ios->obj); |
| 568 | EXOFS_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n", |
| 569 | _LLU(ios->obj.id), ios->in_attr_len, first_dev); |
| 570 | } |
Boaz Harrosh | 46f4d97 | 2010-02-01 11:37:30 +0200 | [diff] [blame] | 571 | if (ios->out_attr) |
| 572 | osd_req_add_set_attr_list(or, ios->out_attr, ios->out_attr_len); |
| 573 | |
| 574 | if (ios->in_attr) |
| 575 | osd_req_add_get_attr_list(or, ios->in_attr, ios->in_attr_len); |
| 576 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 577 | return 0; |
| 578 | } |
| 579 | |
| 580 | int exofs_sbi_read(struct exofs_io_state *ios) |
| 581 | { |
| 582 | int i; |
| 583 | int ret; |
| 584 | |
| 585 | ret = _prepare_for_striping(ios); |
| 586 | if (unlikely(ret)) |
| 587 | return ret; |
| 588 | |
| 589 | for (i = 0; i < ios->numdevs; i += ios->layout->mirrors_p1) { |
| 590 | ret = _sbi_read_mirror(ios, i); |
| 591 | if (unlikely(ret)) |
| 592 | return ret; |
| 593 | } |
| 594 | |
| 595 | ret = exofs_io_execute(ios); |
| 596 | return ret; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 597 | } |
| 598 | |
| 599 | int extract_attr_from_ios(struct exofs_io_state *ios, struct osd_attr *attr) |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 600 | { |
| 601 | struct osd_attr cur_attr = {.attr_page = 0}; /* start with zeros */ |
| 602 | void *iter = NULL; |
| 603 | int nelem; |
| 604 | |
| 605 | do { |
| 606 | nelem = 1; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 607 | osd_req_decode_get_attr_list(ios->per_dev[0].or, |
| 608 | &cur_attr, &nelem, &iter); |
Boaz Harrosh | b14f8ab | 2008-10-27 18:27:55 +0200 | [diff] [blame] | 609 | if ((cur_attr.attr_page == attr->attr_page) && |
| 610 | (cur_attr.attr_id == attr->attr_id)) { |
| 611 | attr->len = cur_attr.len; |
| 612 | attr->val_ptr = cur_attr.val_ptr; |
| 613 | return 0; |
| 614 | } |
| 615 | } while (iter); |
| 616 | |
| 617 | return -EIO; |
| 618 | } |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 619 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 620 | static int _truncate_mirrors(struct exofs_io_state *ios, unsigned cur_comp, |
| 621 | struct osd_attr *attr) |
| 622 | { |
| 623 | int last_comp = cur_comp + ios->layout->mirrors_p1; |
| 624 | |
| 625 | for (; cur_comp < last_comp; ++cur_comp) { |
| 626 | struct exofs_per_dev_state *per_dev = &ios->per_dev[cur_comp]; |
| 627 | struct osd_request *or; |
| 628 | |
| 629 | or = osd_start_request(exofs_ios_od(ios, cur_comp), GFP_KERNEL); |
| 630 | if (unlikely(!or)) { |
| 631 | EXOFS_ERR("%s: osd_start_request failed\n", __func__); |
| 632 | return -ENOMEM; |
| 633 | } |
| 634 | per_dev->or = or; |
| 635 | |
| 636 | osd_req_set_attributes(or, &ios->obj); |
| 637 | osd_req_add_set_attr_list(or, attr, 1); |
| 638 | } |
| 639 | |
| 640 | return 0; |
| 641 | } |
| 642 | |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 643 | int exofs_oi_truncate(struct exofs_i_info *oi, u64 size) |
| 644 | { |
| 645 | struct exofs_sb_info *sbi = oi->vfs_inode.i_sb->s_fs_info; |
| 646 | struct exofs_io_state *ios; |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 647 | struct exofs_trunc_attr { |
| 648 | struct osd_attr attr; |
| 649 | __be64 newsize; |
| 650 | } *size_attrs; |
| 651 | u64 this_obj_size; |
| 652 | unsigned dev; |
| 653 | unsigned unit_off; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 654 | int i, ret; |
| 655 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 656 | ret = exofs_get_io_state(&sbi->layout, &ios); |
| 657 | if (unlikely(ret)) |
| 658 | return ret; |
| 659 | |
| 660 | size_attrs = kcalloc(ios->layout->group_width, sizeof(*size_attrs), |
| 661 | GFP_KERNEL); |
| 662 | if (unlikely(!size_attrs)) { |
| 663 | ret = -ENOMEM; |
| 664 | goto out; |
| 665 | } |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 666 | |
| 667 | ios->obj.id = exofs_oi_objno(oi); |
| 668 | ios->cred = oi->i_cred; |
| 669 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 670 | ios->numdevs = ios->layout->s_numdevs; |
| 671 | _offset_dev_unit_off(ios, size, &this_obj_size, &dev, &unit_off); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 672 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 673 | for (i = 0; i < ios->layout->group_width; ++i) { |
| 674 | struct exofs_trunc_attr *size_attr = &size_attrs[i]; |
| 675 | u64 obj_size; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 676 | |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 677 | if (i < dev) |
| 678 | obj_size = this_obj_size + |
| 679 | ios->layout->stripe_unit - unit_off; |
| 680 | else if (i == dev) |
| 681 | obj_size = this_obj_size; |
| 682 | else /* i > dev */ |
| 683 | obj_size = this_obj_size - unit_off; |
| 684 | |
| 685 | size_attr->newsize = cpu_to_be64(obj_size); |
| 686 | size_attr->attr = g_attr_logical_length; |
| 687 | size_attr->attr.val_ptr = &size_attr->newsize; |
| 688 | |
| 689 | ret = _truncate_mirrors(ios, i * ios->layout->mirrors_p1, |
| 690 | &size_attr->attr); |
| 691 | if (unlikely(ret)) |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 692 | goto out; |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 693 | } |
| 694 | ret = exofs_io_execute(ios); |
| 695 | |
| 696 | out: |
Boaz Harrosh | 5d952b8 | 2010-02-01 13:35:51 +0200 | [diff] [blame] | 697 | kfree(size_attrs); |
Boaz Harrosh | 06886a5 | 2009-11-08 14:54:08 +0200 | [diff] [blame] | 698 | exofs_put_io_state(ios); |
| 699 | return ret; |
| 700 | } |