[Ocfs2-commits] mfasheh commits r1691 - branches/dlm-glue/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Dec 3 19:18:03 CST 2004


Author: mfasheh
Date: 2004-12-03 19:18:01 -0600 (Fri, 03 Dec 2004)
New Revision: 1691

Modified:
   branches/dlm-glue/src/aops.c
   branches/dlm-glue/src/localalloc.c
   branches/dlm-glue/src/ocfs.h
Log:
* bring us up to date with trunk, revision 1688. I also took the
  liberty of turning the last few __u32's in localalloc.c into u32.



Modified: branches/dlm-glue/src/aops.c
===================================================================
--- branches/dlm-glue/src/aops.c	2004-12-04 01:04:46 UTC (rev 1690)
+++ branches/dlm-glue/src/aops.c	2004-12-04 01:18:01 UTC (rev 1691)
@@ -605,6 +605,7 @@
 	.prepare_write	= ocfs_prepare_write,
 	.commit_write	= ocfs_commit_write,
 	.bmap		= ocfs_bmap,
+	.sync_page	= block_sync_page,
 
 	/*
 	 * On a 2.4 system, we are only adding this here as a dummy basically.

Modified: branches/dlm-glue/src/localalloc.c
===================================================================
--- branches/dlm-glue/src/localalloc.c	2004-12-04 01:04:46 UTC (rev 1690)
+++ branches/dlm-glue/src/localalloc.c	2004-12-04 01:18:01 UTC (rev 1691)
@@ -31,6 +31,7 @@
 #include <linux/types.h>
 #include <linux/slab.h>
 #include <linux/highmem.h>
+#include <linux/bitops.h>
 
 #include "ocfs_log.h"
 #include "ocfs.h"
@@ -53,11 +54,11 @@
 
 static inline int ocfs_local_alloc_window_bits(ocfs_super *osb);
 
-static __u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc);
+static u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc);
 
 static int ocfs_local_alloc_find_clear_bits(ocfs_super *osb,
 				      ocfs2_dinode *alloc,
-				      __u32 numbits);
+				      u32 numbits);
 
 static void ocfs_clear_local_alloc(ocfs2_dinode *alloc);
 
@@ -136,7 +137,7 @@
 	int status = 0;
 	ocfs2_dinode *alloc = NULL;
 	struct buffer_head *alloc_bh = NULL;
-	__u32 num_used;
+	u32 num_used;
 	struct inode *inode = NULL;
 
 	LOG_ENTRY();
@@ -620,21 +621,17 @@
 /*
  * ocfs_local_alloc_count_bits
  */
-static __u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc)
+static u32 ocfs_local_alloc_count_bits(ocfs2_dinode *alloc)
 {
 	int i;
-	__u8 tmp;
-	__u8 *buffer;
-	__u32 count = 0;
+	u8 *buffer;
+	u32 count = 0;
 
 	LOG_ENTRY();
 
 	buffer = LOCAL_ALLOC(alloc)->la_bitmap;
-	for (i = 0; i < LOCAL_ALLOC(alloc)->la_size; i++) {
-		memcpy(&tmp, buffer, 1);
-		count+= BITCOUNT(tmp);
-		buffer++;
-	}
+	for (i = 0; i < LOCAL_ALLOC(alloc)->la_size; i++)
+		count += hweight8(buffer[i]);
 
 	LOG_EXIT_ULONG ((unsigned long)count);
 	return(count);
@@ -645,7 +642,7 @@
  */
 static int ocfs_local_alloc_find_clear_bits(ocfs_super *osb,
 					    ocfs2_dinode *alloc,
-					    __u32 numbits)
+					    u32 numbits)
 {
 	int numfound, bitoff, left, startoff, lastzero;
 	void *bitmap = NULL;

Modified: branches/dlm-glue/src/ocfs.h
===================================================================
--- branches/dlm-glue/src/ocfs.h	2004-12-04 01:04:46 UTC (rev 1690)
+++ branches/dlm-glue/src/ocfs.h	2004-12-04 01:18:01 UTC (rev 1691)
@@ -60,12 +60,6 @@
 	} while (0)
 
 
-#define BITCOUNT(x)     (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255)
-#define BX_(x)          ((x) - (((x)>>1)&0x77777777) \
-			     - (((x)>>2)&0x33333333) \
-			     - (((x)>>3)&0x11111111))
-
-
 #define OCFS_CURRENT_TIME               ocfs_get_seconds(CURRENT_TIME)
 #define OCFS_SET_INODE_TIME(i, x, y)    (ocfs_get_seconds(i->x) = (y))
 



More information about the Ocfs2-commits mailing list