DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

sdi_free(D3sdi)


sdi_free -- return a previously allocated piece of memory back to the pool

Synopsis

   #include <sys/sdi.h>

void sdi_free(struct head *headp, struct jpool *jp);

Description

sdi_free returns the allocated area of memory back to the pool it was taken from. After the completion of the use of the memory, the target or HBA driver should return the memory to the pool, because the pool is shared between all target and HBA drivers. Because each target driver and HBA driver needs large numbers of either job structures or SCSI command blocks, sdi_get(D3sdi) and sdi_free facilitate sharing of kernel memory. The routines allocate from and return memory to the kernel, based on demand.

Arguments


headp
pointer to the head structure of the pool from which the memory piece was allocated

jp
pointer to the memory piece to be returned to the pool

Return values

The normal return is SDI_RET_OK. A return value of SDI_RET_ERR indicates an error with the pointer.

Usage

sdi_free is typically used in a local freeblk/freejob routine. Rather than having a local pool of job or command structures, SDI drivers should use one of the two existing shared pools. If the size of structures in these pools is too small, a new pool can be created and used by a SDI driver.

In SVR4.2 MP, the sdi_get and sdi_free routines do nothing more than call kmem_zalloc(D3) and kmem_free(D3). The headp parameter is maintained simply to keep a record of the allocation size.

Context and synchronization

Non-blockable context.

Applicable hardware

x86/Pentium compatible architectures

Version applicability

sdi: 1, 2, 3, 4 HBA and target drivers.

References

kmem_free(D3), kmem_zalloc(D3), sdi_get(D3sdi)
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005