patch-2.1.81 linux/fs/fat/buffer.c

Next file: linux/fs/fat/cache.c
Previous file: linux/fs/dcache.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.80/linux/fs/fat/buffer.c linux/fs/fat/buffer.c
@@ -30,9 +30,9 @@
 	 * counterproductive or just plain wrong.
 	 */
 
-	if(MSDOS_SB(sb)->cvf_format)
-	  if(MSDOS_SB(sb)->cvf_format->cvf_bread)
-	    return MSDOS_SB(sb)->cvf_format->cvf_bread(sb,block);
+	if(MSDOS_SB(sb)->cvf_format &&
+	   MSDOS_SB(sb)->cvf_format->cvf_bread)
+		return MSDOS_SB(sb)->cvf_format->cvf_bread(sb,block);
 
 	if (sb->s_blocksize == 512) {
 		ret = bread (sb->s_dev,block,512);
@@ -46,37 +46,37 @@
 
 		if (real != NULL){
 			ret = (struct buffer_head *)
-			  kmalloc (sizeof(struct buffer_head), GFP_KERNEL);
+				kmalloc (sizeof(struct buffer_head), GFP_KERNEL);
 			if (ret != NULL) {
 				/* #Specification: msdos / strategy / special device / dummy blocks
-					Many special device (Scsi optical disk for one) use
-					larger hardware sector size. This allows for higher
-					capacity.
-
-					Most of the time, the MsDOS file system that sit
-					on this device is totally unaligned. It use logically
-					512 bytes sector size, with logical sector starting
-					in the middle of a hardware block. The bad news is
-					that a hardware sector may hold data own by two
-					different files. This means that the hardware sector
-					must be read, patch and written almost all the time.
-
-					Needless to say that it kills write performance
-					on all OS.
-
-					Internally the linux msdos fs is using 512 bytes
-					logical sector. When accessing such a device, we
-					allocate dummy buffer cache blocks, that we stuff
-					with the information of a real one (1k large).
-
-					This strategy is used to hide this difference to
-					the core of the msdos fs. The slowdown is not
-					hidden though!
-				*/
+				 * Many special device (Scsi optical disk for one) use
+				 * larger hardware sector size. This allows for higher
+				 * capacity.
+
+				 * Most of the time, the MsDOS file system that sit
+				 * on this device is totally unaligned. It use logically
+				 * 512 bytes sector size, with logical sector starting
+				 * in the middle of a hardware block. The bad news is
+				 * that a hardware sector may hold data own by two
+				 * different files. This means that the hardware sector
+				 * must be read, patch and written almost all the time.
+
+				 * Needless to say that it kills write performance
+				 * on all OS.
+
+				 * Internally the linux msdos fs is using 512 bytes
+				 * logical sector. When accessing such a device, we
+				 * allocate dummy buffer cache blocks, that we stuff
+				 * with the information of a real one (1k large).
+
+				 * This strategy is used to hide this difference to
+				 * the core of the msdos fs. The slowdown is not
+				 * hidden though!
+				 */
 				/*
-					The memset is there only to catch errors. The msdos
-					fs is only using b_data
-				*/
+				 * The memset is there only to catch errors. The msdos
+				 * fs is only using b_data
+				 */
 				memset (ret,0,sizeof(*ret));
 				ret->b_data = real->b_data;
 				if (sb->s_blocksize == 2048) {
@@ -92,26 +92,26 @@
 	}
 	return ret;
 }
-struct buffer_head *fat_getblk (
-	struct super_block *sb,
-	int block)
+
+struct buffer_head *fat_getblk(struct super_block *sb, int block)
 {
 	struct buffer_head *ret = NULL;
 	PRINTK(("fat_getblk: block=0x%x\n", block));
 
-	if(MSDOS_SB(sb)->cvf_format)
-	  if(MSDOS_SB(sb)->cvf_format->cvf_getblk)
-	    return MSDOS_SB(sb)->cvf_format->cvf_getblk(sb,block);
+	if (MSDOS_SB(sb)->cvf_format &&
+	    MSDOS_SB(sb)->cvf_format->cvf_getblk)
+		return MSDOS_SB(sb)->cvf_format->cvf_getblk(sb,block);
 
 	if (sb->s_blocksize == 512){
 		ret = getblk (sb->s_dev,block,512);
-	}else{
-		/* #Specification: msdos / special device / writing
-			A write is always preceded by a read of the complete block
-			(large hardware sector size). This defeat write performance.
-			There is a possibility to optimize this when writing large
-			chunk by making sure we are filling large block. Volunteer ?
-		*/
+	} else {
+		/*
+		 * #Specification: msdos / special device / writing
+		 * A write is always preceded by a read of the complete block
+		 * (large hardware sector size). This defeat write performance.
+		 * There is a possibility to optimize this when writing large
+		 * chunk by making sure we are filling large block. Volunteer ?
+		 */
 		ret = fat_bread (sb,block);
 	}
 	return ret;
@@ -121,10 +121,10 @@
 	struct super_block *sb,
 	struct buffer_head *bh)
 {
-	if (bh != NULL){
-		if(MSDOS_SB(sb)->cvf_format)
-          	  if(MSDOS_SB(sb)->cvf_format->cvf_brelse)
-            	    return MSDOS_SB(sb)->cvf_format->cvf_brelse(sb,bh);
+	if (bh != NULL) {
+		if (MSDOS_SB(sb)->cvf_format &&
+		    MSDOS_SB(sb)->cvf_format->cvf_brelse)
+			return MSDOS_SB(sb)->cvf_format->cvf_brelse(sb,bh);
 
 		if (sb->s_blocksize == 512){
 			brelse (bh);
@@ -141,18 +141,18 @@
 void fat_mark_buffer_dirty (
 	struct super_block *sb,
 	struct buffer_head *bh,
-	int dirty_val)
+	int dirty)
 {
-	if(MSDOS_SB(sb)->cvf_format)
-          if(MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty)
-          { MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty(sb,bh,dirty_val);
-            return;
-          }
+	if (MSDOS_SB(sb)->cvf_format &&
+	    MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty) {
+		MSDOS_SB(sb)->cvf_format->cvf_mark_buffer_dirty(sb,bh,dirty);
+		return;
+	}
  
 	if (sb->s_blocksize != 512){
 		bh = bh->b_next;
 	}
-	mark_buffer_dirty (bh,dirty_val);
+	mark_buffer_dirty (bh,dirty);
 }
 
 void fat_set_uptodate (
@@ -160,11 +160,11 @@
 	struct buffer_head *bh,
 	int val)
 {
-	if(MSDOS_SB(sb)->cvf_format)
-          if(MSDOS_SB(sb)->cvf_format->cvf_set_uptodate)
-          { MSDOS_SB(sb)->cvf_format->cvf_set_uptodate(sb,bh,val);
-            return;
-          }
+	if (MSDOS_SB(sb)->cvf_format && 
+	    MSDOS_SB(sb)->cvf_format->cvf_set_uptodate) {
+		MSDOS_SB(sb)->cvf_format->cvf_set_uptodate(sb,bh,val);
+		return;
+	}
  
 	if (sb->s_blocksize != 512){
 		bh = bh->b_next;
@@ -175,9 +175,9 @@
 	struct super_block *sb,
 	struct buffer_head *bh)
 {
-	if(MSDOS_SB(sb)->cvf_format)
-          if(MSDOS_SB(sb)->cvf_format->cvf_is_uptodate)
-            return MSDOS_SB(sb)->cvf_format->cvf_is_uptodate(sb,bh);
+	if(MSDOS_SB(sb)->cvf_format &&
+	   MSDOS_SB(sb)->cvf_format->cvf_is_uptodate)
+		return MSDOS_SB(sb)->cvf_format->cvf_is_uptodate(sb,bh);
  
 	if (sb->s_blocksize != 512){
 		bh = bh->b_next;
@@ -191,11 +191,11 @@
 	int nbreq,
 	struct buffer_head *bh[32])
 {
-        if(MSDOS_SB(sb)->cvf_format)
-          if(MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block)
-          { MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block(sb,opr,nbreq,bh);
-            return;
-          }
+        if (MSDOS_SB(sb)->cvf_format &&
+	    MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block) {
+		MSDOS_SB(sb)->cvf_format->cvf_ll_rw_block(sb,opr,nbreq,bh);
+		return;
+	}
  
 	if (sb->s_blocksize == 512){
 		ll_rw_block(opr,nbreq,bh);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov