LASSERT(current->journal_info == handle);
- lock_kernel();
+ lock_24kernel();
transaction = handle->h_transaction;
journal = transaction->t_journal;
tid = transaction->t_tid;
CERROR("strange race: %lu != %lu\n",
(unsigned long) tid, (unsigned long) rtid);
#else
- log_start_commit(journal, transaction->t_tid);
+ log_start_commit(journal, tid);
#endif
- unlock_kernel();
+ unlock_24kernel();
*wait_handle = (void *) tid;
CDEBUG(D_INODE, "commit async: %lu\n", (unsigned long) tid);
}
out:
+ wait_event(dreq->dr_wait, atomic_read(&dreq->dr_numreqs) == 0);
+
if (rc == 0)
rc = dreq->dr_error;
RETURN(rc);
rc2 = filter_finish_transno(exp, oti, 0);
if (rc2 != 0)
CERROR("can't close transaction: %d\n", rc);
+ rc = (rc == 0) ? rc2 : rc;
+
+ rc2 = fsfilt_commit_async(obd,inode,oti->oti_handle,wait_handle);
+ rc = (rc == 0) ? rc2 : rc;
- if (rc == 0)
- rc = rc2;
if (rc != 0)
RETURN(rc);
}
unsigned long now = jiffies;
int i, err, cleanup_phase = 0;
struct obd_device *obd = exp->exp_obd;
+ void *wait_handle = NULL;
int total_size = 0;
loff_t old_size;
ENTRY;
iattr_from_obdo(&iattr,oa,OBD_MD_FLATIME|OBD_MD_FLMTIME|OBD_MD_FLCTIME);
/* filter_direct_io drops i_sem */
rc = filter_direct_io(OBD_BRW_WRITE, res->dentry, dreq, exp, &iattr,
- oti, NULL);
+ oti, &wait_handle);
#if 0
if (inode->i_size != old_size) {
fsfilt_check_slow(now, obd_timeout, "direct_io");
- err = fsfilt_commit(obd, obd->u.filter.fo_sb, inode, oti->oti_handle,
- obd_sync_filter);
- if (err)
+ err = fsfilt_commit_wait(obd, inode, wait_handle);
+ if (rc == 0)
rc = err;
-
- if (obd_sync_filter && !err)
- LASSERTF(oti->oti_transno <= obd->obd_last_committed,
- "oti_transno "LPU64" last_committed "LPU64"\n",
- oti->oti_transno, obd->obd_last_committed);
-
+
fsfilt_check_slow(now, obd_timeout, "commitrw commit");
- wait_event(dreq->dr_wait, atomic_read(&dreq->dr_numreqs) == 0);
-
cleanup:
filter_grant_commit(exp, niocount, res);