mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[LogFS] Only write journal if dirty
This prevents unnecessary journal writes. More importantly it prevents an oops due to a journal write on failed mount.
This commit is contained in:
parent
9421502b4f
commit
c6d3830140
6 changed files with 19 additions and 13 deletions
|
@ -352,7 +352,8 @@ int logfs_segment_write(struct inode *inode, struct page *page,
|
|||
int ret;
|
||||
void *buf;
|
||||
|
||||
BUG_ON(logfs_super(sb)->s_flags & LOGFS_SB_FLAG_SHUTDOWN);
|
||||
super->s_flags |= LOGFS_SB_FLAG_DIRTY;
|
||||
BUG_ON(super->s_flags & LOGFS_SB_FLAG_SHUTDOWN);
|
||||
do_compress = logfs_inode(inode)->li_flags & LOGFS_IF_COMPRESSED;
|
||||
if (shadow->gc_level != 0) {
|
||||
/* temporarily disable compression for indirect blocks */
|
||||
|
@ -653,11 +654,13 @@ int logfs_segment_read(struct inode *inode, struct page *page,
|
|||
int logfs_segment_delete(struct inode *inode, struct logfs_shadow *shadow)
|
||||
{
|
||||
struct super_block *sb = inode->i_sb;
|
||||
struct logfs_super *super = logfs_super(sb);
|
||||
struct logfs_object_header h;
|
||||
u16 len;
|
||||
int err;
|
||||
|
||||
BUG_ON(logfs_super(sb)->s_flags & LOGFS_SB_FLAG_SHUTDOWN);
|
||||
super->s_flags |= LOGFS_SB_FLAG_DIRTY;
|
||||
BUG_ON(super->s_flags & LOGFS_SB_FLAG_SHUTDOWN);
|
||||
BUG_ON(shadow->old_ofs & LOGFS_FULLY_POPULATED);
|
||||
if (!shadow->old_ofs)
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue