4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 * University Copyright- Copyright (c) 1982, 1986, 1988
32 * The Regents of the University of California
35 * University Acknowledgment- Portions of this document are derived from
36 * software developed by the University of California, Berkeley, and its
43 #pragma ident "%Z%%M% %I% %E% SMI"
57 * The VM system manages memory as a cache of paged vnodes.
58 * This file desribes the interfaces to common subroutines
59 * used to help implement the VM/file system routines.
62 struct page
*pvn_read_kluster(struct vnode
*vp
, u_offset_t off
,
63 struct seg
*seg
, caddr_t addr
, u_offset_t
*offp
,
64 size_t *lenp
, u_offset_t vp_off
, size_t vp_len
,
66 struct page
*pvn_write_kluster(struct vnode
*vp
, struct page
*pp
,
67 u_offset_t
*offp
, size_t *lenp
, u_offset_t vp_off
,
68 size_t vp_len
, int flags
);
69 void pvn_read_done(struct page
*plist
, int flags
);
70 void pvn_write_done(struct page
*plist
, int flags
);
71 void pvn_io_done(struct page
*plist
);
72 int pvn_vplist_dirty(struct vnode
*vp
, u_offset_t off
,
73 int (*putapage
)(vnode_t
*, struct page
*, u_offset_t
*,
74 size_t *, int, cred_t
*),
75 int flags
, struct cred
*cred
);
76 int pvn_getdirty(struct page
*pp
, int flags
);
77 void pvn_vpzero(struct vnode
*vp
, u_offset_t vplen
, size_t zbytes
);
79 int (*getpage
)(vnode_t
*, u_offset_t
, size_t, uint_t
*,
80 struct page
*[], size_t, struct seg
*,
81 caddr_t
, enum seg_rw
, cred_t
*),
82 struct vnode
*vp
, u_offset_t off
, size_t len
,
83 uint_t
*protp
, struct page
**pl
, size_t plsz
,
84 struct seg
*seg
, caddr_t addr
, enum seg_rw rw
,
86 void pvn_plist_init(struct page
*pp
, struct page
**pl
, size_t plsz
,
87 u_offset_t off
, size_t io_len
, enum seg_rw rw
);
91 * When requesting pages from the getpage routines, pvn_getpages will
92 * allocate space to return PVN_GETPAGE_NUM pages which map PVN_GETPAGE_SZ
93 * worth of bytes. These numbers are chosen to be the minimum of the max's
94 * given in terms of bytes and pages.
96 #define PVN_MAX_GETPAGE_SZ 0x10000 /* getpage size limit */
97 #define PVN_MAX_GETPAGE_NUM 0x8 /* getpage page limit */
99 #if PVN_MAX_GETPAGE_SZ > PVN_MAX_GETPAGE_NUM * PAGESIZE
101 #define PVN_GETPAGE_SZ ptob(PVN_MAX_GETPAGE_NUM)
102 #define PVN_GETPAGE_NUM PVN_MAX_GETPAGE_NUM
106 #define PVN_GETPAGE_SZ PVN_MAX_GETPAGE_SZ
107 #define PVN_GETPAGE_NUM btop(PVN_MAX_GETPAGE_SZ)
117 #endif /* _VM_PVN_H */