diff options
| author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-18 03:00:40 -0400 |
|---|---|---|
| committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2010-10-21 04:15:19 -0400 |
| commit | 6599fcbd01baf9d57e847db103d215ea4ec088f9 (patch) | |
| tree | d2b8a8805f5c9ce39609c3cbc348585f48238918 | |
| parent | 3601ba27353a968df843454e4b81155376682505 (diff) | |
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>
| -rw-r--r-- | fs/ubifs/replay.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 7df04ba4878e..eed0fcff8d73 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
| @@ -1013,7 +1013,6 @@ out: | |||
| 1013 | int ubifs_replay_journal(struct ubifs_info *c) | 1013 | int ubifs_replay_journal(struct ubifs_info *c) |
| 1014 | { | 1014 | { |
| 1015 | int err, i, lnum, offs, free; | 1015 | int err, i, lnum, offs, free; |
| 1016 | void *sbuf = NULL; | ||
| 1017 | 1016 | ||
| 1018 | BUILD_BUG_ON(UBIFS_TRUN_KEY > 5); | 1017 | BUILD_BUG_ON(UBIFS_TRUN_KEY > 5); |
| 1019 | 1018 | ||
| @@ -1028,10 +1027,6 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
| 1028 | return -EINVAL; | 1027 | return -EINVAL; |
| 1029 | } | 1028 | } |
| 1030 | 1029 | ||
| 1031 | sbuf = vmalloc(c->leb_size); | ||
| 1032 | if (!sbuf) | ||
| 1033 | return -ENOMEM; | ||
| 1034 | |||
| 1035 | dbg_mnt("start replaying the journal"); | 1030 | dbg_mnt("start replaying the journal"); |
| 1036 | c->replaying = 1; | 1031 | c->replaying = 1; |
| 1037 | lnum = c->ltail_lnum = c->lhead_lnum; | 1032 | lnum = c->ltail_lnum = c->lhead_lnum; |
| @@ -1046,7 +1041,7 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
| 1046 | lnum = UBIFS_LOG_LNUM; | 1041 | lnum = UBIFS_LOG_LNUM; |
| 1047 | offs = 0; | 1042 | offs = 0; |
| 1048 | } | 1043 | } |
| 1049 | err = replay_log_leb(c, lnum, offs, sbuf); | 1044 | err = replay_log_leb(c, lnum, offs, c->sbuf); |
| 1050 | if (err == 1) | 1045 | if (err == 1) |
| 1051 | /* We hit the end of the log */ | 1046 | /* We hit the end of the log */ |
| 1052 | break; | 1047 | break; |
| @@ -1079,7 +1074,6 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
| 1079 | out: | 1074 | out: |
| 1080 | destroy_replay_tree(c); | 1075 | destroy_replay_tree(c); |
| 1081 | destroy_bud_list(c); | 1076 | destroy_bud_list(c); |
| 1082 | vfree(sbuf); | ||
| 1083 | c->replaying = 0; | 1077 | c->replaying = 0; |
| 1084 | return err; | 1078 | return err; |
| 1085 | } | 1079 | } |
