Simplify object error logic

Write error always sets error on all written pages and we always write
the first page.  So only check the first page.
This commit is contained in:
Tom Marshall 2019-11-04 11:27:27 -08:00
parent cbf8777042
commit 94551dffdd
2 changed files with 2 additions and 20 deletions

View File

@ -300,16 +300,7 @@ lbd_dtr(struct lbd* lbd)
static bool
lbd_error(struct lbd* lbd)
{
u32 count = lblk_per_pblk(lbd->params);
u32 n;
for (n = 0; n < count; ++n) {
if (PageError(lbd->pagev[n])) {
return true;
}
}
return false;
return PageError(lbd->pagev[0]);
}
static int

View File

@ -86,16 +86,7 @@ pbat_dtr(struct pbat* pbat)
static bool
pbat_error(struct pbat* pbat)
{
u32 nr_pages = pbat_len(pbat->params);
u32 n;
for (n = 0; n < nr_pages; ++n) {
if (PageError(pbat->pagev[n])) {
return true;
}
}
return false;
return PageError(pbat->pagev[0]);
}
static int