sdi_freeblk(D3I) sdi_freeblk(D3I)
NAME
sdi_freeblk - release a previously allocated sb
SYNOPSIS
#include <sys/sdi.h>
long sdi_freeblk(struct sb *pt);
Arguments
pt Pointer to the sb (command block) structure.
DESCRIPTION
sdi_freeblk returns an sb (command block) to the free block
pool. The sb_type member of the sb structure is checked to
ensure that a valid sb is returned.
Return Values
The normal return is SDI_RET_OK. A return value of
SDI_RET_ERR indicates an error with the pointer.
USAGE
sdi_freeblk is typically used after a job completes.
Level
Base or Interrupt.
Examples
In this example, diskfreejob cleans up after a disk job
completes and is called with a pointer to a structure, job.
The job structure contains information about the disk job,
including a pointer to the sb for the job. sdi_freeblk is
called with the pointer to the job structure as part of the
clean-up operation.
struct job {
struct sb *j_sbptr;
...
}
diskfreejob(jp)
struct job *jp;
{
/* Perform job clean up */
...
/* Return SB to SDI */
if( sdi_freeblk(jp->j_sbptr) != SDI_RET_OK)
Copyright 1994 Novell, Inc. Page 1
sdi_freeblk(D3I) sdi_freeblk(D3I)
{
/* SB rejected - print error message */
cmn_err(CE_WARN, "DISK: SB rejected by SDI.");
}
...
}
REFERENCES
sb(D4I), sdi_getblk(D3I)
NOTICES
Applicability
sdi: 1, 2
Copyright 1994 Novell, Inc. Page 2