Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsserver/nfs_nfsdstate.c
Context not available. | |||||
struct nfsv4lock nfsv4rootfs_lock; | struct nfsv4lock nfsv4rootfs_lock; | ||||
extern int newnfs_numnfsd; | extern int newnfs_numnfsd; | ||||
extern struct nfsstats newnfsstats; | extern struct nfsstatsv1 nfsstatsv1; | ||||
extern int nfsrv_lease; | extern int nfsrv_lease; | ||||
extern struct timeval nfsboottime; | extern struct timeval nfsboottime; | ||||
extern u_int32_t newnfs_true, newnfs_false; | extern u_int32_t newnfs_true, newnfs_false; | ||||
Context not available. | |||||
LIST_INIT(&new_clp->lc_stateid[i]); | LIST_INIT(&new_clp->lc_stateid[i]); | ||||
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | ||||
lc_hash); | lc_hash); | ||||
newnfsstats.srvclients++; | nfsstatsv1.srvclients++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_clients++; | nfsrv_clients++; | ||||
NFSLOCKV4ROOTMUTEX(); | NFSLOCKV4ROOTMUTEX(); | ||||
Context not available. | |||||
} | } | ||||
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | ||||
lc_hash); | lc_hash); | ||||
newnfsstats.srvclients++; | nfsstatsv1.srvclients++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_clients++; | nfsrv_clients++; | ||||
NFSLOCKV4ROOTMUTEX(); | NFSLOCKV4ROOTMUTEX(); | ||||
Context not available. | |||||
} | } | ||||
LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, | ||||
lc_hash); | lc_hash); | ||||
newnfsstats.srvclients++; | nfsstatsv1.srvclients++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_clients++; | nfsrv_clients++; | ||||
} | } | ||||
Context not available. | |||||
/* | /* | ||||
* Dump out stats for all clients. Called from nfssvc(2), that is used | * Dump out stats for all clients. Called from nfssvc(2), that is used | ||||
* newnfsstats. | * nfsstatsv1. | ||||
*/ | */ | ||||
APPLESTATIC void | APPLESTATIC void | ||||
nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt) | nfsrv_dumpclients(struct nfsd_dumpclients *dumpp, int maxcnt) | ||||
Context not available. | |||||
free(clp->lc_stateid, M_NFSDCLIENT); | free(clp->lc_stateid, M_NFSDCLIENT); | ||||
free(clp, M_NFSDCLIENT); | free(clp, M_NFSDCLIENT); | ||||
NFSLOCKSTATE(); | NFSLOCKSTATE(); | ||||
newnfsstats.srvclients--; | nfsstatsv1.srvclients--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
nfsrv_clients--; | nfsrv_clients--; | ||||
NFSUNLOCKSTATE(); | NFSUNLOCKSTATE(); | ||||
Context not available. | |||||
nfsv4_testlock(&lfp->lf_locallock_lck) == 0) | nfsv4_testlock(&lfp->lf_locallock_lck) == 0) | ||||
nfsrv_freenfslockfile(lfp); | nfsrv_freenfslockfile(lfp); | ||||
FREE((caddr_t)stp, M_NFSDSTATE); | FREE((caddr_t)stp, M_NFSDSTATE); | ||||
newnfsstats.srvdelegates--; | nfsstatsv1.srvdelegates--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
nfsrv_delegatecnt--; | nfsrv_delegatecnt--; | ||||
} | } | ||||
Context not available. | |||||
if (stp->ls_op) | if (stp->ls_op) | ||||
nfsrvd_derefcache(stp->ls_op); | nfsrvd_derefcache(stp->ls_op); | ||||
FREE((caddr_t)stp, M_NFSDSTATE); | FREE((caddr_t)stp, M_NFSDSTATE); | ||||
newnfsstats.srvopenowners--; | nfsstatsv1.srvopenowners--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
} | } | ||||
Context not available. | |||||
if (cansleep != 0) | if (cansleep != 0) | ||||
NFSUNLOCKSTATE(); | NFSUNLOCKSTATE(); | ||||
FREE((caddr_t)stp, M_NFSDSTATE); | FREE((caddr_t)stp, M_NFSDSTATE); | ||||
newnfsstats.srvopens--; | nfsstatsv1.srvopens--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
return (ret); | return (ret); | ||||
} | } | ||||
Context not available. | |||||
if (stp->ls_op) | if (stp->ls_op) | ||||
nfsrvd_derefcache(stp->ls_op); | nfsrvd_derefcache(stp->ls_op); | ||||
FREE((caddr_t)stp, M_NFSDSTATE); | FREE((caddr_t)stp, M_NFSDSTATE); | ||||
newnfsstats.srvlockowners--; | nfsstatsv1.srvlockowners--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
} | } | ||||
Context not available. | |||||
if (lop->lo_lckfile.le_prev != NULL) { | if (lop->lo_lckfile.le_prev != NULL) { | ||||
LIST_REMOVE(lop, lo_lckfile); | LIST_REMOVE(lop, lo_lckfile); | ||||
newnfsstats.srvlocks--; | nfsstatsv1.srvlocks--; | ||||
nfsrv_openpluslock--; | nfsrv_openpluslock--; | ||||
} | } | ||||
LIST_REMOVE(lop, lo_lckowner); | LIST_REMOVE(lop, lo_lckowner); | ||||
Context not available. | |||||
LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list); | LIST_INSERT_HEAD(&stp->ls_open, new_stp, ls_list); | ||||
*new_lopp = NULL; | *new_lopp = NULL; | ||||
*new_stpp = NULL; | *new_stpp = NULL; | ||||
newnfsstats.srvlockowners++; | nfsstatsv1.srvlockowners++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} | } | ||||
if (filestruct_locked != 0) { | if (filestruct_locked != 0) { | ||||
Context not available. | |||||
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); | LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); | ||||
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); | LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); | ||||
*new_stpp = NULL; | *new_stpp = NULL; | ||||
newnfsstats.srvopenowners++; | nfsstatsv1.srvopenowners++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} | } | ||||
openstp = new_open; | openstp = new_open; | ||||
new_open = NULL; | new_open = NULL; | ||||
newnfsstats.srvopens++; | nfsstatsv1.srvopens++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
break; | break; | ||||
} | } | ||||
Context not available. | |||||
NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt) || | NFSRV_V4DELEGLIMIT(nfsrv_delegatecnt) || | ||||
!NFSVNO_DELEGOK(vp)) | !NFSVNO_DELEGOK(vp)) | ||||
*rflagsp |= NFSV4OPEN_RECALL; | *rflagsp |= NFSV4OPEN_RECALL; | ||||
newnfsstats.srvdelegates++; | nfsstatsv1.srvdelegates++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_delegatecnt++; | nfsrv_delegatecnt++; | ||||
Context not available. | |||||
LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); | LIST_INSERT_HEAD(&new_stp->ls_open, new_open, ls_list); | ||||
LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); | LIST_INSERT_HEAD(&clp->lc_open, new_stp, ls_list); | ||||
*new_stpp = NULL; | *new_stpp = NULL; | ||||
newnfsstats.srvopenowners++; | nfsstatsv1.srvopenowners++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} | } | ||||
openstp = new_open; | openstp = new_open; | ||||
new_open = NULL; | new_open = NULL; | ||||
newnfsstats.srvopens++; | nfsstatsv1.srvopens++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} else { | } else { | ||||
error = NFSERR_RECLAIMCONFLICT; | error = NFSERR_RECLAIMCONFLICT; | ||||
Context not available. | |||||
new_deleg->ls_stateid), new_deleg, ls_hash); | new_deleg->ls_stateid), new_deleg, ls_hash); | ||||
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); | LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); | ||||
new_deleg = NULL; | new_deleg = NULL; | ||||
newnfsstats.srvdelegates++; | nfsstatsv1.srvdelegates++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_delegatecnt++; | nfsrv_delegatecnt++; | ||||
} | } | ||||
Context not available. | |||||
new_open, ls_hash); | new_open, ls_hash); | ||||
openstp = new_open; | openstp = new_open; | ||||
new_open = NULL; | new_open = NULL; | ||||
newnfsstats.srvopens++; | nfsstatsv1.srvopens++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
/* | /* | ||||
Context not available. | |||||
new_deleg->ls_stateid), new_deleg, ls_hash); | new_deleg->ls_stateid), new_deleg, ls_hash); | ||||
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); | LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, ls_list); | ||||
new_deleg = NULL; | new_deleg = NULL; | ||||
newnfsstats.srvdelegates++; | nfsstatsv1.srvdelegates++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_delegatecnt++; | nfsrv_delegatecnt++; | ||||
} | } | ||||
Context not available. | |||||
LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, | LIST_INSERT_HEAD(&clp->lc_deleg, new_deleg, | ||||
ls_list); | ls_list); | ||||
new_deleg = NULL; | new_deleg = NULL; | ||||
newnfsstats.srvdelegates++; | nfsstatsv1.srvdelegates++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
nfsrv_delegatecnt++; | nfsrv_delegatecnt++; | ||||
} | } | ||||
Context not available. | |||||
openstp = new_open; | openstp = new_open; | ||||
new_open = NULL; | new_open = NULL; | ||||
*new_stpp = NULL; | *new_stpp = NULL; | ||||
newnfsstats.srvopens++; | nfsstatsv1.srvopens++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
newnfsstats.srvopenowners++; | nfsstatsv1.srvopenowners++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} | } | ||||
if (!error) { | if (!error) { | ||||
Context not available. | |||||
else | else | ||||
LIST_INSERT_AFTER(insert_lop, new_lop, lo_lckowner); | LIST_INSERT_AFTER(insert_lop, new_lop, lo_lckowner); | ||||
if (stp != NULL) { | if (stp != NULL) { | ||||
newnfsstats.srvlocks++; | nfsstatsv1.srvlocks++; | ||||
nfsrv_openpluslock++; | nfsrv_openpluslock++; | ||||
} | } | ||||
} | } | ||||
Context not available. | |||||
* just set lc_program to 0 to indicate no callbacks are possible. | * just set lc_program to 0 to indicate no callbacks are possible. | ||||
* (For cases where the address can't be parsed or is 0.0.0.0.0.0, set | * (For cases where the address can't be parsed or is 0.0.0.0.0.0, set | ||||
* the address to the client's transport address. This won't be used | * the address to the client's transport address. This won't be used | ||||
* for callbacks, but can be printed out by newnfsstats for info.) | * for callbacks, but can be printed out by nfsstats for info.) | ||||
* Return error if the xdr can't be parsed, 0 otherwise. | * Return error if the xdr can't be parsed, 0 otherwise. | ||||
*/ | */ | ||||
APPLESTATIC int | APPLESTATIC int | ||||
Context not available. |