aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/os-linux.h
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-05-07 12:56:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-30 21:04:52 -0400
commit8bdc81c5069e43755d6e59e5e990e21ca200e8e2 (patch)
treeeee9ff0210dcd0918a864b006feed14e5f715449 /fs/jffs2/os-linux.h
parent06688905cc36b86c700f376e9bc9bb68bc67d801 (diff)
jffs2: get rid of jffs2_sync_super
Currently JFFS2 file-system maps the VFS "superblock" abstraction to the write-buffer. Namely, it uses VFS services to synchronize the write-buffer periodically. The whole "superblock write-out" VFS infrastructure is served by the 'sync_supers()' kernel thread, which wakes up every 5 (by default) seconds and writes out all dirty superblock using the '->write_super()' call-back. But the problem with this thread is that it wastes power by waking up the system every 5 seconds no matter what. So we want to kill it completely and thus, we need to make file-systems to stop using the '->write_super' VFS service, and then remove it together with the kernel thread. This patch switches the JFFS2 write-buffer management from '->write_super()'/'->s_dirt' to a delayed work. Instead of setting the 's_dirt' flag we just schedule a delayed work for synchronizing the write-buffer. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/jffs2/os-linux.h')
-rw-r--r--fs/jffs2/os-linux.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h
index 1cd3aec9d9ae..bcd983d7e7f9 100644
--- a/fs/jffs2/os-linux.h
+++ b/fs/jffs2/os-linux.h
@@ -95,6 +95,7 @@ static inline void jffs2_init_inode_info(struct jffs2_inode_info *f)
95#define jffs2_ubivol(c) (0) 95#define jffs2_ubivol(c) (0)
96#define jffs2_ubivol_setup(c) (0) 96#define jffs2_ubivol_setup(c) (0)
97#define jffs2_ubivol_cleanup(c) do {} while (0) 97#define jffs2_ubivol_cleanup(c) do {} while (0)
98#define jffs2_dirty_trigger(c) do {} while (0)
98 99
99#else /* NAND and/or ECC'd NOR support present */ 100#else /* NAND and/or ECC'd NOR support present */
100 101
@@ -135,14 +136,10 @@ void jffs2_ubivol_cleanup(struct jffs2_sb_info *c);
135#define jffs2_nor_wbuf_flash(c) (c->mtd->type == MTD_NORFLASH && ! (c->mtd->flags & MTD_BIT_WRITEABLE)) 136#define jffs2_nor_wbuf_flash(c) (c->mtd->type == MTD_NORFLASH && ! (c->mtd->flags & MTD_BIT_WRITEABLE))
136int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c); 137int jffs2_nor_wbuf_flash_setup(struct jffs2_sb_info *c);
137void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c); 138void jffs2_nor_wbuf_flash_cleanup(struct jffs2_sb_info *c);
139void jffs2_dirty_trigger(struct jffs2_sb_info *c);
138 140
139#endif /* WRITEBUFFER */ 141#endif /* WRITEBUFFER */
140 142
141static inline void jffs2_dirty_trigger(struct jffs2_sb_info *c)
142{
143 OFNI_BS_2SFFJ(c)->s_dirt = 1;
144}
145
146/* background.c */ 143/* background.c */
147int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c); 144int jffs2_start_garbage_collect_thread(struct jffs2_sb_info *c);
148void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c); 145void jffs2_stop_garbage_collect_thread(struct jffs2_sb_info *c);