Whamcloud - gitweb
make sanity and iozone run from llite over the lov in the new ocp
authorzab <zab>
Thu, 31 Jul 2003 20:29:35 +0000 (20:29 +0000)
committerzab <zab>
Thu, 31 Jul 2003 20:29:35 +0000 (20:29 +0000)
io model.
- add ocp_off to the ocp so the lov can remap it as it passes through
- fix up the page accounting a bit 'cause truncate doesn't really know
  right know to subtract pages from the dirty or io counts
- pass our completion struct, _not_ a pointer to the complete function
- make sure to always free the ocp in commit_write_sync
- disable the watermark io until it actually does something
- make sure to alter the filehandle/o_id as we pass through the lov
- initialize our loi bits in lov_unpackmd

lustre/llite/rw24.c

index 1ea2d48..c2e31b7 100644 (file)
@@ -77,6 +77,7 @@ int ll_start_readpage_24(struct ll_file_data *fd, struct obd_export *exp,
                 RETURN(PTR_ERR(ocp));
 
         ocp->ocp_callback = ll_complete_readpage_24;
+        ocp->ocp_off = (obd_off)page->index << PAGE_CACHE_SHIFT;
         ocp->ocp_count = PAGE_CACHE_SIZE;
         ocp->ocp_flag = 0;
 
@@ -235,6 +236,7 @@ void ll_complete_writepage_24(struct obd_client_page *ocp, int rc)
         LASSERT(page->private == (unsigned long)ocp);
         LASSERT(PageLocked(page));
 
+        ll_page_acct(0, -1); /* io before dirty, this is so lame. */
         rc = ll_clear_dirty_pages(ll_i2obdconn(inode),
                                   ll_i2info(inode)->lli_smd,
                                   page->index, page->index);
@@ -269,13 +271,14 @@ static int ll_writepage_24(struct page *page)
                 GOTO(out, rc = PTR_ERR(ocp));
 
         ocp->ocp_callback = ll_complete_writepage_24;
+        ocp->ocp_off = (obd_off)page->index << PAGE_CACHE_SHIFT;
         ocp->ocp_count = ll_ocp_write_count(inode, page);
         ocp->ocp_flag = OBD_BRW_CREATE|OBD_BRW_FROM_GRANT;
 
         obd_brw_plug(OBD_BRW_WRITE, exp, ll_i2info(inode)->lli_smd, NULL);
         rc = ll_start_ocp_io(page);
         if (rc == 0) {
-                ll_page_acct(-1, 1);
+                ll_page_acct(0, 1);
                 ll_start_io_from_dirty(inode, ll_complete_writepage_24);
         } else {
                 ocp_free(page);