summaryrefslogtreecommitdiff
path: root/fs/exofs/ios.c
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2010-02-01 12:37:30 +0300
committerBoaz Harrosh <bharrosh@panasas.com>2010-02-28 14:35:27 +0300
commit46f4d973f6874c06b7a41a3bf8f4c1717d90f97a (patch)
tree49242195a5e275c25c8e73a09c6b9756f8e18d27 /fs/exofs/ios.c
parent45d3abcb1a7388b2b97582e13bf9dd21784dcaa5 (diff)
downloadlinux-46f4d973f6874c06b7a41a3bf8f4c1717d90f97a.tar.xz
exofs: unindent exofs_sbi_read
The original idea was that a mirror read can be sub-divided to multiple devices. But this has very little gain and only at very large IOes so it's not going to be implemented soon. Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/exofs/ios.c')
-rw-r--r--fs/exofs/ios.c87
1 files changed, 38 insertions, 49 deletions
diff --git a/fs/exofs/ios.c b/fs/exofs/ios.c
index 83e54a77b992..4f679317ca54 100644
--- a/fs/exofs/ios.c
+++ b/fs/exofs/ios.c
@@ -356,59 +356,48 @@ out:
int exofs_sbi_read(struct exofs_io_state *ios)
{
- int i, ret;
-
- for (i = 0; i < 1; i++) {
- struct osd_request *or;
- unsigned first_dev = (unsigned)ios->obj.id;
-
- first_dev %= ios->layout->s_numdevs;
- or = osd_start_request(ios->layout->s_ods[first_dev],
- GFP_KERNEL);
- if (unlikely(!or)) {
- EXOFS_ERR("%s: osd_start_request failed\n", __func__);
- ret = -ENOMEM;
- goto out;
- }
- ios->per_dev[i].or = or;
- ios->numdevs++;
+ struct osd_request *or;
+ struct exofs_per_dev_state *per_dev = &ios->per_dev[0];
+ unsigned first_dev = (unsigned)ios->obj.id;
- if (ios->bio) {
- osd_req_read(or, &ios->obj, ios->offset, ios->bio,
- ios->length);
- EXOFS_DBGMSG("read(0x%llx) offset=0x%llx length=0x%llx"
- " dev=%d\n", _LLU(ios->obj.id),
- _LLU(ios->offset),
- _LLU(ios->length),
- first_dev);
- } else if (ios->kern_buff) {
- osd_req_read_kern(or, &ios->obj, ios->offset,
- ios->kern_buff, ios->length);
- EXOFS_DBGMSG2("read_kern(0x%llx) offset=0x%llx "
- "length=0x%llx dev=%d\n",
- _LLU(ios->obj.id),
- _LLU(ios->offset),
- _LLU(ios->length),
- first_dev);
- } else {
- osd_req_get_attributes(or, &ios->obj);
- EXOFS_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n",
- _LLU(ios->obj.id), ios->in_attr_len,
- first_dev);
- }
+ first_dev %= ios->layout->s_numdevs;
+ or = osd_start_request(ios->layout->s_ods[first_dev], GFP_KERNEL);
+ if (unlikely(!or)) {
+ EXOFS_ERR("%s: osd_start_request failed\n", __func__);
+ return -ENOMEM;
+ }
+ per_dev->or = or;
+ ios->numdevs++;
+
+ if (ios->bio) {
+ osd_req_read(or, &ios->obj, ios->offset, ios->bio, ios->length);
+ EXOFS_DBGMSG("read(0x%llx) offset=0x%llx length=0x%llx"
+ " dev=%d\n", _LLU(ios->obj.id),
+ _LLU(ios->offset), _LLU(ios->length),
+ first_dev);
+ } else if (ios->kern_buff) {
+ int ret = osd_req_read_kern(or, &ios->obj, ios->offset,
+ ios->kern_buff, ios->length);
+
+ EXOFS_DBGMSG2("read_kern(0x%llx) offset=0x%llx "
+ "length=0x%llx dev=%d ret=>%d\n",
+ _LLU(ios->obj.id), _LLU(ios->offset),
+ _LLU(ios->length), first_dev, ret);
+ if (unlikely(ret))
+ return ret;
+ } else {
+ osd_req_get_attributes(or, &ios->obj);
+ EXOFS_DBGMSG2("obj(0x%llx) get_attributes=%d dev=%d\n",
+ _LLU(ios->obj.id), ios->in_attr_len, first_dev);
+ }
- if (ios->out_attr)
- osd_req_add_set_attr_list(or, ios->out_attr,
- ios->out_attr_len);
+ if (ios->out_attr)
+ osd_req_add_set_attr_list(or, ios->out_attr, ios->out_attr_len);
- if (ios->in_attr)
- osd_req_add_get_attr_list(or, ios->in_attr,
- ios->in_attr_len);
- }
- ret = exofs_io_execute(ios);
+ if (ios->in_attr)
+ osd_req_add_get_attr_list(or, ios->in_attr, ios->in_attr_len);
-out:
- return ret;
+ return exofs_io_execute(ios);
}
int extract_attr_from_ios(struct exofs_io_state *ios, struct osd_attr *attr)