Whamcloud - gitweb
- b2188: filter fixes: sync transaction, commit earlier
authoralex <alex>
Tue, 28 Oct 2003 13:19:17 +0000 (13:19 +0000)
committeralex <alex>
Tue, 28 Oct 2003 13:19:17 +0000 (13:19 +0000)
lustre/obdfilter/filter_io_24.c
lustre/obdfilter/filter_io_26.c

index 61f3bfb..68ee19b 100644 (file)
@@ -56,7 +56,8 @@ void inode_update_time(struct inode *inode, int ctime_too)
 int ext3_map_inode_page(struct inode *inode, struct page *page,
                         unsigned long *blocks, int *created, int create);
 /* Must be called with i_sem taken; this will drop it */
-static int filter_direct_io(int rw, struct inode *inode, struct kiobuf *iobuf)
+static int filter_direct_io(int rw, struct inode *inode, struct kiobuf *iobuf,
+                            struct obd_device *obd, struct obd_trans_info *oti)
 {
         struct page *page;
         unsigned long *b = iobuf->blocks;
@@ -91,6 +92,9 @@ static int filter_direct_io(int rw, struct inode *inode, struct kiobuf *iobuf)
         up(&inode->i_sem);
         cleanup_phase = 3;
 
+        rc = fsfilt_commit_async(obd, inode, &oti->oti_handle);
+        GOTO(cleanup, rc);
+
         rc = brw_kiovec(WRITE, 1, &iobuf, inode->i_dev, iobuf->blocks,
                         1 << inode->i_blkbits);
         CDEBUG(D_INFO, "tried to write %d pages, rc = %d\n",
@@ -190,7 +194,7 @@ int filter_commitrw_write(struct obd_export *exp, int objcount,
         if (time_after(jiffies, now + 15 * HZ))
                 CERROR("slow brw_start %lus\n", (jiffies - now) / HZ);
 
-        rc = filter_direct_io(OBD_BRW_WRITE, inode, iobuf);
+        rc = filter_direct_io(OBD_BRW_WRITE, inode, iobuf, obd, oti);
         if (rc == 0) {
                 lock_kernel();
                 inode_update_time(inode, 1);
@@ -207,7 +211,7 @@ int filter_commitrw_write(struct obd_export *exp, int objcount,
                 CERROR("slow direct_io %lus\n", (jiffies - now) / HZ);
 
         rc = filter_finish_transno(exp, oti, rc);
-        err = fsfilt_commit(obd, inode, oti->oti_handle, obd_sync_filter);
+        err = fsfilt_commit_wait(obd, inode, oti->oti_handle);
         if (err)
                 rc = err;
         if (obd_sync_filter)
index e522962..87b06df 100644 (file)
@@ -35,6 +35,8 @@
 #include <linux/lustre_fsfilt.h>
 #include "filter_internal.h"
 
+#warning "implement writeback mode -bzzz"
+
 int ext3_map_inode_page(struct inode *inode, struct page *page,
                         unsigned long *blocks, int *created, int create);