Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 155304
b: refs/heads/master
c: 431102f
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Jul 9, 2009
1 parent e3eb302 commit aa1b006
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ed43f2f06cc1cec7ec2dc235c908530bc8c796eb
refs/heads/master: 431102fed3effe4e4e19678830ddab7f05c34bf9
22 changes: 3 additions & 19 deletions trunk/fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,7 @@ static int is_last_write(const struct ubifs_info *c, void *buf, int offs)
empty_offs = ALIGN(offs + 1, c->min_io_size);
check_len = c->leb_size - empty_offs;
p = buf + empty_offs - offs;

for (; check_len > 0; check_len--)
if (*p++ != 0xff)
return 0;
return 1;
return is_empty(p, check_len);
}

/**
Expand Down Expand Up @@ -814,7 +810,7 @@ struct ubifs_scan_leb *ubifs_recover_log_leb(struct ubifs_info *c, int lnum,
static int recover_head(const struct ubifs_info *c, int lnum, int offs,
void *sbuf)
{
int len, err, need_clean = 0;
int len, err;

if (c->min_io_size > 1)
len = c->min_io_size;
Expand All @@ -828,19 +824,7 @@ static int recover_head(const struct ubifs_info *c, int lnum, int offs,

/* Read at the head location and check it is empty flash */
err = ubi_read(c->ubi, lnum, sbuf, offs, len);
if (err)
need_clean = 1;
else {
uint8_t *p = sbuf;

while (len--)
if (*p++ != 0xff) {
need_clean = 1;
break;
}
}

if (need_clean) {
if (err || !is_empty(sbuf, len)) {
dbg_rcvry("cleaning head at %d:%d", lnum, offs);
if (offs == 0)
return ubifs_leb_unmap(c, lnum);
Expand Down

0 comments on commit aa1b006

Please sign in to comment.