Commit fc0b80cb authored by David Woodhouse's avatar David Woodhouse

JFFS2: Remove obsolete structure definitions and update comments.

New eyes are looking over ancient code and comments which were put
in as the design was first coming together... and which don't make
even the slightest bit of sense any more.
Signed-off-by: default avatarArtem Bityuckiy <dedekind@infradead.org>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
parent ca572e8b
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: nodelist.h,v 1.124 2004/11/17 09:30:02 dedekind Exp $ * $Id: nodelist.h,v 1.126 2004/11/19 15:06:29 dedekind Exp $
* *
*/ */
...@@ -107,16 +107,6 @@ struct jffs2_raw_node_ref ...@@ -107,16 +107,6 @@ struct jffs2_raw_node_ref
#define ref_obsolete(ref) (((ref)->flash_offset & 3) == REF_OBSOLETE) #define ref_obsolete(ref) (((ref)->flash_offset & 3) == REF_OBSOLETE)
#define mark_ref_normal(ref) do { (ref)->flash_offset = ref_offset(ref) | REF_NORMAL; } while(0) #define mark_ref_normal(ref) do { (ref)->flash_offset = ref_offset(ref) | REF_NORMAL; } while(0)
/*
Used for keeping track of deletion nodes &c, which can only be marked
as obsolete when the node which they mark as deleted has actually been
removed from the flash.
*/
struct jffs2_raw_node_ref_list {
struct jffs2_raw_node_ref *rew;
struct jffs2_raw_node_ref_list *next;
};
/* For each inode in the filesystem, we need to keep a record of /* For each inode in the filesystem, we need to keep a record of
nlink, because it would be a PITA to scan the whole directory tree nlink, because it would be a PITA to scan the whole directory tree
at read_inode() time to calculate it, and to keep sufficient information at read_inode() time to calculate it, and to keep sufficient information
...@@ -156,12 +146,11 @@ struct jffs2_inode_cache { ...@@ -156,12 +146,11 @@ struct jffs2_inode_cache {
struct jffs2_full_dnode struct jffs2_full_dnode
{ {
struct jffs2_raw_node_ref *raw; struct jffs2_raw_node_ref *raw;
uint32_t ofs; /* Don't really need this, but optimisation */ uint32_t ofs; /* The offset to which the data of this node belongs */
uint32_t size; uint32_t size;
uint32_t frags; /* Number of fragments which currently refer uint32_t frags; /* Number of fragments which currently refer
to this node. When this reaches zero, to this node. When this reaches zero,
the node is obsolete. the node is obsolete. */
*/
}; };
/* /*
...@@ -186,6 +175,7 @@ struct jffs2_full_dirent ...@@ -186,6 +175,7 @@ struct jffs2_full_dirent
unsigned char type; unsigned char type;
unsigned char name[0]; unsigned char name[0];
}; };
/* /*
Fragments - used to build a map of which raw node to obtain Fragments - used to build a map of which raw node to obtain
data from for each part of the ino data from for each part of the ino
...@@ -195,7 +185,7 @@ struct jffs2_node_frag ...@@ -195,7 +185,7 @@ struct jffs2_node_frag
struct rb_node rb; struct rb_node rb;
struct jffs2_full_dnode *node; /* NULL for holes */ struct jffs2_full_dnode *node; /* NULL for holes */
uint32_t size; uint32_t size;
uint32_t ofs; /* Don't really need this, but optimisation */ uint32_t ofs; /* The offset to which this fragment belongs */
}; };
struct jffs2_eraseblock struct jffs2_eraseblock
...@@ -214,14 +204,6 @@ struct jffs2_eraseblock ...@@ -214,14 +204,6 @@ struct jffs2_eraseblock
struct jffs2_raw_node_ref *last_node; struct jffs2_raw_node_ref *last_node;
struct jffs2_raw_node_ref *gc_node; /* Next node to be garbage collected */ struct jffs2_raw_node_ref *gc_node; /* Next node to be garbage collected */
/* For deletia. When a dirent node in this eraseblock is
deleted by a node elsewhere, that other node can only
be marked as obsolete when this block is actually erased.
So we keep a list of the nodes to mark as obsolete when
the erase is completed.
*/
// MAYBE struct jffs2_raw_node_ref_list *deletia;
}; };
#define ACCT_SANITY_CHECK(c, jeb) do { \ #define ACCT_SANITY_CHECK(c, jeb) do { \
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* For licensing information, see the file 'LICENCE' in this directory. * For licensing information, see the file 'LICENCE' in this directory.
* *
* $Id: scan.c,v 1.114 2004/11/16 20:36:12 dwmw2 Exp $ * $Id: scan.c,v 1.115 2004/11/17 12:59:08 dedekind Exp $
* *
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -160,11 +160,8 @@ int jffs2_scan_medium(struct jffs2_sb_info *c) ...@@ -160,11 +160,8 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
case BLK_STATE_PARTDIRTY: case BLK_STATE_PARTDIRTY:
/* Some data, but not full. Dirty list. */ /* Some data, but not full. Dirty list. */
/* Except that we want to remember the block with most free space, /* We want to remember the block with most free space
and stick it in the 'nextblock' position to start writing to it. and stick it in the 'nextblock' position to start writing to it. */
Later when we do snapshots, this must be the most recent block,
not the one with most free space.
*/
if (jeb->free_size > min_free(c) && if (jeb->free_size > min_free(c) &&
(!c->nextblock || c->nextblock->free_size < jeb->free_size)) { (!c->nextblock || c->nextblock->free_size < jeb->free_size)) {
/* Better candidate for the next writes to go to */ /* Better candidate for the next writes to go to */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment