Hi RobL,
Attached patch should help us get back to building again on the latest Linus git tree.. Boy, am I glad that we did all the cleanups in file.c in Sept. It was crucial to help get all this
stuff cleaned up nicely. :)

That said, this patch is *not sufficient* for client-core to work correctly.
Primary reason is that since writev has disappeared, the device writev operation needs to be rewritten with the aio_write callback, and we rely on this for client-core to work correctly. Tomorrow after my git tree builds successfully overnight, I should be able to boot into the 2.6.19* kernel and test out the changes.

Until then if you wish to check this change in, please do so. atleast things will still build. it just won't work/mount! I am sending the patches out so that I don't have to deal with redoing all this if my hard disk breaks down over-night! I will send a tested version fixing both the 2.6 breakages and the 2.4 breakages that Sam had mentioned to me tomorrow night..

Do let me know if you need any more comments on these changes.. Things haven't changed much so I am not commenting them much.
thanks,
Murali




Murali Vilayannur wrote:
Hi RobL,
Thanks for the pointers to the articles.
It also appears that our vfs aio stuff will also break and requires changes.
Let me know if you plan to fix that as well.
Or I can fix that this weekend.

Hi Murali,
Tell you what, I'll take care of the configure tests (did you know the return type for kmem_cache_destroy has now been changed to void?) if you want to fix the actual code this weekend. That would be great -- I'm pretty slow with the kernel stuff, and I also need to prepare for SC.

2.6.19-rc5 is out now.  Guess that's the one to test against.

==rob


Index: configure
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/configure,v
retrieving revision 1.323
diff -u -r1.323 configure
--- configure   24 Oct 2006 15:51:59 -0000      1.323
+++ configure   10 Nov 2006 07:25:45 -0000
@@ -7912,6 +7912,129 @@
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
        fi
 
+               echo "$as_me:$LINENO: checking for readv callback in struct 
file_operations in kernel" >&5
+echo $ECHO_N "checking for readv callback in struct file_operations in 
kernel... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+               #define __KERNEL__
+               #include <linux/fs.h>
+               static struct file_operations fop = {
+                   .readv = NULL,
+               };
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_READV_FILE_OPERATIONS 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+               echo "$as_me:$LINENO: checking for writev callback in struct 
file_operations in kernel" >&5
+echo $ECHO_N "checking for writev callback in struct file_operations in 
kernel... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+               #define __KERNEL__
+               #include <linux/fs.h>
+               static struct file_operations fop = {
+                   .writev = NULL,
+               };
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WRITEV_FILE_OPERATIONS 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
                echo "$as_me:$LINENO: checking for find_inode_handle callback 
in struct super_operations in kernel" >&5
 echo $ECHO_N "checking for find_inode_handle callback in struct 
super_operations in kernel... $ECHO_C" >&6
        cat >conftest.$ac_ext <<_ACEOF
@@ -8663,6 +8786,73 @@
 
 fi
 rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+               tmp_cflags=$CFLAGS
+                               CFLAGS="$CFLAGS -Werror"
+               echo "$as_me:$LINENO: checking for new prototype of aio_read 
callback of file_operations structure" >&5
+echo $ECHO_N "checking for new prototype of aio_read callback of 
file_operations structure... $ECHO_C" >&6
+               cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+                       #define __KERNEL__
+                       #include <linux/fs.h>
+                       extern ssize_t my_aio_read(struct kiocb *, const struct 
iovec *, unsigned long, loff_t);
+                       static struct file_operations fop = {
+                                         .aio_read = my_aio_read,
+                       };
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AIO_NEW_AIO_SIGNATURE 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+               CFLAGS=$tmp_cflags
+
        fi
 
        tmp_cflags=$CFLAGS
@@ -9867,6 +10057,66 @@
 
 cat >>confdefs.h <<\_ACEOF
 #define HAVE_INT_RETURN_INODE_OPERATIONS_FOLLOW_LINK 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+                       echo "$as_me:$LINENO: checking for int return in 
