mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 11:56:10 +08:00
drivers/bch: flush the dirty sector to keep the sector sequence
flush the dirty sector to keep the sector sequence before ftl write Change-Id: I1096cce39965806d5c877c2929b5a2ecdab27ac9 Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -141,6 +141,15 @@ ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset,
|
|||||||
nsectors = bch->nsectors - sector;
|
nsectors = bch->nsectors - sector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Flush the dirty sector to keep the sector sequence */
|
||||||
|
|
||||||
|
ret = bchlib_flushsector(bch);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
ferr("ERROR: Flush failed: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* Write the contiguous sectors */
|
/* Write the contiguous sectors */
|
||||||
|
|
||||||
ret = bch->inode->u.i_bops->write(bch->inode, (FAR uint8_t *)buffer,
|
ret = bch->inode->u.i_bops->write(bch->inode, (FAR uint8_t *)buffer,
|
||||||
|
|||||||
Reference in New Issue
Block a user