summaryrefslogtreecommitdiffstats
path: root/fs/ubifs/replay.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-18 10:00:40 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-10-21 11:15:19 +0300
commit6599fcbd01baf9d57e847db103d215ea4ec088f9 (patch)
treed2b8a8805f5c9ce39609c3cbc348585f48238918 /fs/ubifs/replay.c
parent3601ba27353a968df843454e4b81155376682505 (diff)
downloadop-kernel-dev-6599fcbd01baf9d57e847db103d215ea4ec088f9.zip
op-kernel-dev-6599fcbd01baf9d57e847db103d215ea4ec088f9.tar.gz
UBIFS: do not allocate unneeded scan buffer
In 'ubifs_replay_journal()' we allocate 'sbuf' for scanning the log. However, we already have 'c->sbuf' for these purposes, so do not allocate yet another one. This reduces UBIFS memory consumption while recovering. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/replay.c')
-rw-r--r--fs/ubifs/replay.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index 7df04ba..eed0fcf 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -1013,7 +1013,6 @@ out:
int ubifs_replay_journal(struct ubifs_info *c)
{
int err, i, lnum, offs, free;
- void *sbuf = NULL;
BUILD_BUG_ON(UBIFS_TRUN_KEY > 5);
@@ -1028,10 +1027,6 @@ int ubifs_replay_journal(struct ubifs_info *c)
return -EINVAL;
}
- sbuf = vmalloc(c->leb_size);
- if (!sbuf)
- return -ENOMEM;
-
dbg_mnt("start replaying the journal");
c->replaying = 1;
lnum = c->ltail_lnum = c->lhead_lnum;
@@ -1046,7 +1041,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
lnum = UBIFS_LOG_LNUM;
offs = 0;
}
- err = replay_log_leb(c, lnum, offs, sbuf);
+ err = replay_log_leb(c, lnum, offs, c->sbuf);
if (err == 1)
/* We hit the end of the log */
break;
@@ -1079,7 +1074,6 @@ int ubifs_replay_journal(struct ubifs_info *c)
out:
destroy_replay_tree(c);
destroy_bud_list(c);
- vfree(sbuf);
c->replaying = 0;
return err;
}
OpenPOWER on IntegriCloud