]>
Commit | Line | Data |
---|---|---|
1c79356b | 1 | /* |
91447636 | 2 | * Copyright (c) 1999-2004 Apple Computer, Inc. All rights reserved. |
1c79356b | 3 | * |
6601e61a | 4 | * @APPLE_LICENSE_HEADER_START@ |
1c79356b | 5 | * |
6601e61a A |
6 | * The contents of this file constitute Original Code as defined in and |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
8f6c56a5 | 11 | * |
6601e61a A |
12 | * This Original Code and all software distributed under the License are |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
8f6c56a5 A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
6601e61a A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
8f6c56a5 | 19 | * |
6601e61a | 20 | * @APPLE_LICENSE_HEADER_END@ |
1c79356b A |
21 | */ |
22 | /* | |
1c79356b A |
23 | * Header file for Unified Buffer Cache. |
24 | * | |
25 | */ | |
26 | ||
27 | #ifndef _SYS_UBC_H_ | |
28 | #define _SYS_UBC_H_ | |
29 | ||
9bccf70c | 30 | #include <sys/appleapiopts.h> |
1c79356b | 31 | #include <sys/cdefs.h> |
91447636 A |
32 | #include <sys/kernel_types.h> |
33 | #include <kern/locks.h> | |
1c79356b A |
34 | #include <mach/memory_object_types.h> |
35 | ||
1c79356b | 36 | |
91447636 | 37 | /* defns for ubc_sync_range() and ubc_msync */ |
1c79356b | 38 | |
91447636 A |
39 | #define UBC_PUSHDIRTY 0x01 /* clean any dirty pages in the specified range to the backing store */ |
40 | #define UBC_PUSHALL 0x02 /* push both dirty and precious pages to the backing store */ | |
41 | #define UBC_INVALIDATE 0x04 /* invalidate pages in the specified range... may be used with UBC_PUSHDIRTY/ALL */ | |
42 | #define UBC_SYNC 0x08 /* wait for I/Os generated by UBC_PUSHDIRTY to complete */ | |
1c79356b A |
43 | |
44 | __BEGIN_DECLS | |
0b4e3aa0 | 45 | |
91447636 A |
46 | off_t ubc_blktooff(struct vnode *, daddr64_t); |
47 | daddr64_t ubc_offtoblk(struct vnode *, off_t); | |
48 | off_t ubc_getsize(struct vnode *); | |
49 | int ubc_setsize(struct vnode *, off_t); | |
0b4e3aa0 | 50 | |
91447636 A |
51 | struct ucred *ubc_getcred(struct vnode *); |
52 | int ubc_setcred(struct vnode *, struct proc *); | |
13fec989 A |
53 | struct thread; |
54 | int ubc_setthreadcred(struct vnode *, struct proc *, struct thread *); | |
1c79356b | 55 | |
91447636 A |
56 | int ubc_sync_range(vnode_t, off_t, off_t, int); |
57 | errno_t ubc_msync(vnode_t, off_t, off_t, off_t *, int); | |
58 | int ubc_pages_resident(vnode_t); | |
1c79356b | 59 | |
1c79356b | 60 | |
91447636 A |
61 | /* cluster IO routines */ |
62 | int advisory_read(vnode_t, off_t, off_t, int); | |
1c79356b | 63 | |
91447636 A |
64 | int cluster_read(vnode_t, struct uio *, off_t, int); |
65 | int cluster_write(vnode_t, struct uio *, off_t, off_t, off_t, off_t, int); | |
66 | int cluster_pageout(vnode_t, upl_t, vm_offset_t, off_t, int, off_t, int); | |
67 | int cluster_pagein(vnode_t, upl_t, vm_offset_t, off_t, int, off_t, int); | |
68 | int cluster_push(vnode_t, int); | |
69 | int cluster_bp(buf_t); | |
70 | void cluster_zero(upl_t, vm_offset_t, int, buf_t); | |
1c79356b | 71 | |
1c79356b | 72 | |
91447636 A |
73 | /* UPL routines */ |
74 | int ubc_create_upl(vnode_t, off_t, long, upl_t *, upl_page_info_t **, int); | |
75 | int ubc_upl_map(upl_t, upl_offset_t *); | |
76 | int ubc_upl_unmap(upl_t); | |
77 | int ubc_upl_commit(upl_t); | |
78 | int ubc_upl_commit_range(upl_t, upl_offset_t, upl_size_t, int); | |
79 | int ubc_upl_abort(upl_t, int); | |
80 | int ubc_upl_abort_range(upl_t, upl_offset_t, upl_size_t, int); | |
1c79356b | 81 | |
91447636 | 82 | upl_page_info_t *ubc_upl_pageinfo(upl_t); |
1c79356b | 83 | |
91447636 | 84 | __END_DECLS |
9bccf70c | 85 | |
1c79356b A |
86 | #endif /* _SYS_UBC_H_ */ |
87 |