[Pvfs2-cvs] commit by slang in pvfs2/src/kernel/linux-2.6: devpvfs2-req.c pvfs2-cache.c

CVS commit program cvs at parl.clemson.edu
Thu Jan 11 16:18:17 EST 2007


Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb1:/tmp/cvs-serv1100/src/kernel/linux-2.6

Modified Files:
      Tag: pvfs-2-6-branch
	devpvfs2-req.c pvfs2-cache.c 
Log Message:
revert changes that duplicate pete's fixes for 2.6.19


Index: devpvfs2-req.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/devpvfs2-req.c,v
diff -p -u -r1.66.10.5 -r1.66.10.6
--- devpvfs2-req.c	11 Jan 2007 20:50:48 -0000	1.66.10.5
+++ devpvfs2-req.c	11 Jan 2007 21:18:16 -0000	1.66.10.6
@@ -232,17 +232,11 @@ static ssize_t pvfs2_devreq_read(
     return len;
 }
 
-struct devrw_options {
-    struct file   *file;
-    /* Asynch I/O control block */
-    struct kiocb *iocb;
-    struct iovec *iov;
-    unsigned long nr_segs;
-    loff_t        *offset;
-};
-
-/* Common function for writev() and aio_write() callers into the device */
-static ssize_t do_devreq_writev(struct devrw_options *rw)
+static ssize_t pvfs2_devreq_writev(
+    struct file *file,
+    const struct iovec *iov,
+    unsigned long count,
+    loff_t * offset)
 {
     pvfs2_kernel_op_t *op = NULL;
     struct qhash_head *hash_link = NULL;
@@ -256,18 +250,12 @@ static ssize_t do_devreq_writev(struct d
     int32_t magic = 0;
     int32_t proto_ver = 0;
     uint64_t tag = 0;
-    struct iovec *iov = NULL;
-    ssize_t total_returned_size = 0;
 
-    if (!rw || ((iov = rw->iov) == NULL)) {
-        gossip_err("Error: invalid parameter to device vectored write\n");
-        return -EINVAL;
-    }
     /* Either there is a trailer or there isn't */
-    if (rw->nr_segs != notrailer_count && rw->nr_segs != (notrailer_count + 1))
+    if (count != notrailer_count && count != (notrailer_count + 1))
     {
         gossip_err("Error: Number of iov vectors is (%ld) and notrailer count is %d\n",
-                rw->nr_segs, notrailer_count);
+                count, notrailer_count);
         return -EPROTO;
     }
     buffer = dev_req_alloc();
@@ -296,7 +284,6 @@ static ssize_t do_devreq_writev(struct d
 	ptr += iov[i].iov_len;
 	payload_size += iov[i].iov_len;
     }
-    total_returned_size = payload_size;
 
     /* these elements are currently 8 byte aligned (8 bytes for (version +  
      * magic) 8 bytes for tag).  If you add another element, either make it 8
@@ -351,10 +338,10 @@ static ssize_t do_devreq_writev(struct d
             if (op->downcall.status == 0 && op->downcall.trailer_size > 0)
             {
                 gossip_debug(GOSSIP_DEV_DEBUG, "writev: trailer size %ld\n", (unsigned long) op->downcall.trailer_size);
-                if (rw->nr_segs != (notrailer_count + 1))
+                if (count != (notrailer_count + 1))
                 {
                     gossip_err("Error: trailer size (%ld) is non-zero, no trailer elements though? (%ld)\n",
-                            (unsigned long) op->downcall.trailer_size, rw->nr_segs);
+                            (unsigned long) op->downcall.trailer_size, count);
                     dev_req_release(buffer);
                     put_op(op);
                     return -EPROTO;
@@ -554,50 +541,9 @@ static ssize_t do_devreq_writev(struct d
     }
     dev_req_release(buffer);
 
-    /* if we are called from aio context, just mark that the iocb is completed */
-    if (rw->iocb) {
-        aio_complete(rw->iocb, total_returned_size, 0);
-    }
-
-    return total_returned_size;
+    return count;
 }
 
-#ifdef HAVE_WRITEV_FILE_OPERATIONS
-static ssize_t pvfs2_devreq_writev(
-    struct file *file,
-    const struct iovec *iov,
-    unsigned long n_segs,
-    loff_t * offset)
-{
-    struct devrw_options rw;
-
-    memset(&rw, 0, sizeof(rw));
-    rw.iocb = NULL;
-    rw.iov = (struct iovec *) iov;
-    rw.nr_segs = n_segs;
-    rw.offset = offset;
-    return do_devreq_writev(&rw);
-}
-#endif
-
-#ifdef HAVE_AIO_NEW_AIO_SIGNATURE
-/* For simplicity I am going to treat this aio call as if it were synchronous */
-static ssize_t
-pvfs2_devreq_aio_write(struct kiocb *iocb, const struct iovec *iov,
-        unsigned long n_segs, loff_t offset)
-{
-    struct devrw_options rw;
-
-    memset(&rw, 0, sizeof(rw));
-    rw.file = iocb->ki_filp;
-    rw.iov  = (struct iovec *) iov;
-    rw.nr_segs = n_segs;
-    rw.offset = &offset;
-    return do_devreq_writev(&rw);
-}
-
-#endif
-
 #ifdef HAVE_COMBINED_AIO_AND_VECTOR
 /*
  * Kernels >= 2.6.19 have no writev, use this instead with SYNC_KEY.
@@ -1074,9 +1020,7 @@ struct file_operations pvfs2_devreq_file
 #ifdef PVFS2_LINUX_KERNEL_2_4
     owner: THIS_MODULE,
     read : pvfs2_devreq_read,
-#ifdef HAVE_WRITEV_FILE_OPERATIONS
     writev : pvfs2_devreq_writev,
-#endif
     open : pvfs2_devreq_open,
     release : pvfs2_devreq_release,
     ioctl : pvfs2_devreq_ioctl,
@@ -1086,12 +1030,7 @@ struct file_operations pvfs2_devreq_file
 #ifdef HAVE_COMBINED_AIO_AND_VECTOR
     .aio_write = pvfs2_devreq_aio_write,
 #else
-#ifdef HAVE_WRITEV_FILE_OPERATIONS
     .writev = pvfs2_devreq_writev,
-#endif
-#ifdef HAVE_AIO_NEW_AIO_SIGNATURE
-    .aio_write = pvfs2_devreq_aio_write,
-#endif
 #endif
     .open = pvfs2_devreq_open,
     .release = pvfs2_devreq_release,

Index: pvfs2-cache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/pvfs2-cache.c,v
diff -p -u -r1.36.8.4 -r1.36.8.5
--- pvfs2-cache.c	11 Jan 2007 20:50:48 -0000	1.36.8.4
+++ pvfs2-cache.c	11 Jan 2007 21:18:17 -0000	1.36.8.5
@@ -337,7 +337,6 @@ int pvfs2_inode_cache_initialize(void)
 
 int pvfs2_inode_cache_finalize(void)
 {
-    int ret = 0;
     if (!list_empty(&pvfs2_inode_list))
     {
         gossip_err("pvfs2_inode_cache_finalize: WARNING: releasing unreleased pvfs2 inode objects!\n");



More information about the Pvfs2-cvs mailing list