/*
* Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
*
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
*
* This file contains Original Code and/or Modifications of Original Code
* as defined in and that are subject to the Apple Public Source License
* Version 2.0 (the 'License'). You may not use this file except in
- * compliance with the License. Please obtain a copy of the License at
- * http://www.opensource.apple.com/apsl/ and read it before using this
- * file.
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
+ *
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
*
* The Original Code and all software distributed under the License are
* distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* Please see the License for the specific language governing rights and
* limitations under the License.
*
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
*/
/* Copyright (c) 1995 NeXT Computer, Inc. All Rights Reserved */
/*
#define B_CLUSTER 0x00000040 /* UPL based I/O generated by cluster layer */
#define B_PAGEIO 0x00000080 /* Page in/out */
#define B_META 0x00000100 /* buffer contains meta-data. */
+#define B_RAW 0x00000200 /* Set by physio for raw transfers. */
+#define B_FUA 0x00000400 /* Write-through disk cache(if supported) */
+#define B_PASSIVE 0x00000800 /* PASSIVE I/Os are ignored by THROTTLE I/O */
/*
* make sure to check when adding flags that
* that the new flags don't overlap the definitions
*/
void buf_markeintr(buf_t);
+/*
+ * mark the buffer associated with buf_t
+ * for write through disk cache if device supports
+ */
+void buf_markfua(buf_t);
+
+/*
+ * returns 1 if the buffer associated with buf_t
+ * is set for write through disk cache... 0 if it does not
+ */
+int buf_fua(buf_t);
+
/*
* returns 1 if the buffer associated with buf_t
* contains valid data... 0 if it does not
/*
* set specified flags on buf_t
- * B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO
+ * B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA
*/
void buf_setflags(buf_t, int32_t);
/*
* clear specified flags on buf_t
- * B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO
+ * B_LOCKED/B_NOCACHE/B_ASYNC/B_READ/B_WRITE/B_PAGEIO/B_FUA
*/
void buf_clearflags(buf_t, int32_t);
/*
* return external flags associated with buf_t
- * B_CLUSTER/B_PHYS/B_LOCKED/B_DELWRI/B_ASYNC/B_READ/B_WRITE/B_META/B_PAGEIO
+ * B_CLUSTER/B_PHYS/B_LOCKED/B_DELWRI/B_ASYNC/B_READ/B_WRITE/B_META/B_PAGEIO/B_FUA
*/
int32_t buf_flags(buf_t);
*/
#define BUF_SKIP_NONLOCKED 0x01
#define BUF_SKIP_LOCKED 0x02
+#define BUF_SCAN_CLEAN 0x04 /* scan only the clean buffers */
+#define BUF_SCAN_DIRTY 0x08 /* scan only the dirty buffers */
+#define BUF_NOTIFY_BUSY 0x10 /* notify the caller about the busy pages during the scan */
-void buf_flushdirtyblks(vnode_t, int, int, char *);
+void buf_flushdirtyblks(vnode_t, int, int, const char *);
void buf_iterate(vnode_t, int (*)(buf_t, void *), int, void *);
#define BUF_RETURNED 0