]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/exofs/ios.c
fs/exofs: typo fix of faild to failed
[net-next-2.6.git] / fs / exofs / ios.c
index 5bb47373c7e0c6474df346611c9e7ae408a49249..f74a2ec027a643cf9685840fe4a148ab444335d1 100644 (file)
@@ -55,7 +55,7 @@ int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj,
 
        ret = osd_finalize_request(or, 0, cred, NULL);
        if (unlikely(ret)) {
-               EXOFS_DBGMSG("Faild to osd_finalize_request() => %d\n", ret);
+               EXOFS_DBGMSG("Failed to osd_finalize_request() => %d\n", ret);
                goto out;
        }
 
@@ -79,7 +79,7 @@ int exofs_get_io_state(struct exofs_layout *layout,
         */
        ios = kzalloc(exofs_io_state_size(layout->s_numdevs), GFP_KERNEL);
        if (unlikely(!ios)) {
-               EXOFS_DBGMSG("Faild kzalloc bytes=%d\n",
+               EXOFS_DBGMSG("Failed kzalloc bytes=%d\n",
                             exofs_io_state_size(layout->s_numdevs));
                *pios = NULL;
                return -ENOMEM;
@@ -172,7 +172,7 @@ static int exofs_io_execute(struct exofs_io_state *ios)
 
                ret = osd_finalize_request(or, 0, ios->cred, NULL);
                if (unlikely(ret)) {
-                       EXOFS_DBGMSG("Faild to osd_finalize_request() => %d\n",
+                       EXOFS_DBGMSG("Failed to osd_finalize_request() => %d\n",
                                     ret);
                        return ret;
                }
@@ -305,8 +305,6 @@ int exofs_check_io(struct exofs_io_state *ios, u64 *resid)
 struct _striping_info {
        u64 obj_offset;
        u64 group_length;
-       u64 total_group_length;
-       u64 Major;
        unsigned dev;
        unsigned unit_off;
 };
@@ -343,8 +341,6 @@ static void _calc_stripe_info(struct exofs_io_state *ios, u64 file_offset,
                                  (M * group_depth * stripe_unit);
 
        si->group_length = T - H;
-       si->total_group_length = T;
-       si->Major = M;
 }
 
 static int _add_stripe_unit(struct exofs_io_state *ios,  unsigned *cur_pg,
@@ -365,7 +361,7 @@ static int _add_stripe_unit(struct exofs_io_state *ios,  unsigned *cur_pg,
 
                per_dev->bio = bio_kmalloc(GFP_KERNEL, bio_size);
                if (unlikely(!per_dev->bio)) {
-                       EXOFS_DBGMSG("Faild to allocate BIO size=%u\n",
+                       EXOFS_DBGMSG("Failed to allocate BIO size=%u\n",
                                     bio_size);
                        return -ENOMEM;
                }
@@ -450,17 +446,15 @@ out:
 static int _prepare_for_striping(struct exofs_io_state *ios)
 {
        u64 length = ios->length;
+       u64 offset = ios->offset;
        struct _striping_info si;
-       unsigned devs_in_group = ios->layout->group_width *
-                                ios->layout->mirrors_p1;
        int ret = 0;
 
-       _calc_stripe_info(ios, ios->offset, &si);
-
        if (!ios->pages) {
                if (ios->kern_buff) {
                        struct exofs_per_dev_state *per_dev = &ios->per_dev[0];
 
+                       _calc_stripe_info(ios, ios->offset, &si);
                        per_dev->offset = si.obj_offset;
                        per_dev->dev = si.dev;
 
@@ -474,6 +468,8 @@ static int _prepare_for_striping(struct exofs_io_state *ios)
        }
 
        while (length) {
+               _calc_stripe_info(ios, offset, &si);
+
                if (length < si.group_length)
                        si.group_length = length;
 
@@ -481,16 +477,8 @@ static int _prepare_for_striping(struct exofs_io_state *ios)
                if (unlikely(ret))
                        goto out;
 
+               offset += si.group_length;
                length -= si.group_length;
-
-               si.group_length = si.total_group_length;
-               si.unit_off = 0;
-               ++si.Major;
-               si.obj_offset = si.Major * ios->layout->stripe_unit *
-                                               ios->layout->group_depth;
-
-               si.dev = (si.dev - (si.dev % devs_in_group)) + devs_in_group;
-               si.dev %= ios->layout->s_numdevs;
        }
 
 out:
@@ -576,7 +564,7 @@ static int _sbi_write_mirror(struct exofs_io_state *ios, int cur_comp)
                                                  master_dev->bio->bi_max_vecs);
                                if (unlikely(!bio)) {
                                        EXOFS_DBGMSG(
-                                             "Faild to allocate BIO size=%u\n",
+                                             "Failed to allocate BIO size=%u\n",
                                              master_dev->bio->bi_max_vecs);
                                        ret = -ENOMEM;
                                        goto out;
@@ -591,7 +579,7 @@ static int _sbi_write_mirror(struct exofs_io_state *ios, int cur_comp)
                        } else {
                                bio = master_dev->bio;
                                /* FIXME: bio_set_dir() */
-                               bio->bi_rw |= (1 << BIO_RW);
+                               bio->bi_rw |= REQ_WRITE;
                        }
 
                        osd_req_write(or, &ios->obj, per_dev->offset, bio,