1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Add a function to sys/nlm/nlm_prot_impl.c that returns a unique

lock sysid to be used for non-nlm remote locking. This is required
for the experimental nfsv4 server, so that it can acquire byte
range locks correctly on behalf of nfsv4 clients.

Reviewed by:	dfr
Approved by:	kib (mentor)
This commit is contained in:
Rick Macklem 2009-05-21 01:14:12 +00:00
parent 8d2dd5dd85
commit 596c08801d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192501
2 changed files with 19 additions and 0 deletions

View File

@ -210,6 +210,11 @@ struct vop_reclaim_args;
extern int nlm_advlock(struct vop_advlock_args *ap);
extern int nlm_reclaim(struct vop_reclaim_args *ap);
/*
* Acquire the next sysid for remote locks not handled by the NLM.
*/
extern uint32_t nlm_acquire_next_sysid(void);
#endif
#endif

View File

@ -834,6 +834,20 @@ nlm_create_host(const char* caller_name)
return (host);
}
/*
* Acquire the next sysid for remote locks not handled by the NLM.
*/
uint32_t
nlm_acquire_next_sysid(void)
{
uint32_t next_sysid;
mtx_lock(&nlm_global_lock);
next_sysid = nlm_next_sysid++;
mtx_unlock(&nlm_global_lock);
return (next_sysid);
}
/*
* Return non-zero if the address parts of the two sockaddrs are the
* same.