[Ocfs2-commits] manish commits r816 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Mar 29 15:59:11 CST 2004


Author: manish
Date: 2004-03-29 15:59:10 -0600 (Mon, 29 Mar 2004)
New Revision: 816

Modified:
   trunk/src/inode.c
Log:
Fixes for SuSE build


Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-03-29 21:29:48 UTC (rev 815)
+++ trunk/src/inode.c	2004-03-29 21:59:10 UTC (rev 816)
@@ -1387,6 +1387,11 @@
 #define OCFS_KIO_BLOCKS(_iobuf)  ((_iobuf)->blocks)
 #endif
 
+#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
+#define KERNEL_NO_F_IOBUF 1
+#elif defined(SUSE) && LINUX_VERSION_CODE >= LinuxVersionCode(2,4,20)
+#define KERNEL_NO_F_IOBUF 1
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 /*
@@ -1395,7 +1400,7 @@
  */
 ssize_t ocfs_rw_direct (int rw, struct file *filp, char *buf, size_t size, loff_t * offp)
 {
-#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
+#ifdef KERNEL_NO_F_IOBUF
 	struct kiobuf *iobuf;
 #else
 	struct kiobuf *iobuf = filp->f_iobuf;
@@ -1536,8 +1541,10 @@
                 if (nbhs > max_sectors)
                         nbhs = max_sectors;
 
-#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
+#ifdef KERNEL_NO_F_IOBUF
 		err = alloc_kiovec_sz (1, &iobuf, &nbhs);
+		if (err)
+			goto out;
 #else
 		if (test_and_set_bit(0, &filp->f_iobuf_lock)) {
 			/*
@@ -1551,12 +1558,6 @@
 		}
 				
 #endif
-
-#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
-		if (err)
-			goto out;
-#endif
-
 		inuse = true;
 
                 totalioblocks = 0;
@@ -1619,7 +1620,7 @@
                         if (err != iosize)
                                 break;
                 }
-#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
+#ifdef KERNEL_NO_F_IOBUF
 		free_kiovec_sz(1, &iobuf, &nbhs);
 #else
 		if (!new_iobuf)
@@ -1638,7 +1639,7 @@
         }
 
 out:
-#if LINUX_VERSION_CODE <= LinuxVersionCode(2,4,10)
+#ifdef KERNEL_NO_F_IOBUF
         if (inuse)
            free_kiovec_sz (1, &iobuf, &nbhs);
 #else



More information about the Ocfs2-commits mailing list