kmem_cache_destroy" >&5
+echo $ECHO_N "checking for int return in kmem_cache_destroy... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+           #define __KERNEL__
+           #include <linux/slab.h>
+           extern int kmem_cache_destroy(kmem_cache_t *);
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INT_RETURN_KMEM_CACHE_DESTROY 1
 _ACEOF
 
 else
Index: pvfs2-config.h.in
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/pvfs2-config.h.in,v
retrieving revision 1.88
diff -u -r1.88 pvfs2-config.h.in
--- pvfs2-config.h.in   23 Oct 2006 22:25:41 -0000      1.88
+++ pvfs2-config.h.in   10 Nov 2006 07:25:46 -0000
@@ -6,6 +6,9 @@
 /* Define if kernel has aio support */
 #undef HAVE_AIO
 
+/* Define if VFS AIO support in kernel has a new prototype */
+#undef HAVE_AIO_NEW_AIO_SIGNATURE
+
 /* Define if we are enabling VFS AIO support in kernel */
 #undef HAVE_AIO_VFS_SUPPORT
 
@@ -122,6 +125,9 @@
 /* Define if return value from follow_link in inode_operations is type int */
 #undef HAVE_INT_RETURN_INODE_OPERATIONS_FOLLOW_LINK
 
+/* Define if return value from kmem_cache_destroy is type int */
+#undef HAVE_INT_RETURN_KMEM_CACHE_DESTROY
+
 /* Define if struct inode in kernel has i_blksize member */
 #undef HAVE_I_BLKSIZE_IN_STRUCT_INODE
 
@@ -191,6 +197,9 @@
 /* Define if struct file_operations in kernel has readdirplus callback */
 #undef HAVE_READDIRPLUS_FILE_OPERATIONS
 
+/* Define if struct file_operations in kernel has readv callback */
+#undef HAVE_READV_FILE_OPERATIONS
+
 /* Define if struct file_operations in kernel has readx callback */
 #undef HAVE_READX_FILE_OPERATIONS
 
@@ -277,6 +286,9 @@
 
 /* Define if get_sb callback has struct vfsmount argument */
 #undef HAVE_VFSMOUNT_GETSB
+
+/* Define if struct file_operations in kernel has writev callback */
+#undef HAVE_WRITEV_FILE_OPERATIONS
 
 /* Define if struct file_operations in kernel has writex callback */
 #undef HAVE_WRITEX_FILE_OPERATIONS
Index: maint/config/kernel.m4
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/maint/config/kernel.m4,v
retrieving revision 1.21
diff -u -r1.21 kernel.m4
--- maint/config/kernel.m4      24 Oct 2006 15:51:59 -0000      1.21
+++ maint/config/kernel.m4      10 Nov 2006 07:25:46 -0000
@@ -144,6 +144,33 @@
                )
        fi
 
+       dnl checking if we have a readv callback in super_operations 
+       AC_MSG_CHECKING(for readv callback in struct file_operations in kernel)
+       AC_TRY_COMPILE([
+               #define __KERNEL__
+               #include <linux/fs.h>
+               static struct file_operations fop = {
+                   .readv = NULL,
+               };
+       ], [],
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_READV_FILE_OPERATIONS, 1, Define if struct 
file_operations in kernel has readv callback),
+               AC_MSG_RESULT(no)
+       )
+       dnl checking if we have a writev callback in super_operations 
+       AC_MSG_CHECKING(for writev callback in struct file_operations in kernel)
+       AC_TRY_COMPILE([
+               #define __KERNEL__
+               #include <linux/fs.h>
+               static struct file_operations fop = {
+                   .writev = NULL,
+               };
+       ], [],
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_WRITEV_FILE_OPERATIONS, 1, Define if struct 
file_operations in kernel has writev callback),
+               AC_MSG_RESULT(no)
+       )
+
        dnl checking if we have a find_inode_handle callback in 
