Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Subject: Re: 2.0.30 on the alpha?
Date: Wed, 9 Apr 1997 22:05:21 -0600 (MDT)	[thread overview]
Message-ID: <199704100405.WAA16931@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <199704100012.UAA12204@alef.bogon.nul>

> 
> I've applied axp-diffs-2.0.21 as well as em86-patch and traparg-patch-2.0 to
> support em86 (works fine w/ 2.0.29) and the compile bails at:
> 
> gcc -D__KERNEL__ -I/usr/src/linux-2.0.30/include -Wall -Wstrict-prototypes -g
> -O2 -pipe -mno-fp-regs  -c -o block_dev.o block_dev.c
> block_dev.c:25: conflicting types for `block_write'
.....

Sigh, recent changes in block_dev.c indeed do not take into account
changes on Alpha.  You likely patched first Intel sources to 2.0.30 and
applied axp-diffs-2.0.21 on the top, right?  Otherwise you would get
rejects from 'patch'.

Here are patches to block_dev.c (2.0.29, Alpha version) which mimic
changes on Intel side and maintain compatibility with axp-diffs.

If you are patching 2.0.29-Alpha you will be left with block_dev.c.orig
after an incomplete patch.  Apply these diffs to THIS file and use
results as block_dev.c

  Michal

--- block_dev.c.orig	Sat Dec 21 17:58:45 1996
+++ block_dev.c	Wed Apr  9 20:35:08 1997
@@ -20,21 +20,19 @@
 #define MAX_BUF_PER_PAGE (PAGE_SIZE / 512)
 #define NBUF 64
 
-long block_write(struct inode * inode, struct file * filp, const char * buf, unsigned long count)
+long block_write(struct inode * inode, struct file * filp,
+       const char * buf, unsigned long count)
 {
-	int blocksize, blocksize_bits, i, j, buffercount,write_error;
+	int blocksize, blocksize_bits, i, buffercount,write_error;
 	long block, blocks;
 	loff_t offset;
 	long chars;
 	long written = 0;
-	int cluster_list[MAX_BUF_PER_PAGE];
 	struct buffer_head * bhlist[NBUF];
-	int blocks_per_cluster;
 	unsigned long size;
 	kdev_t dev;
 	struct buffer_head * bh, *bufferlist[NBUF];
 	register char * p;
-	long excess;
 
 	write_error = buffercount = 0;
 	dev = inode->i_rdev;
@@ -51,8 +49,6 @@
 		i >>= 1;
 	}
 
-	blocks_per_cluster = PAGE_SIZE / blocksize;
-
 	block = filp->f_pos >> blocksize_bits;
 	offset = filp->f_pos & (blocksize-1);
 
@@ -68,15 +64,14 @@
 			chars=count;
 
 #if 0
-		if (chars == blocksize)
-			bh = getblk(dev, block, blocksize);
-		else
-			bh = breada(dev,block,block+1,block+2,-1);
-
+		/* get the buffer head */
+		{
+			struct buffer_head * (*fn)(kdev_t, int, int) = getblk;
+			if (chars != blocksize)
+				fn = bread;
+			bh = fn(dev, block, blocksize);
+		}
 #else
-		for(i=0; i<blocks_per_cluster; i++) cluster_list[i] = block+i;
-		if((block % blocks_per_cluster) == 0)
-		  generate_cluster(dev, cluster_list, blocksize);
 		bh = getblk(dev, block, blocksize);
 
 		if (chars != blocksize && !buffer_uptodate(bh)) {
@@ -90,15 +85,8 @@
 		    blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9) / 2;
 		    if (block + blocks > size) blocks = size - block;
 		    if (blocks > NBUF) blocks=NBUF;
-		    excess = (block + blocks) % blocks_per_cluster;
-		    if ( blocks > excess )
-			blocks -= excess;
 		    bhlist[0] = bh;
 		    for(i=1; i<blocks; i++){
-		      if(((i+block) % blocks_per_cluster) == 0) {
-			for(j=0; j<blocks_per_cluster; j++) cluster_list[j] = block+i+j;
-			generate_cluster(dev, cluster_list, blocksize);
-		      };
 		      bhlist[i] = getblk (dev, block+i, blocksize);
 		      if(!bhlist[i]){
 			while(i >= 0) brelse(bhlist[i--]);
@@ -157,7 +145,8 @@
 	return written;
 }
 
-long block_read(struct inode * inode, struct file * filp, char * buf, unsigned long count)
+long block_read(struct inode * inode, struct file * filp,
+       char * buf, unsigned long count)
 {
 	unsigned int block;
 	loff_t offset;
@@ -165,8 +154,6 @@
 	int blocksize_bits, i;
 	unsigned long blocks, rblocks, left;
 	int bhrequest, uptodate;
-	int cluster_list[MAX_BUF_PER_PAGE];
-	int blocks_per_cluster;
 	struct buffer_head ** bhb, ** bhe;
 	struct buffer_head * buflist[NBUF];
 	struct buffer_head * bhreq[NBUF];
@@ -174,7 +161,6 @@
 	loff_t size;
 	kdev_t dev;
 	long read;
-	long excess;
 
 	dev = inode->i_rdev;
 	blocksize = BLOCK_SIZE;
@@ -193,8 +179,6 @@
 	else
 		size = INT_MAX;
 
-	blocks_per_cluster = PAGE_SIZE / blocksize;
-
 	if (offset > size)
 		left = 0;
 	/* size - offset might not fit into left, so check explicitly. */
@@ -215,9 +199,6 @@
 	if (filp->f_reada) {
 	        if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
 			blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
-		excess = (block + blocks) % blocks_per_cluster;
-		if ( blocks > excess )
-			blocks -= excess;		
 		if (rblocks > blocks)
 			blocks = rblocks;
 		
@@ -240,12 +221,6 @@
 		uptodate = 1;
 		while (blocks) {
 			--blocks;
-#if 1
-			if((block % blocks_per_cluster) == 0) {
-			  for(i=0; i<blocks_per_cluster; i++) cluster_list[i] = block+i;
-			  generate_cluster(dev, cluster_list, blocksize);
-			}
-#endif
 			*bhb = getblk(dev, block++, blocksize);
 			if (*bhb && !buffer_uptodate(*bhb)) {
 				uptodate = 0;
@@ -266,7 +241,6 @@
 		/* Now request them all */
 		if (bhrequest) {
 			ll_rw_block(READ, bhrequest, bhreq);
-			refill_freelist(blocksize);
 		}
 
 		do { /* Finish off all I/O that has actually completed */

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

  reply	other threads:[~1997-04-10  4:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-09 15:12 2.0.30 on the alpha? Al Potter
1997-04-10  4:05 ` Michal Jaegermann [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-04-10 12:51 Michael Alan Dorman
     [not found] <87bu7nvy4o.fsf@calder.med.miami.edu>
1997-04-10 15:22 ` Michal Jaegermann
1997-04-10 15:34   ` Mike Loseke
     [not found] <199704101534.JAA21230@bamboo.verinet.com>
1997-04-10 16:05 ` Woodstock
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox