kernel/qio: implement concatblock() with pullupblock()
This commit is contained in:
parent
d97eb114d5
commit
d2ad8df947
1 changed files with 4 additions and 14 deletions
|
@ -146,23 +146,13 @@ blockalloclen(Block *bp)
|
|||
Block*
|
||||
concatblock(Block *bp)
|
||||
{
|
||||
Block *nb, *next;
|
||||
int len;
|
||||
|
||||
if(bp->next == nil)
|
||||
return bp;
|
||||
|
||||
nb = allocb(blocklen(bp));
|
||||
for(; bp != nil; bp = next) {
|
||||
next = bp->next;
|
||||
len = BLEN(bp);
|
||||
memmove(nb->wp, bp->rp, len);
|
||||
nb->wp += len;
|
||||
freeb(bp);
|
||||
}
|
||||
concatblockcnt += BLEN(nb);
|
||||
QDEBUG checkb(nb, "concatblock 1");
|
||||
return nb;
|
||||
len = blocklen(bp);
|
||||
concatblockcnt += len;
|
||||
return pullupblock(bp, len);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue