Changeset View
Changeset View
Standalone View
Standalone View
head/sys/sys/buf.h
Show First 20 Lines • Show All 135 Lines • ▼ Show 20 Lines | struct { | ||||
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; | ||||
struct vm_page *b_pages[btoc(MAXPHYS)]; | |||||
int b_npages; | int b_npages; | ||||
struct workhead b_dep; /* (D) List of filesystem dependencies. */ | struct workhead b_dep; /* (D) List of filesystem dependencies. */ | ||||
void *b_fsprivate1; | void *b_fsprivate1; | ||||
void *b_fsprivate2; | void *b_fsprivate2; | ||||
void *b_fsprivate3; | void *b_fsprivate3; | ||||
#if defined(FULL_BUF_TRACKING) | #if defined(FULL_BUF_TRACKING) | ||||
#define BUF_TRACKING_SIZE 32 | #define BUF_TRACKING_SIZE 32 | ||||
#define BUF_TRACKING_ENTRY(x) ((x) & (BUF_TRACKING_SIZE - 1)) | #define BUF_TRACKING_ENTRY(x) ((x) & (BUF_TRACKING_SIZE - 1)) | ||||
const char *b_io_tracking[BUF_TRACKING_SIZE]; | const char *b_io_tracking[BUF_TRACKING_SIZE]; | ||||
uint32_t b_io_tcnt; | uint32_t b_io_tcnt; | ||||
#elif defined(BUF_TRACKING) | #elif defined(BUF_TRACKING) | ||||
const char *b_io_tracking; | const char *b_io_tracking; | ||||
#endif | #endif | ||||
struct vm_page *b_pages[]; | |||||
}; | }; | ||||
#define b_object b_bufobj->bo_object | #define b_object b_bufobj->bo_object | ||||
/* | /* | ||||
* These flags are kept in b_flags. | * These flags are kept in b_flags. | ||||
* | * | ||||
* Notes: | * Notes: | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | |||||
#define B_INVAL 0x00002000 /* Does not contain valid info. */ | #define B_INVAL 0x00002000 /* Does not contain valid info. */ | ||||
#define B_BARRIER 0x00004000 /* Write this and all preceding first. */ | #define B_BARRIER 0x00004000 /* Write this and all preceding first. */ | ||||
#define B_NOCACHE 0x00008000 /* Do not cache block after use. */ | #define B_NOCACHE 0x00008000 /* Do not cache block after use. */ | ||||
#define B_MALLOC 0x00010000 /* malloced b_data */ | #define B_MALLOC 0x00010000 /* malloced b_data */ | ||||
#define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ | #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */ | ||||
#define B_INVALONERR 0x00040000 /* Invalidate on write error. */ | #define B_INVALONERR 0x00040000 /* Invalidate on write error. */ | ||||
#define B_00080000 0x00080000 /* Available flag. */ | #define B_00080000 0x00080000 /* Available flag. */ | ||||
#define B_00100000 0x00100000 /* Available flag. */ | #define B_00100000 0x00100000 /* Available flag. */ | ||||
#define B_00200000 0x00200000 /* Available flag. */ | #define B_MAXPHYS 0x00200000 /* nitems(b_pages[]) = atop(MAXPHYS). */ | ||||
#define B_RELBUF 0x00400000 /* Release VMIO buffer. */ | #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ | ||||
#define B_FS_FLAG1 0x00800000 /* Available flag for FS use. */ | #define B_FS_FLAG1 0x00800000 /* Available flag for FS use. */ | ||||
#define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ | #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ | ||||
#define B_INFREECNT 0x02000000 /* buf is counted in numfreebufs */ | #define B_INFREECNT 0x02000000 /* buf is counted in numfreebufs */ | ||||
#define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */ | #define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */ | ||||
#define B_MANAGED 0x08000000 /* Managed by FS. */ | #define B_MANAGED 0x08000000 /* Managed by FS. */ | ||||
#define B_RAM 0x10000000 /* Read ahead mark (flag) */ | #define B_RAM 0x10000000 /* Read ahead mark (flag) */ | ||||
#define B_VMIO 0x20000000 /* VMIO flag */ | #define B_VMIO 0x20000000 /* VMIO flag */ | ||||
#define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */ | #define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */ | ||||
#define B_REMFREE 0x80000000 /* Delayed bremfree */ | #define B_REMFREE 0x80000000 /* Delayed bremfree */ | ||||
#define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ | #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ | ||||
"\33paging\32infreecnt\31nocopy\30b23\27relbuf\26b21\25b20" \ | "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26maxphys\25b20" \ | ||||
"\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ | "\24b19\23invalonerr\22clusterok\21malloc\20nocache\17b14\16inval" \ | ||||
"\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ | "\15reuse\14noreuse\13eintr\12done\11b8\10delwri" \ | ||||
"\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" | "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" | ||||
/* | /* | ||||
* These flags are kept in b_xflags. | * These flags are kept in b_xflags. | ||||
* | * | ||||
* BX_FSPRIV reserves a set of eight flags that may be used by individual | * BX_FSPRIV reserves a set of eight flags that may be used by individual | ||||
▲ Show 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | |||||
#define GB_UNMAPPED 0x0008 /* Do not mmap buffer pages. */ | #define GB_UNMAPPED 0x0008 /* Do not mmap buffer pages. */ | ||||
#define GB_KVAALLOC 0x0010 /* But allocate KVA. */ | #define GB_KVAALLOC 0x0010 /* But allocate KVA. */ | ||||
#define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ | #define GB_CKHASH 0x0020 /* If reading, calc checksum hash */ | ||||
#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 long maxswzone; /* Max KVA for swap structures */ | extern u_long maxswzone; /* Max KVA for swap structures */ | ||||
extern 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; | ||||
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. */ | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |