Whamcloud - gitweb
- bulk handling from callbacks
authorbraam <braam>
Sun, 3 Mar 2002 06:11:18 +0000 (06:11 +0000)
committerbraam <braam>
Sun, 3 Mar 2002 06:11:18 +0000 (06:11 +0000)
lustre/llite/rw.c
lustre/osc/osc_request.c
lustre/ost/ost_handler.c

index 7d01995..62f83e3 100644 (file)
@@ -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;
         }
index 1b93efe..701b3a1 100644 (file)
@@ -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;
index 46b2913..69c0068 100644 (file)
@@ -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;