Changeset View
Changeset View
Standalone View
Standalone View
head/sys/fs/nfsclient/nfs_clstate.c
Show First 20 Lines • Show All 1,783 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
nfscl_cleanupkext(struct nfsclclient *clp, struct nfscllockownerfhhead *lhp) | nfscl_cleanupkext(struct nfsclclient *clp, struct nfscllockownerfhhead *lhp) | ||||
{ | { | ||||
struct nfsclowner *owp, *nowp; | struct nfsclowner *owp, *nowp; | ||||
struct nfsclopen *op; | struct nfsclopen *op; | ||||
struct nfscllockowner *lp, *nlp; | struct nfscllockowner *lp, *nlp; | ||||
struct nfscldeleg *dp; | struct nfscldeleg *dp; | ||||
NFSPROCLISTLOCK(); | /* | ||||
* All the pidhash locks must be acquired, since they are sx locks | |||||
* and must be acquired before the mutexes. The pid(s) that will | |||||
* be used aren't known yet, so all the locks need to be acquired. | |||||
* Fortunately, this function is only performed once/sec. | |||||
*/ | |||||
pidhash_slockall(); | |||||
NFSLOCKCLSTATE(); | NFSLOCKCLSTATE(); | ||||
LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { | LIST_FOREACH_SAFE(owp, &clp->nfsc_owner, nfsow_list, nowp) { | ||||
LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { | LIST_FOREACH(op, &owp->nfsow_open, nfso_list) { | ||||
LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) { | LIST_FOREACH_SAFE(lp, &op->nfso_lock, nfsl_list, nlp) { | ||||
if (LIST_EMPTY(&lp->nfsl_lock)) | if (LIST_EMPTY(&lp->nfsl_lock)) | ||||
nfscl_emptylockowner(lp, lhp); | nfscl_emptylockowner(lp, lhp); | ||||
} | } | ||||
} | } | ||||
Show All 10 Lines | nfscl_cleanupkext(struct nfsclclient *clp, struct nfscllockownerfhhead *lhp) | ||||
*/ | */ | ||||
TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) { | TAILQ_FOREACH(dp, &clp->nfsc_deleg, nfsdl_list) { | ||||
LIST_FOREACH_SAFE(lp, &dp->nfsdl_lock, nfsl_list, nlp) { | LIST_FOREACH_SAFE(lp, &dp->nfsdl_lock, nfsl_list, nlp) { | ||||
if (nfscl_procdoesntexist(lp->nfsl_owner)) | if (nfscl_procdoesntexist(lp->nfsl_owner)) | ||||
nfscl_cleanup_common(clp, lp->nfsl_owner); | nfscl_cleanup_common(clp, lp->nfsl_owner); | ||||
} | } | ||||
} | } | ||||
NFSUNLOCKCLSTATE(); | NFSUNLOCKCLSTATE(); | ||||
NFSPROCLISTUNLOCK(); | pidhash_sunlockall(); | ||||
} | } | ||||
/* | /* | ||||
* Take the empty lock owner and move it to the local lhp list if the | * Take the empty lock owner and move it to the local lhp list if the | ||||
* associated process no longer exists. | * associated process no longer exists. | ||||
*/ | */ | ||||
static void | static void | ||||
nfscl_emptylockowner(struct nfscllockowner *lp, | nfscl_emptylockowner(struct nfscllockowner *lp, | ||||
▲ Show 20 Lines • Show All 3,634 Lines • Show Last 20 Lines |