FreeBSD/sys/fs/nfsclient/nfs_clstate.c
/*
 * Mark any layouts that match as recalled.
 */
Mark any layouts that match as recalled.
Mark any layouts that match as recalled .
static int
nfscl_layoutrecall(int recalltype, struct nfscllayout *lyp, uint32_t iomode,
    uint64_t off, uint64_t len, uint32_t stateseqid,
    struct nfsclrecalllayout *recallp)
{
	struct nfsclrecalllayout *rp, *orp;
	recallp->nfsrecly_recalltype = recalltype;
	recallp->nfsrecly_iomode = iomode;
	recallp->nfsrecly_stateseqid = stateseqid;
	recallp->nfsrecly_off = off;
	recallp->nfsrecly_len = len;
	orp = NULL;
	LIST_FOREACH(rp, &lyp->nfsly_recall, nfsrecly_list) {
		orp = rp;
		if ((recalltype == NFSLAYOUTRETURN_FILE &&
		     (rp->nfsrecly_recalltype != NFSLAYOUTRETURN_FILE ||
		      nfscl_seq(stateseqid, rp->nfsrecly_stateseqid) != 0)) ||
		    (recalltype != NFSLAYOUTRETURN_FILE &&
		     rp->nfsrecly_recalltype != NFSLAYOUTRETURN_FILE &&
		     nfscl_seq(stateseqid, rp->nfsrecly_stateseqid) != 0)) {
			LIST_INSERT_BEFORE(rp, recallp, nfsrecly_list);
			break;
		}
	}
	if (rp == NULL) {
		if (orp == NULL)
			LIST_INSERT_HEAD(&lyp->nfsly_recall, recallp,
			    nfsrecly_list);
		else
			LIST_INSERT_AFTER(orp, recallp, nfsrecly_list);
	}
	lyp->nfsly_flags |= NFSLY_RECALL;
	return (0);
}
static int nfscl_layoutrecall ( int recalltype , struct nfscllayout * lyp , uint32_t iomode , uint64_t off , uint64_t len , uint32_t stateseqid , struct nfsclrecalllayout * recallp ) { struct nfsclrecalllayout * rp , * orp ; recallp -> nfsrecly_recalltype = recalltype ; recallp -> nfsrecly_iomode = iomode ; recallp -> nfsrecly_stateseqid = stateseqid ; recallp -> nfsrecly_off = off ; recallp -> nfsrecly_len = len ; orp = NULL ; LIST_FOREACH ( rp , & lyp -> nfsly_recall , nfsrecly_list ) { orp = rp ; if ( ( recalltype == NFSLAYOUTRETURN_FILE && ( rp -> nfsrecly_recalltype != NFSLAYOUTRETURN_FILE || nfscl_seq ( stateseqid , rp -> nfsrecly_stateseqid ) != 0 ) ) || ( recalltype != NFSLAYOUTRETURN_FILE && rp -> nfsrecly_recalltype != NFSLAYOUTRETURN_FILE && nfscl_seq ( stateseqid , rp -> nfsrecly_stateseqid ) != 0 ) ) { LIST_INSERT_BEFORE ( rp , recallp , nfsrecly_list ) ; break ; } } if ( rp == NULL ) { if ( orp == NULL ) LIST_INSERT_HEAD ( & lyp -> nfsly_recall , recallp , nfsrecly_list ) ; else LIST_INSERT_AFTER ( orp , recallp , nfsrecly_list ) ; } lyp -> nfsly_flags |= NFSLY_RECALL ; return ( 0 ) ; }
Mark any layouts that match as recalled.
Mark any layouts that match as recalled .
/*
	 * Order the list as file returns first, followed by fsid and any
	 * returns, both in increasing stateseqid order.
	 * Note that the seqids wrap around, so 1 is after 0xffffffff.
	 * (I'm not sure this is correct because I find RFC5661 confusing
	 *  on this, but hopefully it will work ok.)
	 */