mtd/drivers/mtd/devices blkmtd.c,1.15,1.16

spse at infradead.org spse at infradead.org
Thu Sep 12 12:29:34 EDT 2002


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv3026

Modified Files:
	blkmtd.c 
Log Message:

- remove outgoing write queue and kernel thread. Replace with a kiobuf
  which is filled on writes and written out when full or a write to an
  earlier block is made.

- treat erases like writes and remove the 'erase_page' which was
  incorrectly used anyway as all entries in a kiobuf cannot point to
  the same page.

- replace readpage() with read_pages() which reads in a list of
  required pages.

- Add a kiobuf into the struct blkmtd_dev for reading and only allocate
  another if this one is in use. This is protected by the iobuf_locks.

- blkmtd_write(), blkmtd_erase() now call write_pages() do write the
  data into the pages in the cache.

- commit_pages() added to write the dirty pages to disk.

- add 'sync' option to force all writes to be synchronous.


Index: blkmtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/blkmtd.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- blkmtd.c	11 Sep 2002 14:10:14 -0000	1.15
+++ blkmtd.c	12 Sep 2002 16:29:31 -0000	1.16
@@ -1,48 +1,28 @@
-/* 
+/*
  * $Id$
  *
  * blkmtd.c - use a block device as a fake MTD
  *
  * Author: Simon Evans <spse at secret.org.uk>
  *
- * Copyright (C) 2001 Simon Evans
- * 
+ * Copyright (C) 2001,2002 Simon Evans
[...1414 lines suppressed...]
@@ -1323,19 +1050,7 @@
 		/* Everything is ok if we got here */
 		return 0;
 
-	/* There are no devices, so kill the thread and get quit */
-	write_task_finish = 1;
-	wake_up_interruptible(&thr_wq);
-	down(&thread_sem);
-
  init_err:
-	if(write_queue) {
-		kfree(write_queue);
-		write_queue = NULL;
-	}
-
-	if(erase_page) 
-		__free_pages(erase_page, 0);
 	return -EINVAL;
 }
 





More information about the linux-mtd-cvs mailing list