-/* $OpenBSD: nfs_nqlease.c,v 1.7 1996/06/01 04:43:58 mickey Exp $ */
+/* $OpenBSD: nfs_nqlease.c,v 1.8 1997/04/18 10:02:36 deraadt Exp $ */
/* $NetBSD: nfs_nqlease.c,v 1.14 1996/02/18 14:06:50 fvdl Exp $ */
/*
struct mbuf *mreq, *mb, *mb2, *nam2, *mheadend;
struct socket *so;
struct sockaddr_in *saddr;
+ nfsfh_t nfh;
fhandle_t *fhp;
caddr_t bpos, cp;
- u_int32_t xid;
+ u_int32_t xid, *tl;
int len = 1, ok = 1, i = 0;
int sotype, *solockp;
else
solockp = (int *)0;
nfsm_reqhead((struct vnode *)0, NQNFSPROC_EVICTED,
- NFSX_V3FH);
- nfsm_build(cp, caddr_t, NFSX_V3FH);
- bzero(cp, NFSX_V3FH);
- fhp = (fhandle_t *)cp;
+ NFSX_V3FH + NFSX_UNSIGNED);
+ fhp = &nfh.fh_generic;
+ bzero((caddr_t)fhp, sizeof(nfh));
fhp->fh_fsid = vp->v_mount->mnt_stat.f_fsid;
VFS_VPTOFH(vp, &fhp->fh_fid);
+ nfsm_srvfhtom(fhp, 1);
m = mreq;
siz = 0;
while (m) {
struct mbuf *mreq, *mrep, *md, *mb, *mb2;
int cachable;
u_quad_t frev;
-
+
nfsstats.rpccnt[NQNFSPROC_GETLEASE]++;
mb = mreq = nfsm_reqh(vp, NQNFSPROC_GETLEASE, NFSX_V3FH+2*NFSX_UNSIGNED,
&bpos);
struct mbuf *mreq, *mb, *mb2, *mheadend;
struct nfsmount *nmp;
struct nfsreq myrep;
-
+
nmp = VFSTONFS(vp->v_mount);
nfsstats.rpccnt[NQNFSPROC_VACATED]++;
- nfsm_reqhead(vp, NQNFSPROC_VACATED, NFSX_V3FH);
+ nfsm_reqhead(vp, NQNFSPROC_VACATED, NFSX_FH(1));
nfsm_fhtom(vp, 1);
m = mreq;
i = 0;
if (vpid == vp->v_id) {
CIRCLEQ_REMOVE(&nmp->nm_timerhead, np, n_timer);
np->n_timer.cqe_next = 0;
- if ((np->n_flag & (NMODIFIED | NQNFSEVICTED))
- && vp->v_type == VREG) {
+ if (np->n_flag & (NMODIFIED | NQNFSEVICTED)) {
if (np->n_flag & NQNFSEVICTED) {
+ if (vp->v_type == VDIR)
+ nfs_invaldir(vp);
+ cache_purge(vp);
(void) nfs_vinvalbuf(vp,
V_SAVE, cred, p, 0);
np->n_flag &= ~NQNFSEVICTED;
(void) nqnfs_vacated(vp, cred);
- } else {
+ } else if (vp->v_type == VREG) {
(void) VOP_FSYNC(vp, cred,
MNT_WAIT, p);
np->n_flag &= ~NMODIFIED;