Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d58b27ed authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse
Browse files

logfs: do not use 'mtd->block_isbad' directly



Instead, use the new 'mtd_can_have_bb()' helper.

Cc: Jörn Engel <joern@logfs.org>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 8f461a73
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -152,7 +152,7 @@ static struct page *logfs_mtd_find_first_sb(struct super_block *sb, u64 *ofs)
	filler_t *filler = logfs_mtd_readpage;
	filler_t *filler = logfs_mtd_readpage;
	struct mtd_info *mtd = super->s_mtd;
	struct mtd_info *mtd = super->s_mtd;


	if (!mtd->block_isbad)
	if (!mtd_can_have_bb(mtd))
		return NULL;
		return NULL;


	*ofs = 0;
	*ofs = 0;
@@ -172,7 +172,7 @@ static struct page *logfs_mtd_find_last_sb(struct super_block *sb, u64 *ofs)
	filler_t *filler = logfs_mtd_readpage;
	filler_t *filler = logfs_mtd_readpage;
	struct mtd_info *mtd = super->s_mtd;
	struct mtd_info *mtd = super->s_mtd;


	if (!mtd->block_isbad)
	if (!mtd_can_have_bb(mtd))
		return NULL;
		return NULL;


	*ofs = mtd->size - mtd->erasesize;
	*ofs = mtd->size - mtd->erasesize;