bufobj.h (183754) | bufobj.h (241896) |
---|---|
1/*- 2 * Copyright (c) 2004 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 2004 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/sys/bufobj.h 183754 2008-10-10 21:23:50Z attilio $ | 26 * $FreeBSD: head/sys/sys/bufobj.h 241896 2012-10-22 17:50:54Z kib $ |
27 */ 28 29/* 30 * Architectural notes: 31 * 32 * bufobj is a new object which is what buffers hang from in the buffer 33 * cache. 34 * --- 71 unchanged lines hidden (view full) --- 106}; 107 108/* 109 * XXX BO_ONWORKLST could be replaced with a check for NULL list elements 110 * in v_synclist. 111 */ 112#define BO_ONWORKLST (1 << 0) /* On syncer work-list */ 113#define BO_WWAIT (1 << 1) /* Wait for output to complete */ | 27 */ 28 29/* 30 * Architectural notes: 31 * 32 * bufobj is a new object which is what buffers hang from in the buffer 33 * cache. 34 * --- 71 unchanged lines hidden (view full) --- 106}; 107 108/* 109 * XXX BO_ONWORKLST could be replaced with a check for NULL list elements 110 * in v_synclist. 111 */ 112#define BO_ONWORKLST (1 << 0) /* On syncer work-list */ 113#define BO_WWAIT (1 << 1) /* Wait for output to complete */ |
114#define BO_NEEDSGIANT (1 << 2) /* Require giant for child buffers. */ | |
115 116#define BO_MTX(bo) (&(bo)->bo_mtx) 117#define BO_LOCK(bo) mtx_lock(BO_MTX((bo))) 118#define BO_UNLOCK(bo) mtx_unlock(BO_MTX((bo))) 119#define ASSERT_BO_LOCKED(bo) mtx_assert(BO_MTX((bo)), MA_OWNED) 120#define ASSERT_BO_UNLOCKED(bo) mtx_assert(BO_MTX((bo)), MA_NOTOWNED) 121 122void bufobj_wdrop(struct bufobj *bo); 123void bufobj_wref(struct bufobj *bo); 124void bufobj_wrefl(struct bufobj *bo); 125int bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo); 126int bufobj_wwait(struct bufobj *bo, int slpflag, int timeo); 127int bufsync(struct bufobj *bo, int waitfor); 128void bufbdflush(struct bufobj *bo, struct buf *bp); 129 130#endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ 131#endif /* _SYS_BUFOBJ_H_ */ | 114 115#define BO_MTX(bo) (&(bo)->bo_mtx) 116#define BO_LOCK(bo) mtx_lock(BO_MTX((bo))) 117#define BO_UNLOCK(bo) mtx_unlock(BO_MTX((bo))) 118#define ASSERT_BO_LOCKED(bo) mtx_assert(BO_MTX((bo)), MA_OWNED) 119#define ASSERT_BO_UNLOCKED(bo) mtx_assert(BO_MTX((bo)), MA_NOTOWNED) 120 121void bufobj_wdrop(struct bufobj *bo); 122void bufobj_wref(struct bufobj *bo); 123void bufobj_wrefl(struct bufobj *bo); 124int bufobj_invalbuf(struct bufobj *bo, int flags, int slpflag, int slptimeo); 125int bufobj_wwait(struct bufobj *bo, int slpflag, int timeo); 126int bufsync(struct bufobj *bo, int waitfor); 127void bufbdflush(struct bufobj *bo, struct buf *bp); 128 129#endif /* defined(_KERNEL) || defined(_KVM_VNODE) */ 130#endif /* _SYS_BUFOBJ_H_ */ |