From: braam Date: Sun, 3 Mar 2002 06:11:18 +0000 (+0000) Subject: - bulk handling from callbacks X-Git-Tag: 0.4.2~572 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d7dbd6abefaccf52afc92141658a30813a502634;p=fs%2Flustre-release.git - bulk handling from callbacks --- diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7d01995..62f83e3 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -226,15 +226,17 @@ int ll_prepare_write(struct file *file, struct page *page, unsigned from, unsign struct inode *inode = page->mapping->host; obd_off offset = ((obd_off)page->index) << PAGE_SHIFT; int rc = 0; + char *addr; ENTRY; - kmap(page); + addr = kmap(page); if (Page_Uptodate(page)) { EXIT; goto prepare_done; } - if ( (from <= offset) && (to >= offset + PAGE_SIZE) ) { + if ( offset + from >= inode->i_size ) { + memset(addr, 0, PAGE_SIZE); EXIT; return 0; } diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index 1b93efe..701b3a1 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -480,9 +480,9 @@ int osc_brw_write(struct obd_conn *conn, obd_count num_oa, struct obdo **oa, } } - ptr2 = ost_rep_buf2(request->rq_rep.ost); req2 = ptlrpc_prep_req(cl, OST_BRW_COMPLETE, size1, ptr1, request->rq_rep.ost->buflen2, ptr2); + ptr2 = ost_rep_buf2(request->rq_rep.ost); if (!req2) { CERROR("cannot pack second request!\n"); return -ENOMEM; diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 46b2913..69c0068 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -494,6 +494,25 @@ int ost_brw_write(struct ost_obd *obddev, struct ptlrpc_request *req) return 0; } +int ost_commit_page(struct obd_conn *conn, struct page *page) +{ + struct obd_ioobj obj; + struct niobuf buf; + int rc; + ENTRY; + + memset(&buf, 0, sizeof(buf)); + memset(&obj, 0, sizeof(obj)); + + buf.page = page; + obj.ioo_bufcnt = 1; + + rc = obd_commitrw(OBD_BRW_WRITE, conn, 1, &obj, 1, &buf); + EXIT; + return rc; +} + + int ost_brw(struct ost_obd *obddev, struct ptlrpc_request *req) { struct ost_req *r = req->rq_req.ost;