lockf
int lockf(int, int, off_t);
struct lockf *i_lockf; /* head of byte-level lock list */
struct lockf *n_lockf; /* Locking record of file */
lf_add_incoming(struct lockf *state, struct lockf_entry *lock)
lf_insert_lock(struct lockf *state, struct lockf_entry *lock)
static int lf_clearlock(struct lockf *, struct lockf_entry *);
lf_wakeup_lock(struct lockf *state, struct lockf_entry *wakelock)
lf_update_dependancies(struct lockf *state, struct lockf_entry *lock, int all,
lf_set_start(struct lockf *state, struct lockf_entry *lock, off_t new_start,
lf_set_end(struct lockf *state, struct lockf_entry *lock, off_t new_end,
static int lf_add_outgoing(struct lockf *, struct lockf_entry *);
lf_activate_lock(struct lockf *state, struct lockf_entry *lock)
static int lf_add_incoming(struct lockf *, struct lockf_entry *);
lf_getblock(struct lockf *, struct lockf_entry *);
static int lf_getlock(struct lockf *, struct lockf_entry *, struct flock *);
static void lf_insert_lock(struct lockf *, struct lockf_entry *);
static void lf_wakeup_lock(struct lockf *, struct lockf_entry *);
static void lf_update_dependancies(struct lockf *, struct lockf_entry *,
static void lf_set_start(struct lockf *, struct lockf_entry *, off_t,
lf_cancel_lock(struct lockf *state, struct lockf_entry *lock)
static void lf_set_end(struct lockf *, struct lockf_entry *, off_t,
static int lf_setlock(struct lockf *, struct lockf_entry *,
lf_setlock(struct lockf *state, struct lockf_entry *lock, struct vnode *vp,
static int lf_cancel(struct lockf *, struct lockf_entry *, void *);
static void lf_split(struct lockf *, struct lockf_entry *,
lf_clearlock(struct lockf *state, struct lockf_entry *unlock)
lf_getlock(struct lockf *state, struct lockf_entry *lock, struct flock *fl)
lf_cancel(struct lockf *state, struct lockf_entry *lock, void *cookie)
lf_getblock(struct lockf *state, struct lockf_entry *lock)
lf_split(struct lockf *state, struct lockf_entry *lock1,
struct lockf *ls;
struct lockf *ls;
struct lockf *ls;
SYSCTL_PROC(_kern, KERN_LOCKF, lockf,
lf_advlockasync(struct vop_advlockasync_args *ap, struct lockf **statep,
struct lockf *state;
struct lockf *ls;
ls = malloc(sizeof(struct lockf), M_LOCKF, M_WAITOK|M_ZERO);
lf_advlock(struct vop_advlock_args *ap, struct lockf **statep, u_quad_t size)
lf_purgelocks(struct vnode *vp, struct lockf **statep)
struct lockf *state;
lf_add_outgoing(struct lockf *state, struct lockf_entry *lock)
LIST_ENTRY(lockf) ls_link; /* (S) all active lockf states */
LIST_HEAD(lockf_list, lockf);
int lf_advlock(struct vop_advlock_args *, struct lockf **, u_quad_t);
int lf_advlockasync(struct vop_advlockasync_args *, struct lockf **, u_quad_t);
void lf_purgelocks(struct vnode *vp, struct lockf **statep);
struct lockf *v_lockf; /* Byte-level advisory lock list */
r = lockf(fd, F_LOCK, 0);
if (lockf(fd, F_ULOCK, 0) == -1)
r = lockf(fd, F_LOCK, 0);
if (lockf(fd, F_ULOCK, 0) == -1)
r = lockf(fd, F_LOCK, size);
if (lockf(fd, F_ULOCK, size) == -1)