exofs: dbg-print less
[linux-2.6.git] / fs / exofs / inode.c
index f79e8e5..01fa798 100644 (file)
@@ -1,8 +1,6 @@
 /*
  * Copyright (C) 2005, 2006
- * Avishay Traeger (avishay@gmail.com) (avishay@il.ibm.com)
- * Copyright (C) 2005, 2006
- * International Business Machines
+ * Avishay Traeger (avishay@gmail.com)
  * Copyright (C) 2008, 2009
  * Boaz Harrosh <bharrosh@panasas.com>
  *
@@ -43,6 +41,8 @@
 #  define EXOFS_DEBUG_OBJ_ISIZE 1
 #endif
 
+#define EXOFS_DBGMSG2(M...) do {} while (0)
+
 struct page_collect {
        struct exofs_sb_info *sbi;
        struct request_queue *req_q;
@@ -59,10 +59,9 @@ static void _pcol_init(struct page_collect *pcol, unsigned expected_pages,
                struct inode *inode)
 {
        struct exofs_sb_info *sbi = inode->i_sb->s_fs_info;
-       struct request_queue *req_q = sbi->s_dev->scsi_device->request_queue;
 
        pcol->sbi = sbi;
-       pcol->req_q = req_q;
+       pcol->req_q = osd_request_queue(sbi->s_dev);
        pcol->inode = inode;
        pcol->expected_pages = expected_pages;
 
@@ -201,7 +200,7 @@ static int __readpages_done(struct osd_request *or, struct page_collect *pcol,
                else
                        page_stat = ret;
 
-               EXOFS_DBGMSG("    readpages_done(0x%lx, 0x%lx) %s\n",
+               EXOFS_DBGMSG2("    readpages_done(0x%lx, 0x%lx) %s\n",
                          inode->i_ino, page->index,
                          page_stat ? "bad_bytes" : "good_bytes");
 
@@ -296,6 +295,9 @@ static int read_exec(struct page_collect *pcol, bool is_sync)
 err:
        if (!is_sync)
                _unlock_pcol_pages(pcol, ret, READ);
+       else /* Pages unlocked by caller in sync mode only free bio */
+               pcol_free(pcol);
+
        kfree(pcol_copy);
        if (or)
                osd_end_request(or);
@@ -370,12 +372,12 @@ try_again:
        if (len != PAGE_CACHE_SIZE)
                zero_user(page, len, PAGE_CACHE_SIZE - len);
 
-       EXOFS_DBGMSG("    readpage_strip(0x%lx, 0x%lx) len=0x%zx\n",
+       EXOFS_DBGMSG2("    readpage_strip(0x%lx, 0x%lx) len=0x%zx\n",
                     inode->i_ino, page->index, len);
 
        ret = pcol_add_page(pcol, page, len);
        if (ret) {
-               EXOFS_DBGMSG("Failed pcol_add_page pages[i]=%p "
+               EXOFS_DBGMSG2("Failed pcol_add_page pages[i]=%p "
                          "this_len=0x%zx nr_pages=%u length=0x%lx\n",
                          page, len, pcol->nr_pages, pcol->length);
 
@@ -482,7 +484,7 @@ static void writepages_done(struct osd_request *or, void *p)
 
                update_write_page(page, page_stat);
                unlock_page(page);
-               EXOFS_DBGMSG("    writepages_done(0x%lx, 0x%lx) status=%d\n",
+               EXOFS_DBGMSG2("    writepages_done(0x%lx, 0x%lx) status=%d\n",
                             inode->i_ino, page->index, page_stat);
 
                length += bvec->bv_len;
@@ -609,7 +611,7 @@ try_again:
                        goto fail;
        }
 
-       EXOFS_DBGMSG("    writepage_strip(0x%lx, 0x%lx) len=0x%zx\n",
+       EXOFS_DBGMSG2("    writepage_strip(0x%lx, 0x%lx) len=0x%zx\n",
                     inode->i_ino, page->index, len);
 
        ret = pcol_add_page(pcol, page, len);
@@ -950,8 +952,7 @@ struct inode *exofs_iget(struct super_block *sb, unsigned long ino)
 #ifdef EXOFS_DEBUG_OBJ_ISIZE
        if ((inode->i_size != sanity) &&
                (!exofs_inode_is_fast_symlink(inode))) {
-               EXOFS_ERR("WARNING: Size of object from inode and "
-                         "attributes differ (%lld != %llu)\n",
+               EXOFS_ERR("WARNING: Size of inode=%llu != object=%llu\n",
                          inode->i_size, _LLU(sanity));
        }
 #endif