diff options
Diffstat (limited to 'fs/ubifs/journal.c')
-rw-r--r-- | fs/ubifs/journal.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index a11ca0958a23..64b5f3a309f5 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c | |||
@@ -114,7 +114,7 @@ static inline void zero_trun_node_unused(struct ubifs_trun_node *trun) | |||
114 | */ | 114 | */ |
115 | static int reserve_space(struct ubifs_info *c, int jhead, int len) | 115 | static int reserve_space(struct ubifs_info *c, int jhead, int len) |
116 | { | 116 | { |
117 | int err = 0, err1, retries = 0, avail, lnum, offs, free, squeeze; | 117 | int err = 0, err1, retries = 0, avail, lnum, offs, squeeze; |
118 | struct ubifs_wbuf *wbuf = &c->jheads[jhead].wbuf; | 118 | struct ubifs_wbuf *wbuf = &c->jheads[jhead].wbuf; |
119 | 119 | ||
120 | /* | 120 | /* |
@@ -139,10 +139,9 @@ again: | |||
139 | * Write buffer wasn't seek'ed or there is no enough space - look for an | 139 | * Write buffer wasn't seek'ed or there is no enough space - look for an |
140 | * LEB with some empty space. | 140 | * LEB with some empty space. |
141 | */ | 141 | */ |
142 | lnum = ubifs_find_free_space(c, len, &free, squeeze); | 142 | lnum = ubifs_find_free_space(c, len, &offs, squeeze); |
143 | if (lnum >= 0) { | 143 | if (lnum >= 0) { |
144 | /* Found an LEB, add it to the journal head */ | 144 | /* Found an LEB, add it to the journal head */ |
145 | offs = c->leb_size - free; | ||
146 | err = ubifs_add_bud_to_log(c, jhead, lnum, offs); | 145 | err = ubifs_add_bud_to_log(c, jhead, lnum, offs); |
147 | if (err) | 146 | if (err) |
148 | goto out_return; | 147 | goto out_return; |
@@ -1366,7 +1365,7 @@ out_ro: | |||
1366 | * @host: host inode | 1365 | * @host: host inode |
1367 | * | 1366 | * |
1368 | * This function writes the updated version of an extended attribute inode and | 1367 | * This function writes the updated version of an extended attribute inode and |
1369 | * the host inode tho the journal (to the base head). The host inode is written | 1368 | * the host inode to the journal (to the base head). The host inode is written |
1370 | * after the extended attribute inode in order to guarantee that the extended | 1369 | * after the extended attribute inode in order to guarantee that the extended |
1371 | * attribute will be flushed when the inode is synchronized by 'fsync()' and | 1370 | * attribute will be flushed when the inode is synchronized by 'fsync()' and |
1372 | * consequently, the write-buffer is synchronized. This function returns zero | 1371 | * consequently, the write-buffer is synchronized. This function returns zero |