All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: linux-mtd@lists.infradead.org
Subject: PATCH: allow JFFS2 to write to really small disks
Date: Wed, 31 Aug 2005 11:28:12 +0200	[thread overview]
Message-ID: <1125480492.18626.42.camel@localhost.localdomain> (raw)

[-- 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;

             reply	other threads:[~2005-08-31  9:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31  9:28 Øyvind Harboe [this message]
2005-09-01 10:05 ` PATCH: allow JFFS2 to write to really small disks 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1125480492.18626.42.camel@localhost.localdomain \
    --to=oyvind.harboe@zylin.com \
    --cc=linux-mtd@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.