[Ocfs2-commits] mfasheh commits r1357 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Aug 13 21:29:46 CDT 2004


Author: mfasheh
Date: 2004-08-13 20:29:44 -0500 (Fri, 13 Aug 2004)
New Revision: 1357

Modified:
   trunk/src/ocfs_compat.h
   trunk/src/super.c
Log:
* commit a patch by Christoph Hellwig <hch at lst.de>:
[PATCH] kill compat clutter for statfs



Modified: trunk/src/ocfs_compat.h
===================================================================
--- trunk/src/ocfs_compat.h	2004-08-13 22:23:19 UTC (rev 1356)
+++ trunk/src/ocfs_compat.h	2004-08-14 01:29:44 UTC (rev 1357)
@@ -153,6 +153,8 @@
 	return (u64)((MAJOR(dev) << 8) | MINOR(dev));
 }
 
+#define kstatfs statfs
+
 #else /* LINUX_VERSION_CODE < 2.6 */
 
 #define OCFS_GENERIC_SB_MEMBER(sb)  ((sb)->s_fs_info)

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-08-13 22:23:19 UTC (rev 1356)
+++ trunk/src/super.c	2004-08-14 01:29:44 UTC (rev 1357)
@@ -170,11 +170,11 @@
 static void ocfs_free_mem_lists (void);
 static void ocfs_delete_osb (ocfs_super * osb);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static int ocfs_statfs (struct super_block *sb, struct kstatfs *buf);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static int ocfs_sync_fs(struct super_block *sb, int wait);
 #else
-static int ocfs_statfs (struct super_block *sb, struct statfs *buf);
 static int ocfs_sync_fs(struct super_block *sb);
 #endif
 
@@ -725,11 +725,7 @@
  * ocfs_statfs()
  *
  */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 static int ocfs_statfs(struct super_block *sb, struct kstatfs *buf)
-#else
-static int ocfs_statfs(struct super_block *sb, struct statfs *buf)
-#endif
 {
 	ocfs_super *osb;
 	__u32 numbits, freebits;
@@ -780,27 +776,15 @@
 	buf->f_bsize = sb->s_blocksize;
 	buf->f_namelen = OCFS2_MAX_FILENAME_LENGTH;
 	buf->f_bavail = buf->f_bfree;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
-	buf->f_blocks =
-		(unsigned long) ((unsigned long) (numbits) *
-				 (unsigned long) (osb->s_clustersize >> osb->sb->s_blocksize_bits) -
-				 reserved_bits);
-	buf->f_bfree =
-	    (unsigned long) (freebits * (osb->s_clustersize >> osb->sb->s_blocksize_bits));
+	buf->f_blocks = (sector_t) ((unsigned long) (numbits) *
+			(unsigned long) (osb->s_clustersize >>
+					 osb->sb->s_blocksize_bits) -
+				reserved_bits);
+	buf->f_bfree = (sector_t) (freebits *
+			(osb->s_clustersize >> osb->sb->s_blocksize_bits));
 	buf->f_bavail = buf->f_bfree;
-	buf->f_files = (unsigned long) (numbits);
-	buf->f_ffree = (unsigned long) (numbits) - freebits;
-#else
-	buf->f_blocks =
-		(sector_t) ((unsigned long) (numbits) *
-			    (unsigned long) (osb->s_clustersize >> osb->sb->s_blocksize_bits) -
-			    reserved_bits);
-	buf->f_bfree =
-	    (sector_t) (freebits * (osb->s_clustersize >> osb->sb->s_blocksize_bits));
-	buf->f_bavail = buf->f_bfree;
 	buf->f_files = (sector_t) (numbits);
 	buf->f_ffree = (sector_t) (numbits) - freebits;
-#endif
 
 	brelse(bh);
 



More information about the Ocfs2-commits mailing list