Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/rpc.lockd/lockd_lock.c
Show First 20 Lines • Show All 209 Lines • ▼ Show 20 Lines | |||||
void clear_partialfilelock(const char *hostname); | void clear_partialfilelock(const char *hostname); | ||||
enum partialfilelock_status test_partialfilelock( | enum partialfilelock_status test_partialfilelock( | ||||
const struct file_lock *fl, struct file_lock **conflicting_fl); | const struct file_lock *fl, struct file_lock **conflicting_fl); | ||||
enum nlm_stats do_test(struct file_lock *fl, | enum nlm_stats do_test(struct file_lock *fl, | ||||
struct file_lock **conflicting_fl); | struct file_lock **conflicting_fl); | ||||
enum nlm_stats do_unlock(struct file_lock *fl); | enum nlm_stats do_unlock(struct file_lock *fl); | ||||
enum nlm_stats do_lock(struct file_lock *fl); | enum nlm_stats do_lock(struct file_lock *fl); | ||||
void do_clear(const char *hostname); | void do_clear(const char *hostname); | ||||
size_t strnlen(const char *, size_t); | |||||
void | void | ||||
debuglog(char const *fmt, ...) | debuglog(char const *fmt, ...) | ||||
{ | { | ||||
va_list ap; | va_list ap; | ||||
if (debug_level < 1) { | if (debug_level < 1) { | ||||
return; | return; | ||||
▲ Show 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
dest->exclusive = exclusive; | dest->exclusive = exclusive; | ||||
dest->oh.n_len = src->oh.n_len; | dest->oh.n_len = src->oh.n_len; | ||||
dest->oh.n_bytes = src->oh.n_bytes; | dest->oh.n_bytes = src->oh.n_bytes; | ||||
dest->svid = src->svid; | dest->svid = src->svid; | ||||
dest->l_offset = src->l_offset; | dest->l_offset = src->l_offset; | ||||
dest->l_len = src->l_len; | dest->l_len = src->l_len; | ||||
} | |||||
size_t | |||||
strnlen(const char *s, size_t len) | |||||
{ | |||||
size_t n; | |||||
for (n = 0; s[n] != 0 && n < len; n++) | |||||
; | |||||
return n; | |||||
} | } | ||||
/* | /* | ||||
* allocate_file_lock: Create a lock with the given parameters | * allocate_file_lock: Create a lock with the given parameters | ||||
*/ | */ | ||||
struct file_lock * | struct file_lock * | ||||
allocate_file_lock(const netobj *lockowner, const netobj *matchcookie, | allocate_file_lock(const netobj *lockowner, const netobj *matchcookie, | ||||
▲ Show 20 Lines • Show All 1,912 Lines • Show Last 20 Lines |