Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/lockf.h
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | struct lockf { | ||||
LIST_ENTRY(lockf) ls_link; /* (S) all active lockf states */ | LIST_ENTRY(lockf) ls_link; /* (S) all active lockf states */ | ||||
struct sx ls_lock; | struct sx ls_lock; | ||||
struct lockf_entry_list ls_active; /* (s) Active locks */ | struct lockf_entry_list ls_active; /* (s) Active locks */ | ||||
struct lockf_entry_list ls_pending; /* (s) Pending locks */ | struct lockf_entry_list ls_pending; /* (s) Pending locks */ | ||||
int ls_threads; /* (i) Thread count */ | int ls_threads; /* (i) Thread count */ | ||||
}; | }; | ||||
LIST_HEAD(lockf_list, lockf); | LIST_HEAD(lockf_list, lockf); | ||||
typedef int lf_iterator(struct vnode *, struct flock *, void *); | /* | ||||
* Lock entry as exported to userland. | |||||
*/ | |||||
struct xlockf { | |||||
off_t xl_start; /* starting offset */ | |||||
off_t xl_len; /* xl_len = 0 means until end of file */ | |||||
kvaddr_t xl_id; /* address of struct file, when xl_pid is -1 */ | |||||
pid_t xl_pid; /* lock owner, or -1 to identify by xl_id instead */ | |||||
short xl_type; /* lock type: read/write, etc. */ | |||||
short xl_whence; /* type of xl_start */ | |||||
int xl_sysid; /* the namespace for xl_pid: remote system id or zero for local */ | |||||
}; | |||||
typedef int lf_iterator(struct vnode *, struct xlockf *, void *); | |||||
int lf_advlock(struct vop_advlock_args *, struct lockf **, u_quad_t); | int lf_advlock(struct vop_advlock_args *, struct lockf **, u_quad_t); | ||||
int lf_advlockasync(struct vop_advlockasync_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); | void lf_purgelocks(struct vnode *vp, struct lockf **statep); | ||||
int lf_iteratelocks_sysid(int sysid, lf_iterator *, void *); | int lf_iteratelocks_sysid(int sysid, lf_iterator *, void *); | ||||
int lf_iteratelocks_vnode(struct vnode *vp, lf_iterator *, void *); | int lf_iteratelocks_vnode(struct vnode *vp, lf_iterator *, void *); | ||||
int lf_countlocks(int sysid); | int lf_countlocks(int sysid); | ||||
void lf_clearremotesys(int sysid); | void lf_clearremotesys(int sysid); | ||||
#endif /* !_SYS_LOCKF_H_ */ | #endif /* !_SYS_LOCKF_H_ */ |