Whamcloud - gitweb
Fix for bug 1609 on CVS HEAD.
authoradilger <adilger>
Fri, 1 Aug 2003 09:04:28 +0000 (09:04 +0000)
committeradilger <adilger>
Fri, 1 Aug 2003 09:04:28 +0000 (09:04 +0000)
lustre/llite/rw.c
lustre/obdfilter/filter_io.c

index b4004b5..e5890bf 100644 (file)
@@ -678,8 +678,9 @@ static int ll_direct_IO(int rw, struct inode *inode, struct kiobuf *iobuf,
         if (!lsm || !lsm->lsm_object_id)
                 RETURN(-EBADF);
 
-        if ((iobuf->offset & (blocksize - 1)) ||
-            (iobuf->length & (blocksize - 1)))
+        /* FIXME: io smaller than PAGE_SIZE is broken on ia64 */
+        if ((iobuf->offset & (PAGE_SIZE - 1)) ||
+            (iobuf->length & (PAGE_SIZE - 1)))
                 RETURN(-EINVAL);
 
         set = ptlrpc_prep_set();
index 1526295..0885a80 100644 (file)
@@ -202,11 +202,10 @@ int filter_get_page_write(struct inode *inode, struct niobuf_local *lnb,
                 lnb->page = page;
                 lnb->flags |= N_LOCAL_TEMP_PAGE;
         } else if (!IS_ERR(page)) {
+                unsigned from = lnb->offset & ~PAGE_MASK, to = from + lnb->len;
                 (*pglocked)++;
 
-                rc = mapping->a_ops->prepare_write(NULL, page,
-                                                   lnb->offset & ~PAGE_MASK,
-                                                   lnb->len);
+                rc = mapping->a_ops->prepare_write(NULL, page, from, to);
                 if (rc) {
                         if (rc != -ENOSPC)
                                 CERROR("page index %lu, rc = %d\n", index, rc);