Skip to contentSkip to conversation

64 bit cleanness for reiserfs for 2.4

PATCH New Oleg Drokin 1 participant 1 message Jan 11, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 64 bit cleanness for reiserfs for 2.4

Hello!

These 2 patches fixes 64 bit cleanness issues in reiserfs code.
1st patch is famous bitops on int integer type fix (we got a report there were more bitops on ints from "Dale Farnsworth" <[email protected]>,
so I performed an audit and here is the patch. Without this patch bad things should happen on 64 bit arches.

2nd patch is to fix warnings (and possibly not harmless ones) in fs/reiserfs/procfs.c when compiled on 64 bit architecture (I tested it on alpha). May be someone can come up with better solution, so I separated it as different patch.

Consider these 2 as a bugfixes and please apply.

Bye,
Oleg

include/linux/reiserfs_fs_sb.h renamed from include/linux/reiserfs_fs_sb.h.orig +2 -2
@@ -201,7 +201,7 @@
   struct buffer_head *bh ;		 /* real buffer head */
   kdev_t dev ;				 /* dev of real buffer head */
   unsigned long blocknr ;		 /* block number of real buffer head, == 0 when buffer on disk */		 
-  int state ;
+  long state ;
   struct reiserfs_journal_list *jlist ;  /* journal list this cnode lives in */
   struct reiserfs_journal_cnode *next ;  /* next in transaction list */
   struct reiserfs_journal_cnode *prev ;  /* prev in transaction list */
@@ -264,7 +264,7 @@
   struct reiserfs_journal_cnode *j_last ; /* newest journal block */
   struct reiserfs_journal_cnode *j_first ; /*  oldest journal block.  start here for traverse */
 				
-  int j_state ;			
+  long j_state ;			
   unsigned long j_trans_id ;
   unsigned long j_mount_id ;
   unsigned long j_start ;             /* start of current waiting commit (index into j_ap_blocks) */
fs/reiserfs/procfs.c renamed from fs/reiserfs.old/procfs.c +1 -1
@@ -464,7 +464,7 @@
 			"s_journal_max_commit_age: \t%i\n"
 			"s_journal_max_trans_age: \t%i\n"
 			/* incore fields */
-			"j_state: \t%i\n"			
+			"j_state: \t%li\n"			
 			"j_trans_id: \t%lu\n"
 			"j_mount_id: \t%lu\n"
 			"j_start: \t%lu\n"
fs/reiserfs/journal.c renamed from fs/reiserfs/journal.c.orig +1 -1
@@ -793,7 +793,7 @@
   while(cn) {
     if (cn->blocknr != 0) {
       if (debug) {
-        printk("block %lu, bh is %d, state %d\n", cn->blocknr, cn->bh ? 1: 0, 
+        printk("block %lu, bh is %d, state %ld\n", cn->blocknr, cn->bh ? 1: 0, 
 	        cn->state) ;
       }
       fake_bh.b_blocknr = cn->blocknr ;
fs/reiserfs/procfs.c renamed from fs/reiserfs/procfs.c.orig +8 -8
@@ -79,7 +79,7 @@
 	struct super_block *sb;
 	char *format;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	if ( sb->u.reiserfs_sb.s_properties & (1 << REISERFS_3_6) ) {
@@ -143,7 +143,7 @@
 	struct reiserfs_sb_info *r;
 	int len = 0;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	r = &sb->u.reiserfs_sb;
@@ -223,7 +223,7 @@
 	int len = 0;
 	int level;
 	
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	r = &sb->u.reiserfs_sb;
@@ -302,7 +302,7 @@
 	struct reiserfs_sb_info *r = &sb->u.reiserfs_sb;
 	int len = 0;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	r = &sb->u.reiserfs_sb;
@@ -343,7 +343,7 @@
 	int hash_code;
 	int len = 0;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	sb_info = &sb->u.reiserfs_sb;
@@ -396,7 +396,7 @@
 	int len = 0;
 	int exact;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	sb_info = &sb->u.reiserfs_sb;
@@ -447,7 +447,7 @@
 	struct reiserfs_super_block *rs;
 	int len = 0;
     
-	sb = procinfo_prologue( ( kdev_t ) ( int ) data );
+	sb = procinfo_prologue( ( kdev_t ) ( long ) data );
 	if( sb == NULL )
 		return -ENOENT;
 	r = &sb->u.reiserfs_sb;
@@ -588,7 +588,7 @@
 {
 	return ( sb->u.reiserfs_sb.procdir ) ? create_proc_read_entry
 		( name, 0, sb->u.reiserfs_sb.procdir, func, 
-		  ( void * ) ( int ) sb -> s_dev ) : NULL;
+		  ( void * ) ( long ) sb -> s_dev ) : NULL;
 }
 
 void reiserfs_proc_unregister( struct super_block *sb, const char *name )