patch-2.2.0-pre1 linux/drivers/block/ll_rw_blk.c

Next file: linux/drivers/block/paride/pg.c
Previous file: linux/drivers/block/ide-probe.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.132/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
@@ -644,91 +644,12 @@
 		if (bh[i]) {
 			clear_bit(BH_Dirty, &bh[i]->b_state);
 			clear_bit(BH_Uptodate, &bh[i]->b_state);
+			bh[i]->b_end_io(bh[i], 0);
 		}
 	}
 	return;
 }
 
-void ll_rw_swap_file(int rw, kdev_t dev, unsigned int *b, int nb, char *buf)
-{
-	int i, j;
-	int buffersize;
-	int max_req;
-	unsigned long rsector;
-	kdev_t rdev;
-	struct request * req[8];
-	unsigned int major = MAJOR(dev);
-	struct semaphore sem = MUTEX_LOCKED;
-
-	if (major >= MAX_BLKDEV || !(blk_dev[major].request_fn)) {
-		printk(KERN_NOTICE "ll_rw_swap_file: trying to swap to"
-                                   " nonexistent block-device\n");
-		return;
-	}
-	max_req = NR_REQUEST;
-	switch (rw) {
-		case READ:
-			break;
-		case WRITE:
-			max_req = (NR_REQUEST * 2) / 3;
-			if (is_read_only(dev)) {
-				printk(KERN_NOTICE
-                                       "Can't swap to read-only device %s\n",
-					kdevname(dev));
-				return;
-			}
-			break;
-		default:
-			panic("ll_rw_swap: bad block dev cmd, must be R/W");
-	}
-	buffersize = PAGE_SIZE / nb;
-
-	if ((major == LOOP_MAJOR) || (major == NBD_MAJOR))
-	     max_req >>= 1;
-	for (j=0, i=0; i<nb;)
-	{
-		for (; j < 8 && i < nb; j++, i++, buf += buffersize)
-		{
-		        rdev = dev;
-			rsector = b[i] * (buffersize >> 9);
-#ifdef CONFIG_BLK_DEV_MD
-			if (major==MD_MAJOR &&
-			    md_map (MINOR(dev), &rdev,
-				    &rsector, buffersize >> 9)) {
-			        printk (KERN_ERR
-                                        "Bad md_map in ll_rw_swap_file\n");
-				return;
-			}
-#endif
-			
-			if (j == 0) {
-				req[j] = get_request_wait(max_req, rdev);
-			} else {
-				unsigned long flags;
-				spin_lock_irqsave(&io_request_lock,flags);
-				req[j] = get_request(max_req, rdev);
-				spin_unlock_irqrestore(&io_request_lock,flags);
-				if (req[j] == NULL)
-					break;
-			}
-			req[j]->cmd = rw;
-			req[j]->errors = 0;
-			req[j]->sector = rsector;
-			req[j]->nr_sectors = buffersize >> 9;
-			req[j]->current_nr_sectors = buffersize >> 9;
-			req[j]->buffer = buf;
-			req[j]->sem = &sem;
-			req[j]->bh = NULL;
-			req[j]->next = NULL;
-			add_request(MAJOR(rdev)+blk_dev,req[j]);
-		}
-		run_task_queue(&tq_disk);
-		while (j > 0) {
-			j--;
-			down(&sem);
-		}
-	}
-}
 #ifdef CONFIG_STRAM_SWAP
 extern int stram_device_init( void );
 #endif

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