Added pbuf_ref_chain() which increases ref count of all pbufs in a chain.

This commit is contained in:
likewise 2002-11-11 11:22:49 +00:00
parent 6c977ad6ed
commit ad55cb6733
2 changed files with 17 additions and 3 deletions

View File

@ -555,6 +555,20 @@ pbuf_ref(struct pbuf *p)
} }
++(p->ref); ++(p->ref);
} }
/*------------------------------------------------------------------------------
/* pbuf_ref_chain():
*
* Increments the reference count of all pbufs in a chain.
*/
void
pbuf_ref_chain(struct pbuf *p)
{
while (p != NULL) {
p->ref++;
p=p->next;
}
}
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* pbuf_chain(): /* pbuf_chain():
* *

View File

@ -100,7 +100,7 @@ void pbuf_init(void);
prepended by allocating another pbuf and chain in to prepended by allocating another pbuf and chain in to
the front of the ROM pbuf. the front of the ROM pbuf.
* PBUF_ROOL: the pbuf is allocated as a pbuf chain, with pbufs from * PBUF_POOL: the pbuf is allocated as a pbuf chain, with pbufs from
the pbuf pool that is allocated during pbuf_init(). */ the pbuf pool that is allocated during pbuf_init(). */
struct pbuf *pbuf_alloc(pbuf_layer l, u16_t size, pbuf_flag flag); struct pbuf *pbuf_alloc(pbuf_layer l, u16_t size, pbuf_flag flag);
@ -123,7 +123,7 @@ u8_t pbuf_header(struct pbuf *p, s16_t header_size);
Increments the reference count of the pbuf p. Increments the reference count of the pbuf p.
*/ */
void pbuf_ref(struct pbuf *p); void pbuf_ref(struct pbuf *p);
void pbuf_ref_chain(struct pbuf *p);
/* pbuf_free(): /* pbuf_free():
Decrements the reference count and deallocates the pbuf if the Decrements the reference count and deallocates the pbuf if the