rwbuffer: Fix the wrong remaining block calculation in invalidation
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I00e6e7332f397bcddfd44e1b3c5c514a8f07923f
This commit is contained in:
parent
4f22f746f8
commit
e7034c102f
@ -492,7 +492,7 @@ int rwb_invalidate_writebuffer(FAR struct rwbuffer_s *rwb,
|
||||
|
||||
else if (wrbend > startblock && wrbend <= invend)
|
||||
{
|
||||
rwb->wrnblocks = wrbend - startblock;
|
||||
rwb->wrnblocks -= wrbend - startblock;
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
@ -612,11 +612,11 @@ int rwb_invalidate_readahead(FAR struct rwbuffer_s *rwb,
|
||||
|
||||
else if (rhbend > startblock && rhbend <= invend)
|
||||
{
|
||||
rwb->rhnblocks = rhbend - startblock;
|
||||
rwb->rhnblocks -= rhbend - startblock;
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
/* 4. We invalidate a portion at the beginning of the write buffer */
|
||||
/* 4. We invalidate a portion at the begin of the read-ahead buffer */
|
||||
|
||||
else /* if (rwb->rhblockstart >= startblock && rhbend > invend) */
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user