mtd/fs/jffs2 file.c,1.86,1.87 nodelist.h,1.94,1.95
nodemgmt.c,1.96,1.97 os-linux.h,1.28,1.29 super-v24.c,1.66,1.67
super.c,1.81,1.82 wbuf.c,1.34,1.35
David Woodhouse
dwmw2 at infradead.org
Sun Aug 24 06:29:13 EDT 2003
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv15022
Modified Files:
file.c nodelist.h nodemgmt.c os-linux.h super-v24.c super.c
wbuf.c
Log Message:
Remove magic arg to jffs2_flush_wbuf()
Index: file.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/file.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -r1.86 -r1.87
--- file.c 30 Jun 2003 10:58:57 -0000 1.86
+++ file.c 24 Aug 2003 10:29:09 -0000 1.87
@@ -44,7 +44,7 @@
*/
down(&c->alloc_sem);
down(&f->sem);
- jffs2_flush_wbuf(c,2);
+ jffs2_flush_wbuf_gc(c);
up(&f->sem);
up(&c->alloc_sem);
Index: nodelist.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.h,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -r1.94 -r1.95
--- nodelist.h 3 Jul 2003 10:35:45 -0000 1.94
+++ nodelist.h 24 Aug 2003 10:29:09 -0000 1.95
@@ -383,7 +383,8 @@
#ifdef CONFIG_JFFS2_FS_NAND
/* wbuf.c */
-int jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad);
+int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c);
+int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c);
int jffs2_check_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
int jffs2_write_nand_cleanmarker(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
int jffs2_nand_read_failcnt(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb);
Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodemgmt.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- nodemgmt.c 24 Aug 2003 09:58:51 -0000 1.96
+++ nodemgmt.c 24 Aug 2003 10:29:09 -0000 1.97
@@ -161,7 +161,7 @@
if (jffs2_wbuf_dirty(c)) {
spin_unlock(&c->erase_completion_lock);
D1(printk(KERN_DEBUG "jffs2_do_reserve_space: Flushing write buffer\n"));
- jffs2_flush_wbuf(c, 1);
+ jffs2_flush_wbuf_pad(c);
spin_lock(&c->erase_completion_lock);
/* We know nobody's going to have changed nextblock. Just continue */
}
@@ -219,7 +219,7 @@
D1(printk(KERN_DEBUG "jffs2_do_reserve_space: Flushing write buffer\n"));
/* c->nextblock is NULL, no update to c->nextblock allowed */
spin_unlock(&c->erase_completion_lock);
- jffs2_flush_wbuf(c, 1);
+ jffs2_flush_wbuf_pad(c);
spin_lock(&c->erase_completion_lock);
/* Have another go. It'll be on the erasable_list now */
return -EAGAIN;
@@ -347,7 +347,7 @@
if (jffs2_wbuf_dirty(c)) {
/* Flush the last write in the block if it's outstanding */
spin_unlock(&c->erase_completion_lock);
- jffs2_flush_wbuf(c, 1);
+ jffs2_flush_wbuf_pad(c);
spin_lock(&c->erase_completion_lock);
}
Index: os-linux.h
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/os-linux.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- os-linux.h 2 Jul 2003 10:46:00 -0000 1.28
+++ os-linux.h 24 Aug 2003 10:29:09 -0000 1.29
@@ -111,7 +111,8 @@
#define jffs2_flash_write(c, ofs, len, retlen, buf) ((c)->mtd->write((c)->mtd, ofs, len, retlen, buf))
#define jffs2_flash_read(c, ofs, len, retlen, buf) ((c)->mtd->read((c)->mtd, ofs, len, retlen, buf))
-#define jffs2_flush_wbuf(c, flag) do { ; } while(0)
+#define jffs2_flush_wbuf_pad(c, flag) do { ; } while(0)
+#define jffs2_flush_wbuf_gc(c, flag) do { ; } while(0)
#define jffs2_nand_read_failcnt(c,jeb) do { ; } while(0)
#define jffs2_write_nand_badblock(c,jeb) do { ; } while(0)
#define jffs2_nand_flash_setup(c) (0)
Index: super-v24.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super-v24.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- super-v24.c 30 Jun 2003 10:58:58 -0000 1.66
+++ super-v24.c 24 Aug 2003 10:29:09 -0000 1.67
@@ -84,7 +84,7 @@
if (!(sb->s_flags & MS_RDONLY))
jffs2_stop_garbage_collect_thread(c);
down(&c->alloc_sem);
- jffs2_flush_wbuf(c, 1);
+ jffs2_flush_wbuf_pad(c);
up(&c->alloc_sem);
jffs2_free_ino_caches(c);
jffs2_free_raw_node_refs(c);
Index: super.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- super.c 1 Jul 2003 09:49:53 -0000 1.81
+++ super.c 24 Aug 2003 10:29:09 -0000 1.82
@@ -258,7 +258,7 @@
if (!(sb->s_flags & MS_RDONLY))
jffs2_stop_garbage_collect_thread(c);
down(&c->alloc_sem);
- jffs2_flush_wbuf(c, 1);
+ jffs2_flush_wbuf_pad(c);
up(&c->alloc_sem);
jffs2_free_ino_caches(c);
jffs2_free_raw_node_refs(c);
Index: wbuf.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/wbuf.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- wbuf.c 1 Jul 2003 22:37:20 -0000 1.34
+++ wbuf.c 24 Aug 2003 10:29:09 -0000 1.35
@@ -109,7 +109,7 @@
/* if !c->nextblock then the tail will have got flushed from
jffs2_do_reserve_space() anyway. */
if(c->nextblock)
- jffs2_flush_wbuf(c, 2); /* pad and adjust nextblock */
+ jffs2_flush_wbuf_gc(c);
up(&c->alloc_sem);
}
@@ -120,7 +120,7 @@
1: Pad, do not adjust nextblock free_size
2: Pad, adjust nextblock free_size
*/
-int jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
+static int __jffs2_flush_wbuf(struct jffs2_sb_info *c, int pad)
{
int ret;
size_t retlen;
@@ -216,12 +216,22 @@
spin_unlock(&c->erase_completion_lock);
memset(c->wbuf,0xff,c->wbuf_pagesize);
- /* adjust write buffer offset, else we get a non contigous write bug */
+ /* adjust write buffer offset, else we get a non contiguous write bug */
c->wbuf_ofs+= c->wbuf_pagesize;
c->wbuf_len = 0;
return 0;
}
+int jffs2_flush_wbuf_gc(struct jffs2_sb_info *c)
+{
+ return __jffs2_flush_wbuf(c, 2);
+}
+
+int jffs2_flush_wbuf_pad(struct jffs2_sb_info *c)
+{
+ return __jffs2_flush_wbuf(c, 1);
+}
+
#define PAGE_DIV(x) ( (x) & (~(c->wbuf_pagesize - 1)) )
#define PAGE_MOD(x) ( (x) & (c->wbuf_pagesize - 1) )
int jffs2_flash_writev(struct jffs2_sb_info *c, const struct iovec *invecs, unsigned long count, loff_t to, size_t *retlen)
@@ -258,7 +268,7 @@
/* It's a write to a new block */
if (c->wbuf_len) {
D1(printk(KERN_DEBUG "jffs2_flash_writev() to 0x%lx causes flush of wbuf at 0x%08x\n", (unsigned long)to, c->wbuf_ofs));
- ret = jffs2_flush_wbuf(c, 1);
+ ret = jffs2_flush_wbuf_pad(c);
if (ret) {
/* the underlying layer has to check wbuf_len to do the cleanup */
D1(printk(KERN_WARNING "jffs2_flush_wbuf() called from jffs2_flash_writev() failed %d\n", ret));
@@ -324,7 +334,7 @@
}
/* write buffer is full, flush buffer */
- ret = jffs2_flush_wbuf(c, 0);
+ ret = __jffs2_flush_wbuf(c, 0);
if (ret) {
/* the underlying layer has to check wbuf_len to do the cleanup */
D1(printk(KERN_WARNING "jffs2_flush_wbuf() called from jffs2_flash_writev() failed %d\n", ret));
More information about the linux-mtd-cvs
mailing list