/****************************************************************** * NAME: scan_for_free_blocks * * FUNCTION: For each block on the sequential list of bad blocks, * Attempt to allocate the block to the JFS Bad Block inode. * * If this succeeds, the block was not already allocated to * and so no relocate was/is necessary. Remove the * block from the sequential list. Notify the LVM * that the bad LV blocks in this file system block * can be removed from its list. * * Otherwise, the block is allocated to some inode. Leave * it on the sequential list for relocation in a later * step. * * PARAMETERS: none * * NOTES: * * RETURNS: * success: 0 * failure: something else */ int32 scan_for_free_blocks() { int32 sffb_rc = 0; int32 atb_rc = 0; cbbl_bdblk_recptr bdblk_recptr, next_bdblk_recptr; bdblk_recptr = agg_recptr->bdblk_baltree.seq_list; while( bdblk_recptr != NULL ) { next_bdblk_recptr = bdblk_recptr->next; atb_rc = alloc_to_BBInode( bdblk_recptr ); if( atb_rc == 0 ) { /* the block is safely locked to the * bad block inode */ sffb_rc = tell_LVM( bdblk_recptr ); if( sffb_rc == 0 ) { sffb_rc = seqlist_remove( bdblk_recptr ); if( sffb_rc == 0 ) { sffb_rc = freelist_insert( bdblk_recptr ); } } } /* end the block is safely locked to the bad block inode */ bdblk_recptr = next_bdblk_recptr; } return( sffb_rc ); } /* end scan_for_free_blocks() */
int ssl3_release_read_buffer(SSL *s) { if (s->s3->rbuf.buf != NULL) { freelist_insert(s->ctx, 1, s->s3->rbuf.len, s->s3->rbuf.buf); s->s3->rbuf.buf = NULL; } return 1; }
int ssl3_release_write_buffer(SSL *s) { if (s->s3->wbuf.buf != NULL) { freelist_insert(s->ctx, 0, s->s3->wbuf.len, s->s3->wbuf.buf); s->s3->wbuf.buf = NULL; } return 1; }