Unleashed v1.4
[unleashed.git] / include / vm / pvn.h
blob281f7877c29dfd8bf8526a74799f470348dbb7a0
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
22 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
27 /* All Rights Reserved */
30 * University Copyright- Copyright (c) 1982, 1986, 1988
31 * The Regents of the University of California
32 * All Rights Reserved
34 * University Acknowledgment- Portions of this document are derived from
35 * software developed by the University of California, Berkeley, and its
36 * contributors.
39 #ifndef _VM_PVN_H
40 #define _VM_PVN_H
42 #include <sys/buf.h>
43 #include <vm/seg.h>
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
49 #ifdef _KERNEL
52 * VM - paged vnode.
54 * The VM system manages memory as a cache of paged vnodes.
55 * This file desribes the interfaces to common subroutines
56 * used to help implement the VM/file system routines.
59 struct page *pvn_read_kluster(struct vnode *vp, uoff_t off,
60 struct seg *seg, caddr_t addr, uoff_t *offp,
61 size_t *lenp, uoff_t vp_off, size_t vp_len,
62 int isra);
63 struct page *pvn_write_kluster(struct vnode *vp, struct page *pp,
64 uoff_t *offp, size_t *lenp, uoff_t vp_off,
65 size_t vp_len, int flags);
66 void pvn_read_done(struct page *plist, int flags);
67 void pvn_write_done(struct page *plist, int flags);
68 void pvn_io_done(struct page *plist);
69 int pvn_vplist_dirty(struct vnode *vp, uoff_t off,
70 int (*putapage)(vnode_t *, struct page *, uoff_t *,
71 size_t *, int, cred_t *),
72 int flags, struct cred *cred);
73 void pvn_vplist_setdirty(vnode_t *vp, int (*page_check)(page_t *));
74 int pvn_getdirty(struct page *pp, int flags);
75 void pvn_vpzero(struct vnode *vp, uoff_t vplen, size_t zbytes);
76 int pvn_getpages(
77 int (*getpage)(vnode_t *, uoff_t, size_t, uint_t *,
78 struct page *[], size_t, struct seg *,
79 caddr_t, enum seg_rw, cred_t *),
80 struct vnode *vp, uoff_t off, size_t len,
81 uint_t *protp, struct page **pl, size_t plsz,
82 struct seg *seg, caddr_t addr, enum seg_rw rw,
83 struct cred *cred);
84 void pvn_plist_init(struct page *pp, struct page **pl, size_t plsz,
85 uoff_t off, size_t io_len, enum seg_rw rw);
86 void pvn_init(void);
88 #endif /* _KERNEL */
90 #ifdef __cplusplus
92 #endif
94 #endif /* _VM_PVN_H */