Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/buf.h
Show First 20 Lines • Show All 126 Lines • ▼ Show 20 Lines | struct buf { | ||||
caddr_t b_kvabase; /* base kva for buffer */ | caddr_t b_kvabase; /* base kva for buffer */ | ||||
daddr_t b_lblkno; /* Logical block number. */ | daddr_t b_lblkno; /* Logical block number. */ | ||||
struct vnode *b_vp; /* Device vnode. */ | struct vnode *b_vp; /* Device vnode. */ | ||||
struct ucred *b_rcred; /* Read credentials reference. */ | struct ucred *b_rcred; /* Read credentials reference. */ | ||||
struct ucred *b_wcred; /* Write credentials reference. */ | struct ucred *b_wcred; /* Write credentials reference. */ | ||||
union { | union { | ||||
TAILQ_ENTRY(buf) b_freelist; /* (Q) */ | TAILQ_ENTRY(buf) b_freelist; /* (Q) */ | ||||
struct { | struct { | ||||
void (*b_pgiodone)(void *, vm_page_t *, int, int); | void (*b_pgiodone)(void *, struct vm_page *, | ||||
int, int); | |||||
int b_pgbefore; | int b_pgbefore; | ||||
int b_pgafter; | int b_pgafter; | ||||
}; | }; | ||||
}; | }; | ||||
union cluster_info { | union cluster_info { | ||||
TAILQ_HEAD(cluster_list_head, buf) cluster_head; | TAILQ_HEAD(cluster_list_head, buf) cluster_head; | ||||
TAILQ_ENTRY(buf) cluster_entry; | TAILQ_ENTRY(buf) cluster_entry; | ||||
} b_cluster; | } b_cluster; | ||||
▲ Show 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | |||||
*/ | */ | ||||
struct cluster_save { | struct cluster_save { | ||||
long bs_bcount; /* Saved b_bcount. */ | long bs_bcount; /* Saved b_bcount. */ | ||||
long bs_bufsize; /* Saved b_bufsize. */ | long bs_bufsize; /* Saved b_bufsize. */ | ||||
int bs_nchildren; /* Number of associated buffers. */ | int bs_nchildren; /* Number of associated buffers. */ | ||||
struct buf **bs_children; /* List of associated buffers. */ | struct buf **bs_children; /* List of associated buffers. */ | ||||
}; | }; | ||||
/* | |||||
* Vnode clustering tracker | |||||
*/ | |||||
struct vn_clusterw { | |||||
daddr_t v_cstart; /* v start block of cluster */ | |||||
daddr_t v_lasta; /* v last allocation */ | |||||
daddr_t v_lastw; /* v last write */ | |||||
int v_clen; /* v length of cur. cluster */ | |||||
}; | |||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
static __inline int | static __inline int | ||||
bwrite(struct buf *bp) | bwrite(struct buf *bp) | ||||
{ | { | ||||
KASSERT(bp->b_bufobj != NULL, ("bwrite: no bufobj bp=%p", bp)); | KASSERT(bp->b_bufobj != NULL, ("bwrite: no bufobj bp=%p", bp)); | ||||
KASSERT(bp->b_bufobj->bo_ops != NULL, ("bwrite: no bo_ops bp=%p", bp)); | KASSERT(bp->b_bufobj->bo_ops != NULL, ("bwrite: no bo_ops bp=%p", bp)); | ||||
▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
#define GB_NOSPARSE 0x0040 /* Do not instantiate holes */ | #define GB_NOSPARSE 0x0040 /* Do not instantiate holes */ | ||||
#define GB_CVTENXIO 0x0080 /* Convert errors to ENXIO */ | #define GB_CVTENXIO 0x0080 /* Convert errors to ENXIO */ | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
extern int nbuf; /* The number of buffer headers */ | extern int nbuf; /* The number of buffer headers */ | ||||
extern u_long maxswzone; /* Max KVA for swap structures */ | extern u_long maxswzone; /* Max KVA for swap structures */ | ||||
extern u_long maxbcache; /* Max KVA for buffer cache */ | extern u_long maxbcache; /* Max KVA for buffer cache */ | ||||
extern int maxbcachebuf; /* Max buffer cache block size */ | extern int maxbcachebuf; /* Max buffer cache block size */ | ||||
extern long runningbufspace; | extern long runningbufspace; | ||||
asomers: Odd place for a blank line. | |||||
extern long hibufspace; | extern long hibufspace; | ||||
extern int dirtybufthresh; | extern int dirtybufthresh; | ||||
extern int bdwriteskip; | extern int bdwriteskip; | ||||
extern int dirtybufferflushes; | extern int dirtybufferflushes; | ||||
extern int altbufferflushes; | extern int altbufferflushes; | ||||
extern int nswbuf; /* Number of swap I/O buffer headers. */ | extern int nswbuf; /* Number of swap I/O buffer headers. */ | ||||
extern caddr_t unmapped_buf; /* Data address for unmapped buffers. */ | extern caddr_t unmapped_buf; /* Data address for unmapped buffers. */ | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
int bufwait(struct buf *); | int bufwait(struct buf *); | ||||
int bufwrite(struct buf *); | int bufwrite(struct buf *); | ||||
void bufdone(struct buf *); | void bufdone(struct buf *); | ||||
void bd_speedup(void); | void bd_speedup(void); | ||||
extern uma_zone_t pbuf_zone; | extern uma_zone_t pbuf_zone; | ||||
uma_zone_t pbuf_zsecond_create(const char *name, int max); | uma_zone_t pbuf_zsecond_create(const char *name, int max); | ||||
struct vn_clusterw; | |||||
void cluster_init_vn(struct vn_clusterw *vnc); | |||||
int cluster_read(struct vnode *, u_quad_t, daddr_t, long, | int cluster_read(struct vnode *, u_quad_t, daddr_t, long, | ||||
struct ucred *, long, int, int, struct buf **); | struct ucred *, long, int, int, struct buf **); | ||||
int cluster_wbuild(struct vnode *, long, daddr_t, int, int); | int cluster_wbuild(struct vnode *, long, daddr_t, int, int); | ||||
void cluster_write(struct vnode *, struct buf *, u_quad_t, int, int); | void cluster_write(struct vnode *, struct vn_clusterw *, struct buf *, | ||||
u_quad_t, int, int); | |||||
void vfs_bio_brelse(struct buf *bp, int ioflags); | void vfs_bio_brelse(struct buf *bp, int ioflags); | ||||
void vfs_bio_bzero_buf(struct buf *bp, int base, int size); | void vfs_bio_bzero_buf(struct buf *bp, int base, int size); | ||||
void vfs_bio_clrbuf(struct buf *); | void vfs_bio_clrbuf(struct buf *); | ||||
void vfs_bio_set_flags(struct buf *bp, int ioflags); | void vfs_bio_set_flags(struct buf *bp, int ioflags); | ||||
void vfs_bio_set_valid(struct buf *, int base, int size); | void vfs_bio_set_valid(struct buf *, int base, int size); | ||||
void vfs_busy_pages(struct buf *, int clear_modify); | void vfs_busy_pages(struct buf *, int clear_modify); | ||||
void vfs_unbusy_pages(struct buf *); | void vfs_unbusy_pages(struct buf *); | ||||
int vmapbuf(struct buf *, void *, size_t, int); | int vmapbuf(struct buf *, void *, size_t, int); | ||||
Show All 21 Lines |
Odd place for a blank line.