Lines Matching +full:cache +full:- +full:op +full:- +full:block +full:- +full:size

1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
79 * b_bufsize, b_bcount. b_bufsize is the allocation size of the
81 * originally requested buffer size and can serve as a bounds check
92 * V - Protected by owning bufobj lock
93 * Q - Protected by the buf queue lock
94 * D - Protected by an dependency implementation specific lock
108 uint64_t b_ckhash; /* B_CKHASH requested check-hash */
109 daddr_t b_blkno; /* Underlying physical block number. */
115 uint16_t b_subqueue; /* (Q) per-cpu q if any */
119 long b_bufsize; /* Allocated buffer size. */
121 int b_kvasize; /* size of kva for buffer */
125 daddr_t b_lblkno; /* Logical block number. */
150 #define BUF_TRACKING_ENTRY(x) ((x) & (BUF_TRACKING_SIZE - 1))
159 #define b_object b_bufobj->bo_object
215 #define B_NEEDCOMMIT 0x00000002 /* Append-write in progress. */
219 #define B_CACHE 0x00000020 /* Bread found us in the cache. */
229 #define B_NOCACHE 0x00008000 /* Do not cache block after use. */
231 #define B_CLUSTEROK 0x00020000 /* Pagein op, so swap() can count it. */
238 #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */
240 #define B_PAGING 0x04000000 /* volatile paging I/O -- bypass VMIO */
244 #define B_CLUSTER 0x40000000 /* pagein op, so swap() can count it */
251 "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age"
266 #define BX_FSPRIV 0x00FF0000 /* Filesystem-specific flags mask */
271 #define NOOFFSET (-1LL) /* No buffer offset calculated yet */
299 lockinit(&(bp)->b_lock, PRIBIO + 4, wmesg, 0, LK_NEW)
302 * Get a lock sleeping non-interruptably until it becomes available.
305 _lockmgr_args_rw(&(bp)->b_lock, (locktype), (interlock), \
313 _lockmgr_args_rw(&(bp)->b_lock, (locktype) | LK_TIMELOCK, \
322 KASSERT(((bp)->b_flags & B_REMFREE) == 0, \
328 (void)_lockmgr_args(&(bp)->b_lock, LK_RELEASE, NULL, \
337 lockmgr_recursed(&(bp)->b_lock)
343 lockstatus(&(bp)->b_lock)
349 lockmgr_disowned(&(bp)->b_lock)
355 lockdestroy(&(bp)->b_lock)
361 lockmgr_printinfo(&(bp)->b_lock)
368 _lockmgr_assert(&(bp)->b_lock, KA_LOCKED, LOCK_FILE, LOCK_LINE)
370 _lockmgr_assert(&(bp)->b_lock, KA_SLOCKED, LOCK_FILE, LOCK_LINE)
372 _lockmgr_assert(&(bp)->b_lock, KA_XLOCKED, LOCK_FILE, LOCK_LINE)
374 _lockmgr_assert(&(bp)->b_lock, KA_UNLOCKED, LOCK_FILE, LOCK_LINE)
390 _lockmgr_disown(&(bp)->b_lock, LOCK_FILE, LOCK_LINE)
416 daddr_t v_cstart; /* v start block of cluster */
428 KASSERT(bp->b_bufobj != NULL, ("bwrite: no bufobj bp=%p", bp)); in bwrite()
429 KASSERT(bp->b_bufobj->bo_ops != NULL, ("bwrite: no bo_ops bp=%p", bp)); in bwrite()
430 KASSERT(bp->b_bufobj->bo_ops->bop_write != NULL, in bwrite()
432 return (BO_WRITE(bp->b_bufobj, bp)); in bwrite()
439 KASSERT(bp->b_bufobj != NULL, ("bstrategy: no bufobj bp=%p", bp)); in bstrategy()
440 KASSERT(bp->b_bufobj->bo_ops != NULL, in bstrategy()
442 KASSERT(bp->b_bufobj->bo_ops->bop_strategy != NULL, in bstrategy()
444 BO_STRATEGY(bp->b_bufobj, bp); in bstrategy()
450 KASSERT((bp->b_flags & B_IOSTARTED) == 0, in buf_start()
452 bp->b_flags |= B_IOSTARTED; in buf_start()
460 if ((bp->b_flags & B_IOSTARTED) != 0) { in buf_complete()
461 bp->b_flags &= ~B_IOSTARTED; in buf_complete()
488 bp->b_io_tracking[BUF_TRACKING_ENTRY(bp->b_io_tcnt++)] = location; in buf_track()
490 bp->b_io_tracking = location; in buf_track()
500 bzero((bp)->b_data, (u_int)(bp)->b_bcount); \
501 (bp)->b_resid = 0; \
507 #define GB_LOCK_NOWAIT 0x0001 /* Fail if we block on a buf lock. */
520 extern u_long maxbcache; /* Max KVA for buffer cache */
521 extern int maxbcachebuf; /* Max buffer cache block size */
535 return (bp->b_data != unmapped_buf); in buf_mapped()
549 #define bread(vp, blkno, size, cred, bpp) \ argument
550 breadn_flags(vp, blkno, blkno, size, NULL, NULL, 0, cred, 0, \
552 #define bread_gb(vp, blkno, size, cred, gbflags, bpp) \ argument
553 breadn_flags(vp, blkno, blkno, size, NULL, NULL, 0, cred, \
555 #define breadn(vp, blkno, size, rablkno, rabsize, cnt, cred, bpp) \ argument
556 breadn_flags(vp, blkno, blkno, size, rablkno, rabsize, cnt, cred, \
577 int getblkx(struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size,
597 void vfs_bio_bzero_buf(struct buf *bp, int base, int size);
600 void vfs_bio_set_valid(struct buf *, int base, int size);
611 int allocbuf(struct buf *bp, int size);