public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: "Øyvind Harboe" <oyvind.harboe@zylin.com>
To: linux-mtd@lists.infradead.org
Subject: fix for small jffs2 disks
Date: Thu, 29 Apr 2004 09:39:02 +0200	[thread overview]
Message-ID: <1083224341.5794.25.camel@famine> (raw)

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

With this patch, it is possible to write to small (e.g. single sector)
flash disks.

Single sector flash disks are useful for writing configuration data that
never change, e.g. in embedded devices for serial numbers, hardware
configuration, feature selection and the like.

It has been applied to the eCos repository. To read more:

http://ecos.sourceware.org/ml/ecos-patches/2004-04/msg00043.html

-- 

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



[-- Attachment #2: smalljffs2.txt --]
[-- Type: text/plain, Size: 832 bytes --]

? smalljffs2.txt
Index: build.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/build.c,v
retrieving revision 1.55
diff -w -u -r1.55 build.c
--- build.c	28 Oct 2003 17:02:44 -0000	1.55
+++ build.c	29 Apr 2004 07:35:07 -0000
@@ -259,6 +259,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. configuration of 
+	// static paramters.
+	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:[~2004-04-29  7:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1083224341.5794.25.camel@famine \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox