if (pgcookie == NULL || pgcookie->size == 0) {
if (finfop->pgcookie == NULL || finfop->pgcookie->size == 0) {
__memp_mf_open(dbmp, path,    ftype, pagesize, last_pgno, lsn_offset, pgcookie, fileid, retp)	DB_MPOOL *dbmp;	const char *path;	int ftype, lsn_offset;	size_t pagesize;	db_pgno_t last_pgno;	DBT *pgcookie;	u_int8_t *fileid;	MPOOLFILE **retp;{	MPOOLFILE *mfp;	int ret;	void *p;#define	ISTEMPORARY	(path == NULL)	/*	 * Walk the list of MPOOLFILE's, looking for a matching file.	 * Temporary files can't match previous files.	 */	if (!ISTEMPORARY)		for (mfp = SH_TAILQ_FIRST(&dbmp->mp->mpfq, __mpoolfile);		    mfp != NULL; mfp = SH_TAILQ_NEXT(mfp, q, __mpoolfile)) {			if (F_ISSET(mfp, MP_TEMP))				continue;			if (!memcmp(fileid,			    R_ADDR(dbmp, mfp->fileid_off), DB_FILE_ID_LEN)) {				if (ftype != mfp->ftype ||				    pagesize != mfp->stat.st_pagesize) {					__db_err(dbmp->dbenv,					    "%s: ftype or pagesize changed",					    path);					return (EINVAL);				}				/* Found it: increment the reference count. */				++mfp->ref;				*retp = mfp;				return (0);			}		}	/* Allocate a new MPOOLFILE. */	if ((ret = __memp_ralloc(dbmp, sizeof(MPOOLFILE), NULL, &mfp)) != 0)		return (ret);	*retp = mfp;	/* Initialize the structure. */	memset(mfp, 0, sizeof(MPOOLFILE));	mfp->ref = 1;	mfp->ftype = ftype;	mfp->lsn_off = lsn_offset;	/*	 * If the user specifies DB_MPOOL_LAST or DB_MPOOL_NEW on a memp_fget,	 * we have to know the last page in the file.  Figure it out and save	 * it away.	 */	mfp->stat.st_pagesize = pagesize;	mfp->last_pgno = last_pgno;	F_SET(mfp, MP_CAN_MMAP);	if (ISTEMPORARY)		F_SET(mfp, MP_TEMP);	else {		/* Copy the file path into shared memory. */		if ((ret = __memp_ralloc(dbmp,		    strlen(path) + 1, &mfp->path_off, &p)) != 0)			goto err;		memcpy(p, path, strlen(path) + 1);		/* Copy the file identification string into shared memory. */		if ((ret = __memp_ralloc(dbmp,		    DB_FILE_ID_LEN, &mfp->fileid_off, &p)) != 0)			goto err;		memcpy(p, fileid, DB_FILE_ID_LEN);	}	/* Copy the page cookie into shared memory. */	if (pgcookie == NULL || pgcookie->size == 0) {		mfp->pgcookie_len = 0;		mfp->pgcookie_off = 0;	} else {		if ((ret = __memp_ralloc(dbmp,		    pgcookie->size, &mfp->pgcookie_off, &p)) != 0)			goto err;		memcpy(p, pgcookie->data, pgcookie->size);		mfp->pgcookie_len = pgcookie->size;	}	/* Prepend the MPOOLFILE to the list of MPOOLFILE's. */	SH_TAILQ_INSERT_HEAD(&dbmp->mp->mpfq, mfp, q, __mpoolfile);	if (0) {err:		if (mfp->path_off != 0)			__db_shalloc_free(dbmp->addr,			    R_ADDR(dbmp, mfp->path_off));		if (mfp->fileid_off != 0)			__db_shalloc_free(dbmp->addr,			    R_ADDR(dbmp, mfp->fileid_off));		if (mfp != NULL)			__db_shalloc_free(dbmp->addr, mfp);		mfp = NULL;	}	return (0);}