exofs: Move layout related members to a layout structure
[deliverable/linux.git] / fs / exofs / inode.c
index 2afbcebeda718efa2e468d0ff03ee96cd5e10267..03189a958b3379a405342fb8702dc8ec34033a44 100644 (file)
@@ -65,7 +65,7 @@ static void _pcol_init(struct page_collect *pcol, unsigned expected_pages,
        /* Create master bios on first Q, later on cloning, each clone will be
         * allocated on it's destination Q
         */
-       pcol->req_q = osd_request_queue(sbi->s_ods[0]);
+       pcol->req_q = osd_request_queue(sbi->layout.s_ods[0]);
        pcol->inode = inode;
        pcol->expected_pages = expected_pages;
 
@@ -99,7 +99,7 @@ static int pcol_try_alloc(struct page_collect *pcol)
                          BIO_MAX_PAGES_KMALLOC);
 
        if (!pcol->ios) { /* First time allocate io_state */
-               int ret = exofs_get_io_state(pcol->sbi, &pcol->ios);
+               int ret = exofs_get_io_state(&pcol->sbi->layout, &pcol->ios);
 
                if (ret)
                        return ret;
@@ -193,7 +193,7 @@ static int __readpages_done(struct page_collect *pcol, bool do_unlock)
        else
                good_bytes = pcol->length - resid;
 
-       EXOFS_DBGMSG("readpages_done(0x%lx) good_bytes=0x%llx"
+       EXOFS_DBGMSG2("readpages_done(0x%lx) good_bytes=0x%llx"
                     " length=0x%lx nr_pages=%u\n",
                     pcol->inode->i_ino, _LLU(good_bytes), pcol->length,
                     pcol->nr_pages);
@@ -222,7 +222,7 @@ static int __readpages_done(struct page_collect *pcol, bool do_unlock)
        }
 
        pcol_free(pcol);
-       EXOFS_DBGMSG("readpages_done END\n");
+       EXOFS_DBGMSG2("readpages_done END\n");
        return ret;
 }
 
@@ -290,7 +290,7 @@ static int read_exec(struct page_collect *pcol, bool is_sync)
 
        atomic_inc(&pcol->sbi->s_curr_pending);
 
-       EXOFS_DBGMSG("read_exec obj=0x%llx start=0x%llx length=0x%lx\n",
+       EXOFS_DBGMSG2("read_exec obj=0x%llx start=0x%llx length=0x%lx\n",
                  ios->obj.id, _LLU(ios->offset), pcol->length);
 
        /* pages ownership was passed to pcol_copy */
@@ -462,7 +462,7 @@ static void writepages_done(struct exofs_io_state *ios, void *p)
        else
                good_bytes = pcol->length - resid;
 
-       EXOFS_DBGMSG("writepages_done(0x%lx) good_bytes=0x%llx"
+       EXOFS_DBGMSG2("writepages_done(0x%lx) good_bytes=0x%llx"
                     " length=0x%lx nr_pages=%u\n",
                     pcol->inode->i_ino, _LLU(good_bytes), pcol->length,
                     pcol->nr_pages);
@@ -490,7 +490,7 @@ static void writepages_done(struct exofs_io_state *ios, void *p)
 
        pcol_free(pcol);
        kfree(pcol);
-       EXOFS_DBGMSG("writepages_done END\n");
+       EXOFS_DBGMSG2("writepages_done END\n");
 }
 
 static int write_exec(struct page_collect *pcol)
@@ -527,7 +527,7 @@ static int write_exec(struct page_collect *pcol)
        }
 
        atomic_inc(&pcol->sbi->s_curr_pending);