super_operations 
        AC_MSG_CHECKING(for find_inode_handle callback in struct 
super_operations in kernel)
        AC_TRY_COMPILE([
@@ -322,6 +349,25 @@
                        AC_DEFINE(HAVE_AIO_VFS_SUPPORT, 1, Define if we are 
enabling VFS AIO support in kernel),
                        AC_MSG_RESULT(no)
                )
+
+               tmp_cflags=$CFLAGS
+               dnl if this test passes, the signature of aio_read has changed 
to the new one 
+               CFLAGS="$CFLAGS -Werror"
+               AC_MSG_CHECKING(for new prototype of aio_read callback of 
file_operations structure)
+               AC_TRY_COMPILE([
+                       #define __KERNEL__
+                       #include <linux/fs.h>
+                       extern ssize_t my_aio_read(struct kiocb *, const struct 
iovec *, unsigned long, loff_t);
+                       static struct file_operations fop = {
+                                         .aio_read = my_aio_read,
+                       };
+               ], [],
+                       AC_MSG_RESULT(yes)
+                       AC_DEFINE(HAVE_AIO_NEW_AIO_SIGNATURE, 1, Define if VFS 
AIO support in kernel has a new prototype),
+                       AC_MSG_RESULT(no)
+               )
+               CFLAGS=$tmp_cflags
+
        fi
 
        tmp_cflags=$CFLAGS
@@ -558,6 +604,19 @@
            ], [],
            AC_MSG_RESULT(yes)
            AC_DEFINE(HAVE_INT_RETURN_INODE_OPERATIONS_FOLLOW_LINK, 1, Define 
if return value from follow_link in inode_operations is type int),
+           AC_MSG_RESULT(no)
+       )
+
+       dnl kmem_cache_destroy function may return int only on pre 2.6.19 
kernels
+       dnl else it returns a void.
+       AC_MSG_CHECKING(for int return in kmem_cache_destroy)
+       AC_TRY_COMPILE([
+           #define __KERNEL__
+           #include <linux/slab.h>
+           extern int kmem_cache_destroy(kmem_cache_t *);
+           ], [],
+           AC_MSG_RESULT(yes)
+           AC_DEFINE(HAVE_INT_RETURN_KMEM_CACHE_DESTROY, 1, Define if return 
value from kmem_cache_destroy is type int),
            AC_MSG_RESULT(no)
        )
 
Index: src/kernel/linux-2.6/devpvfs2-req.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/devpvfs2-req.c,v
retrieving revision 1.66
diff -u -r1.66 devpvfs2-req.c
--- src/kernel/linux-2.6/devpvfs2-req.c 13 Sep 2006 20:22:55 -0000      1.66
+++ src/kernel/linux-2.6/devpvfs2-req.c 10 Nov 2006 07:25:47 -0000
@@ -232,6 +232,7 @@
     return len;
 }
 
+#ifdef HAVE_WRITEV_FILE_OPERATIONS
 static ssize_t pvfs2_devreq_writev(
     struct file *file,
     const struct iovec *iov,
@@ -543,6 +544,7 @@
 
     return count;
 }
+#endif
 
 /* Returns whether any FS are still pending remounted */
 static int mark_all_pending_mounts(void)
@@ -996,14 +998,18 @@
 #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,
     poll : pvfs2_devreq_poll
 #else
     .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,
Index: src/kernel/linux-2.6/file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/file.c,v
retrieving revision 1.129
diff -u -r1.129 file.c
--- src/kernel/linux-2.6/file.c 29 Sep 2006 16:48:13 -0000      1.129
+++ src/kernel/linux-2.6/file.c 10 Nov 2006 07:25:49 -0000
@@ -725,16 +725,8 @@
     rw.dest.address.nr_segs = 1;
     rw.off.io.offset = offset;
 
-    if (IS_IMMUTABLE(rw.inode)) 
-    {
-        rw.readahead_size = (rw.inode)->i_size;
-        return generic_file_read(file, buf, count, offset);
-    }
-    else 
-    {
-        rw.readahead_size = 0;
-        return do_direct_readv_writev(&rw);
-    }
+    rw.readahead_size = 0;
+    return do_direct_readv_writev(&rw);
 }
 
 /** Write data from a contiguous user buffer into a file at a specified
@@ -767,6 +759,7 @@
     return do_direct_readv_writev(&rw);
 }
 
+#ifdef HAVE_READV_FILE_OPERATIONS
 /** Reads data to several contiguous user buffers (an iovec) from a file at a
  * specified offset.
  */
