public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* PATCH: allow JFFS2 to write to really small disks
@ 2005-08-31  9:28 Øyvind Harboe
  2005-09-01 10:05 ` Jörn Engel
  0 siblings, 1 reply; 14+ messages in thread
From: Øyvind Harboe @ 2005-08-31  9:28 UTC (permalink / raw)
  To: linux-mtd

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

The attached patch allows JFFS2 to write to really small JFFS2 disks.

This is e.g. useful when using JFFS2 for in-system one time programming
of embedded device parameters: serial number, MAC, etc.


Comments?

-- 
Øyvind Harboe
http://www.zylin.com

[-- Attachment #2: jffs2rom.txt --]
[-- Type: text/x-patch, Size: 893 bytes --]

Index: build.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/build.c,v
retrieving revision 1.76
diff -u -r1.76 build.c
--- build.c    30 Jul 2005 15:29:27 -0000	1.76
+++ build.c    31 Aug 2005 09:01:34 -0000
@@ -279,6 +279,14 @@
 
	c->resv_blocks_write = c->resv_blocks_deletion + (size / c->sector_size);
 
+	/* If the flash disk is smaller than resv_blocks_write, then we 
+	   allow writing to the disk anyway. The flash disk is then most likely
+	      being used as write once - read many medimum, e.g. in-system configuration of 
+	         static parameters(e.g. MAC address of device in stored in "ROM"). */
+		 if (c->resv_blocks_write * c->sector_size > c->flash_size) {
+		   c->resv_blocks_write = 0; 
+		   }
+
	/* When do we let the GC thread run in the background */
 
	c->resv_blocks_gctrigger = c->resv_blocks_write + 1;

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-09-05 12:33 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-31  9:28 PATCH: allow JFFS2 to write to really small disks Øyvind Harboe
2005-09-01 10:05 ` Jörn Engel
2005-09-01 11:12   ` Øyvind Harboe
2005-09-01 11:44     ` Jörn Engel
2005-09-01 11:52       ` Øyvind Harboe
2005-09-01 12:00         ` Jörn Engel
2005-09-01 12:45           ` Øyvind Harboe
2005-09-01 12:57             ` Jörn Engel
2005-09-01 13:00               ` Josh Boyer
2005-09-01 13:06               ` Øyvind Harboe
2005-09-02 12:44               ` Øyvind Harboe
2005-09-04  9:00                 ` Jörn Engel
2005-09-05 10:05                   ` oyvind.harboe
2005-09-05 10:27                     ` Jörn Engel

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