return;
}
- llap->llap_queued = 0;
page = llap->llap_page;
-
LASSERT(PageLocked(page));
if (rc == 0) {
- if (cmd == OBD_BRW_READ)
- SetPageUptodate(page);
+ if (cmd == OBD_BRW_READ) {
+ if (!llap->llap_defer_uptodate)
+ SetPageUptodate(page);
+ } else {
+ llap->llap_write_queued = 0;
+ }
} else {
SetPageError(page);
}
GOTO(out, rc = PTR_ERR(llap));
page_cache_get(page);
- if (llap->llap_queued) {
+ if (llap->llap_write_queued) {
LL_CDEBUG_PAGE(page, "marking urgent\n");
- rc = obd_set_async_flags(exp, ll_i2info(inode)->lli_smd, NULL,
- llap->llap_cookie, ASYNC_READY |
- ASYNC_URGENT);
+ rc = obd_set_async_flags(exp, ll_i2info(inode)->lli_smd, NULL,
+ llap->llap_cookie,
+ ASYNC_READY | ASYNC_URGENT);
} else {
- rc = obd_queue_async_io(exp, ll_i2info(inode)->lli_smd, NULL,
- llap->llap_cookie, OBD_BRW_WRITE, 0, 0,
- OBD_BRW_CREATE, ASYNC_READY |
- ASYNC_URGENT);
- if (rc == 0) {
+ llap->llap_write_queued = 1;
+ rc = obd_queue_async_io(exp, ll_i2info(inode)->lli_smd, NULL,
+ llap->llap_cookie, OBD_BRW_WRITE, 0, 0,
+ 0, ASYNC_READY | ASYNC_URGENT);
+ if (rc == 0)
LL_CDEBUG_PAGE(page, "mmap write queued\n");
- llap->llap_queued = 1;
- }
+ else
+ llap->llap_write_queued = 0;
}
if (rc)
page_cache_release(page);
RETURN(rc);
}
-static int ll_direct_IO_24(int rw, struct inode *inode, struct kiobuf *iobuf,
- unsigned long blocknr, int blocksize)
+static int ll_direct_IO_24(int rw,
+#ifdef HAVE_DIO_FILE
+ struct file *file,
+#else
+ struct inode *inode,
+#endif
+ struct kiobuf *iobuf, unsigned long blocknr,
+ int blocksize)
{
+#ifdef HAVE_DIO_FILE
+ struct inode *inode = file->f_dentry->d_inode;
+#endif
struct ll_inode_info *lli = ll_i2info(inode);
struct lov_stripe_md *lsm = lli->lli_smd;
struct brw_page *pga;
RETURN(-ENOMEM);
}
- flags = (rw == WRITE ? OBD_BRW_CREATE : 0) /* | OBD_BRW_DIRECTIO */;
+ flags = 0 /* | OBD_BRW_DIRECTIO */;
offset = ((obd_off)blocknr << inode->i_blkbits);
length = iobuf->length;
prepare_write: ll_prepare_write,
commit_write: ll_commit_write,
removepage: ll_removepage,
+ sync_page: NULL,
bmap: NULL
};