Changeset View
Changeset View
Standalone View
Standalone View
sys/nlm/nlm_advlock.c
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
struct thread *td = curthread; | struct thread *td = curthread; | ||||
struct nfsmount *nmp; | struct nfsmount *nmp; | ||||
off_t size; | off_t size; | ||||
size_t fhlen; | size_t fhlen; | ||||
union nfsfh fh; | union nfsfh fh; | ||||
struct sockaddr *sa; | struct sockaddr *sa; | ||||
struct sockaddr_storage ss; | struct sockaddr_storage ss; | ||||
char servername[MNAMELEN]; | char *servername; | ||||
struct timeval timo; | struct timeval timo; | ||||
int retries; | int retries; | ||||
rpcvers_t vers; | rpcvers_t vers; | ||||
struct nlm_host *host; | struct nlm_host *host; | ||||
struct rpc_callextra ext; | struct rpc_callextra ext; | ||||
struct nlm_feedback_arg nf; | struct nlm_feedback_arg nf; | ||||
AUTH *auth; | AUTH *auth; | ||||
struct ucred *cred, *cred1; | struct ucred *cred, *cred1; | ||||
struct nlm_file_svid *ns; | struct nlm_file_svid *ns; | ||||
int svid; | int svid; | ||||
int error; | int error; | ||||
int is_v3; | int is_v3; | ||||
ASSERT_VOP_LOCKED(vp, "nlm_advlock_1"); | ASSERT_VOP_LOCKED(vp, "nlm_advlock_1"); | ||||
servername = malloc(MNAMELEN, M_TEMP, M_WAITOK); /* XXXKIB vp locked */ | |||||
ngie: Why XXXKIB? | |||||
emasteUnsubmitted Not Done Inline ActionsIn the style of XXXRW etc. emaste: In the style of `XXXRW` etc. | |||||
nmp = VFSTONFS(vp->v_mount); | nmp = VFSTONFS(vp->v_mount); | ||||
/* | /* | ||||
* Push any pending writes to the server and flush our cache | * Push any pending writes to the server and flush our cache | ||||
* so that if we are contending with another machine for a | * so that if we are contending with another machine for a | ||||
* file, we get whatever they wrote and vice-versa. | * file, we get whatever they wrote and vice-versa. | ||||
*/ | */ | ||||
if (op == F_SETLK || op == F_UNLCK) | if (op == F_SETLK || op == F_UNLCK) | ||||
nmp->nm_vinvalbuf(vp, V_SAVE, td, 1); | nmp->nm_vinvalbuf(vp, V_SAVE, td, 1); | ||||
▲ Show 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | if (ns) | ||||
nlm_free_svid(ns); | nlm_free_svid(ns); | ||||
cred1 = td->td_ucred; | cred1 = td->td_ucred; | ||||
td->td_ucred = cred; | td->td_ucred = cred; | ||||
crfree(cred1); | crfree(cred1); | ||||
AUTH_DESTROY(auth); | AUTH_DESTROY(auth); | ||||
nlm_host_release(host); | nlm_host_release(host); | ||||
free(servername, M_TEMP); | |||||
return (error); | return (error); | ||||
} | } | ||||
int | int | ||||
nlm_advlock(struct vop_advlock_args *ap) | nlm_advlock(struct vop_advlock_args *ap) | ||||
{ | { | ||||
return (nlm_advlock_internal(ap->a_vp, ap->a_id, ap->a_op, ap->a_fl, | return (nlm_advlock_internal(ap->a_vp, ap->a_id, ap->a_op, ap->a_fl, | ||||
▲ Show 20 Lines • Show All 881 Lines • Show Last 20 Lines |
Why XXXKIB?