diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-07 12:02:46 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-05-14 00:24:23 -0400 |
commit | 208b14e507c00ff7f108e1a388dd3d8cc805a443 (patch) | |
tree | 34ec5a82825cf87d2d9a2856bde10f722a22cd14 /fs/jffs2/jffs2_fs_sb.h | |
parent | e832579fd100eb4f9658bdfefd61caf86a6cbff1 (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: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2/jffs2_fs_sb.h')
-rw-r--r-- | fs/jffs2/jffs2_fs_sb.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/jffs2/jffs2_fs_sb.h b/fs/jffs2/jffs2_fs_sb.h index 0d00bf26923b..413ef89c2d1b 100644 --- a/fs/jffs2/jffs2_fs_sb.h +++ b/fs/jffs2/jffs2_fs_sb.h | |||
@@ -133,6 +133,10 @@ struct jffs2_sb_info { | |||
133 | struct jffs2_inodirty *wbuf_inodes; | 133 | struct jffs2_inodirty *wbuf_inodes; |
134 | struct rw_semaphore wbuf_sem; /* Protects the write buffer */ | 134 | struct rw_semaphore wbuf_sem; /* Protects the write buffer */ |
135 | 135 | ||
136 | struct delayed_work wbuf_dwork; /* write-buffer write-out work */ | ||
137 | int wbuf_queued; /* non-zero delayed work is queued */ | ||
138 | spinlock_t wbuf_dwork_lock; /* protects wbuf_dwork and and wbuf_queued */ | ||
139 | |||
136 | unsigned char *oobbuf; | 140 | unsigned char *oobbuf; |
137 | int oobavail; /* How many bytes are available for JFFS2 in OOB */ | 141 | int oobavail; /* How many bytes are available for JFFS2 in OOB */ |
138 | #endif | 142 | #endif |