/*static char *SCCSID = "@(#)holdoft.c	6.2 92/01/31";*/
#ifndef	 _BTXT
#define	 _BTXT _BTXT
#define	 _THISFILE "HOLDOFT.C"
#include _THISFILE.C
#undef	 _BTXT
#endif

#ifndef HDRS
#define HDRS

/***	holdoft.c - wait until an OFT is holdable
 */

#include <os2def.h>
#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "storage.h"
#include "volume.h"
#include "tables.h"
#include "pb_ifs.h"
#include "pbmacros.h"
#include "assert.h"
#include "log.h"
#include "frame.h"

#endif

#include "pr_MISC.h"
#include "pr_FSSUB.h"

/*
 ***	HoldOFT - set the hold count on an OFT
 *
 *	HoldOFT is called to hold the OFT,
 *	typically when the caller has ascertained that the OFT is
 *	locked or has a pending lock.  HoldOFT waits until the
 *	OFT may be held but doesn't increment the OFT_HCNT field
 *
 *	ENTRY	poft (EDI) = OFT address
 *
 *	EXIT	none
 *	USES	eax, flags
 *
 *	HISTORY
 *	    19-Sep-89 by JR (John Rogers, JohnRo@Microsoft)
 *		- Avoid warnings from Microsoft C 5.2 (on slash-slash comments).
 */

void
HoldOFT (POFT poft, PFRAME pfrm)
{
    while ((poft->bFlag & (OTF_LCK | OTF_PLK)) != 0) {
	poft->cWaits++;
	BlockOnOFT( poft,pfrm );
	poft->cWaits--;
    }

    ASSERT_OFT (poft);
}