-       EXOFS_DBGMSG("write_exec(0x%lx, 0x%llx) start=0x%llx length=0x%lx\n",
+       EXOFS_DBGMSG2("write_exec(0x%lx, 0x%llx) start=0x%llx length=0x%lx\n",
                  pcol->inode->i_ino, pcol->pg_first, _LLU(ios->offset),
                  pcol->length);
        /* pages ownership was passed to pcol_copy */
@@ -616,7 +616,7 @@ try_again:
 
        ret = pcol_add_page(pcol, page, len);
        if (unlikely(ret)) {
-               EXOFS_DBGMSG("Failed pcol_add_page "
+               EXOFS_DBGMSG2("Failed pcol_add_page "
                             "nr_pages=%u total_length=0x%lx\n",
                             pcol->nr_pages, pcol->length);
 
@@ -663,7 +663,7 @@ static int exofs_writepages(struct address_space *mapping,
        if (expected_pages < 32L)
                expected_pages = 32L;
 
-       EXOFS_DBGMSG("inode(0x%lx) wbc->start=0x%llx wbc->end=0x%llx "
+       EXOFS_DBGMSG2("inode(0x%lx) wbc->start=0x%llx wbc->end=0x%llx "
                     "nrpages=%lu start=0x%lx end=0x%lx expected_pages=%ld\n",
                     mapping->host->i_ino, wbc->range_start, wbc->range_end,
                     mapping->nrpages, start, end, expected_pages);
@@ -872,7 +872,7 @@ static int exofs_get_inode(struct super_block *sb, struct exofs_i_info *oi,
        int ret;
 
        *obj_size = ~0;
-       ret = exofs_get_io_state(sbi, &ios);
+       ret = exofs_get_io_state(&sbi->layout, &ios);
        if (unlikely(ret)) {
                EXOFS_ERR("%s: exofs_get_io_state failed.\n", __func__);
                return ret;
@@ -1043,7 +1043,7 @@ static void create_done(struct exofs_io_state *ios, void *p)
 
        if (unlikely(ret)) {
                EXOFS_ERR("object=0x%llx creation faild in pid=0x%llx",
-                         _LLU(exofs_oi_objno(oi)), _LLU(sbi->s_pid));
+                         _LLU(exofs_oi_objno(oi)), _LLU(sbi->layout.s_pid));
                /*TODO: When FS is corrupted creation can fail, object already
                 * exist. Get rid of this asynchronous creation, if exist
                 * increment the obj counter and try the next object. Until we
@@ -1104,7 +1104,7 @@ struct inode *exofs_new_inode(struct inode *dir, int mode)
 
        mark_inode_dirty(inode);
 
-       ret = exofs_get_io_state(sbi, &ios);
+       ret = exofs_get_io_state(&sbi->layout, &ios);
        if (unlikely(ret)) {
                EXOFS_ERR("exofs_new_inode: exofs_get_io_state failed\n");
                return ERR_PTR(ret);
@@ -1170,8 +1170,10 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
        int ret;
 
        args = kzalloc(sizeof(*args), GFP_KERNEL);
-       if (!args)
+       if (!args) {
+               EXOFS_DBGMSG("Faild kzalloc of args\n");
                return -ENOMEM;
+       }
 
        fcb = &args->fcb;
 
@@ -1200,7 +1202,7 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
        } else
                memcpy(fcb->i_data, oi->i_data, sizeof(fcb->i_data));
 
-       ret = exofs_get_io_state(sbi, &ios);
+       ret = exofs_get_io_state(&sbi->layout, &ios);
        if (unlikely(ret)) {
                EXOFS_ERR("%s: exofs_get_io_state failed.\n", __func__);
                goto free_args;
@@ -1234,7 +1236,8 @@ static int exofs_update_inode(struct inode *inode, int do_sync)
 free_args:
        kfree(args);
 out:
-       EXOFS_DBGMSG("ret=>%d\n", ret);
+       EXOFS_DBGMSG("(0x%lx) do_sync=%d ret=>%d\n",
+                    inode->i_ino, do_sync, ret);
        return ret;
 }
 
@@ -1283,7 +1286,7 @@ void exofs_delete_inode(struct inode *inode)
 
        clear_inode(inode);
 
-       ret = exofs_get_io_state(sbi, &ios);
+       ret = exofs_get_io_state(&sbi->layout, &ios);
        if (unlikely(ret)) {
                EXOFS_ERR("%s: exofs_get_io_state failed\n", __func__);
                return;
This page took 0.033321 seconds and 5 git commands to generate.