@@ -794,7 +787,9 @@
     rw.readahead_size = 0;
     return do_direct_readv_writev(&rw);
 }
+#endif
 
+#ifdef HAVE_WRITEV_FILE_OPERATIONS
 /** Write data from a several contiguous user buffers (an iovec) into a file at
  * a specified offset.
  */
@@ -822,6 +817,7 @@
 
     return do_direct_readv_writev(&rw);
 }
+#endif
 
 
 /* Construct a trailer of <file offsets, length pairs> in a buffer that we
@@ -2064,12 +2060,32 @@
     return error;
 }
 
+#ifdef HAVE_AIO_NEW_AIO_SIGNATURE
+static ssize_t 
+pvfs2_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
+        unsigned long n_segs, loff_t offset)
+#else
 static ssize_t 
 pvfs2_file_aio_read(struct kiocb *iocb, char __user *buffer,
         size_t count, loff_t offset)
+#endif
 {
     struct rw_options rw;
+    struct iovec *pvec;
+    unsigned long nr_segs;
+
+#ifndef HAVE_AIO_NEW_AIO_SIGNATURE
     struct iovec vec;
+
+    vec.iov_base = (char __user *) buffer;
+    vec.iov_len  = count;
+    pvec = (struct iovec *) &vec;
+    nr_segs = 1;
+#else
+    pvec = (struct iovec *) iov;
+    nr_segs = n_segs;
+#endif
+    
     memset(&rw, 0, sizeof(rw));
     rw.async = !is_sync_kiocb(iocb);
     rw.type = IO_READ;
@@ -2078,8 +2094,6 @@
     rw.copy_to_user = 1;
     rw.fnstr = __FUNCTION__;
     rw.iocb = iocb;
-    vec.iov_base = (char __user *) buffer;
-    vec.iov_len  = count;
     rw.file = iocb->ki_filp;
     if (!rw.file || !(rw.file)->f_mapping)
     {
@@ -2087,28 +2101,39 @@
     }
     rw.inode = (rw.file)->f_mapping->host;
     rw.pvfs2_inode = PVFS2_I(rw.inode);
-    rw.dest.address.iov = &vec;
-    rw.dest.address.nr_segs = 1;
+    rw.dest.address.iov = pvec;
+    rw.dest.address.nr_segs = nr_segs;
 
-    if (IS_IMMUTABLE(rw.inode)) 
-    {
-        rw.readahead_size = (rw.inode)->i_size;
-        return generic_file_aio_read(iocb, buffer, count, offset);
-    }
-    else 
-    {
-        rw.readahead_size = 0;
-        return do_direct_aio_read_write(&rw);
-    }
+    rw.readahead_size = 0;
+    return do_direct_aio_read_write(&rw);
 }
 
+#ifdef HAVE_AIO_NEW_AIO_SIGNATURE
+static ssize_t 
+pvfs2_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
+        unsigned long n_segs, loff_t offset)
+#else
 static ssize_t 
 pvfs2_file_aio_write(struct kiocb *iocb, const char __user *buffer,
         size_t count, loff_t offset)
+#endif
 {
     struct rw_options rw;
+    struct iovec *pvec;
+    unsigned long nr_segs;
+
+#ifndef HAVE_AIO_NEW_AIO_SIGNATURE
     struct iovec vec;
 
+    vec.iov_base = (char __user *) buffer;
+    vec.iov_len  = count;
+    pvec = (struct iovec *) &vec;
+    nr_segs = 1;
+#else
+    pvec = (struct iovec *) iov;
+    nr_segs = n_segs;
+#endif
+
     memset(&rw, 0, sizeof(rw));
     rw.async = !is_sync_kiocb(iocb);
     rw.type = IO_WRITE;
@@ -2118,8 +2143,6 @@
     rw.copy_to_user = 1;
     rw.fnstr = __FUNCTION__;
     rw.iocb = iocb;
-    vec.iov_base = (char __user *) buffer;
-    vec.iov_len  = count;
     rw.file = iocb->ki_filp;
     if (!rw.file || !(rw.file)->f_mapping)
     {
@@ -2127,8 +2150,8 @@
     }
     rw.inode = (rw.file)->f_mapping->host;
     rw.pvfs2_inode = PVFS2_I(rw.inode);
-    rw.dest.address.iov = &vec;
-    rw.dest.address.nr_segs = 1;
+    rw.dest.address.iov = pvec;
+    rw.dest.address.nr_segs = nr_segs;
     return do_direct_aio_read_write(&rw);
 }
 
@@ -2448,8 +2471,12 @@
     llseek : pvfs2_file_llseek,
     read : pvfs2_file_read,
     write : pvfs2_file_write,
+#ifdef HAVE_READV_FILE_OPERATIONS
     readv : pvfs2_file_readv,
+#endif
+#ifdef HAVE_WRITEV_FILE_OPERATIONS
     writev : pvfs2_file_writev,
+#endif
     ioctl : pvfs2_ioctl,
     mmap : pvfs2_file_mmap,
     open : pvfs2_file_open,
@@ -2459,8 +2486,12 @@
     .llseek = pvfs2_file_llseek,
     .read = pvfs2_file_read,
     .write = pvfs2_file_write,
+#ifdef HAVE_READV_FILE_OPERATIONS
     .readv = pvfs2_file_readv,
+#endif
+#ifdef HAVE_WRITEV_FILE_OPERATIONS
     .writev = pvfs2_file_writev,
+#endif
 #ifdef HAVE_AIO_VFS_SUPPORT
     .aio_read = pvfs2_file_aio_read,
     .aio_write = pvfs2_file_aio_write,
Index: src/kernel/linux-2.6/pvfs2-cache.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/pvfs2-cache.c,v
retrieving revision 1.36
diff -u -r1.36 pvfs2-cache.c
--- src/kernel/linux-2.6/pvfs2-cache.c  20 Sep 2006 22:59:53 -0000      1.36
+++ src/kernel/linux-2.6/pvfs2-cache.c  10 Nov 2006 07:25:50 -0000
@@ -48,7 +48,12 @@
 
 int op_cache_finalize(void)
 {
-    if (kmem_cache_destroy(op_cache) != 0)
+    int ret = 0;
+#ifdef HAVE_INT_RETURN_KMEM_CACHE_DESTROY
+    ret =
+#endif
+    kmem_cache_destroy(op_cache);
+    if (ret != 0)
     {
         gossip_err("Failed to destroy pvfs2_op_cache\n");
         return -EINVAL;
@@ -212,7 +217,12 @@
 
 int dev_req_cache_finalize(void)
 {
-    if (kmem_cache_destroy(dev_req_cache) != 0)
+    int ret = 0;
+#ifdef HAVE_INT_RETURN_KMEM_CACHE_DESTROY
+    ret =
+#endif
+    kmem_cache_destroy(dev_req_cache);
+    if (ret != 0)
     {
         gossip_err("Failed to destroy pvfs2_devreqcache\n");
         return -EINVAL;
@@ -326,6 +336,7 @@
 
 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");
@@ -336,7 +347,11 @@
             kmem_cache_free(pvfs2_inode_cache, pinode);
         }
     }
-    if (kmem_cache_destroy(pvfs2_inode_cache) != 0)
+#ifdef HAVE_INT_RETURN_KMEM_CACHE_DESTROY
+    ret =
+#endif
+    kmem_cache_destroy(pvfs2_inode_cache);
+    if (ret != 0) 
     {
         gossip_err("Failed to destroy pvfs2_inode_cache\n");
         return -EINVAL;
@@ -413,7 +428,12 @@
 
 int kiocb_cache_finalize(void)
 {
-    if (kmem_cache_destroy(pvfs2_kiocb_cache) != 0)
+    int ret = 0;
+#ifdef HAVE_INT_RETURN_KMEM_CACHE_DESTROY
+    ret =
+#endif
+    kmem_cache_destroy(pvfs2_kiocb_cache);
+    if (ret != 0)
     {
         gossip_err("Failed to destroy pvfs2_devreqcache\n");
         return -EINVAL;
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers

Reply via email to