Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/bufobj.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | |||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
#include <sys/_lock.h> | #include <sys/_lock.h> | ||||
#include <sys/_rwlock.h> | #include <sys/_rwlock.h> | ||||
#include <sys/_pctrie.h> | #include <sys/_pctrie.h> | ||||
struct bufobj; | struct bufobj; | ||||
struct buf_ops; | struct buf_ops; | ||||
struct vm_object; | |||||
extern struct buf_ops buf_ops_bio; | extern struct buf_ops buf_ops_bio; | ||||
TAILQ_HEAD(buflists, buf); | TAILQ_HEAD(buflists, buf); | ||||
/* A Buffer list & trie */ | /* A Buffer list & trie */ | ||||
struct bufv { | struct bufv { | ||||
struct buflists bv_hd; /* Sorted blocklist */ | struct buflists bv_hd; /* Sorted blocklist */ | ||||
Show All 23 Lines | |||||
* Locking notes: | * Locking notes: | ||||
* 'S' is sync_mtx | * 'S' is sync_mtx | ||||
* 'v' is the vnode lock which embeds the bufobj. | * 'v' is the vnode lock which embeds the bufobj. | ||||
* '-' Constant and unchanging after initialization. | * '-' Constant and unchanging after initialization. | ||||
*/ | */ | ||||
struct bufobj { | struct bufobj { | ||||
struct rwlock bo_lock; /* Lock which protects "i" things */ | struct rwlock bo_lock; /* Lock which protects "i" things */ | ||||
struct buf_ops *bo_ops; /* - Buffer operations */ | struct buf_ops *bo_ops; /* - Buffer operations */ | ||||
struct vm_object *bo_object; /* v Place to store VM object */ | |||||
LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ | LIST_ENTRY(bufobj) bo_synclist; /* S dirty vnode list */ | ||||
void *bo_private; /* private pointer */ | void *bo_private; /* private pointer */ | ||||
struct bufv bo_clean; /* i Clean buffers */ | struct bufv bo_clean; /* i Clean buffers */ | ||||
struct bufv bo_dirty; /* i Dirty buffers */ | struct bufv bo_dirty; /* i Dirty buffers */ | ||||
int bo_numoutput; /* i Writes in progress */ | int bo_numoutput; /* i Writes in progress */ | ||||
u_int bo_flag; /* i Flags */ | u_int bo_flag; /* i Flags */ | ||||
int bo_domain; /* - Clean queue affinity */ | int bo_domain; /* - Clean queue affinity */ | ||||
int bo_bsize; /* - Block size for i/o */ | int bo_bsize; /* - Block size for i/o */ | ||||
Show All 16 Lines | |||||
#define ASSERT_BO_WLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_WLOCKED) | #define ASSERT_BO_WLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_WLOCKED) | ||||
#define ASSERT_BO_LOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_LOCKED) | #define ASSERT_BO_LOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_LOCKED) | ||||
#define ASSERT_BO_UNLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_UNLOCKED) | #define ASSERT_BO_UNLOCKED(bo) rw_assert(BO_LOCKPTR((bo)), RA_UNLOCKED) | ||||
void bufobj_init(struct bufobj *bo, void *priv); | void bufobj_init(struct bufobj *bo, void *priv); | ||||
void bufobj_wdrop(struct bufobj *bo); | void bufobj_wdrop(struct bufobj *bo); | ||||
void bufobj_wref(struct bufobj *bo); | void bufobj_wref(struct bufobj *bo); | ||||
void bufobj_wrefl(struct bufobj *bo); | void bufobj_wrefl(struct bufobj *bo); | ||||
int bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo); | int bufobj_invalbuf(struct vm_object *obj, struct bufobj *bo, int flags, | ||||
int slpflag, int slptimeo); | |||||
int bufobj_wwait(struct bufobj *bo, int slpflag, int timeo); | int bufobj_wwait(struct bufobj *bo, int slpflag, int timeo); | ||||
int bufsync(struct bufobj *bo, int waitfor); | int bufsync(struct bufobj *bo, int waitfor); | ||||
void bufbdflush(struct bufobj *bo, struct buf *bp); | void bufbdflush(struct bufobj *bo, struct buf *bp); | ||||
#endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ | #endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ | ||||
#endif /* _SYS_BUFOBJ_H_ */ | #endif /* _SYS_BUFOBJ_H_ */ |