191 #define swap_alloc(AP) \
192 { \
193 (AP)->an_vp = swapfs_getvp(((uintptr_t)(AP) >> AN_CACHE_ALIGN_LOG2) \
194 & AN_VPMASK); \
195 (AP)->an_off = (anoff_t)((((uintptr_t)(AP)) >> \
196 AN_VPSHIFT + AN_CACHE_ALIGN_LOG2) << PAGESHIFT); \
197 }
198
199 /*
200 * Free the page name for the specified anon slot.
201 * For now there's nothing to do.
202 */
203 #define swap_free(AP)
204
205 /* Flags for swap_phys_alloc */
206 #define SA_NOT 0x01 /* Must have slot from swap dev other than input one */
207
208 /* Special error codes for swap_newphysname() */
209 #define SE_NOSWAP -1 /* No physical swap slots available */
210 #define SE_NOANON -2 /* No anon slot for swap slot */
211
212 #ifdef _KERNEL
213 extern struct anon *swap_anon(struct vnode *vp, u_offset_t off);
214 extern int swap_phys_alloc(struct vnode **vpp, u_offset_t *offp, size_t *lenp,
215 uint_t flags);
216 extern void swap_phys_free(struct vnode *vp, u_offset_t off, size_t len);
217 extern int swap_getphysname(struct vnode *vp, u_offset_t off,
218 struct vnode **pvpp, u_offset_t *poffp);
219 extern int swap_newphysname(struct vnode *vp, u_offset_t offset,
220 u_offset_t *offp, size_t *lenp, struct vnode **pvpp, u_offset_t *poffp);
221
222 extern struct swapinfo *swapinfo;
223 extern int swap_debug;
224 #endif /* _KERNEL */
225
226 #ifdef SWAP_DEBUG
227 #define SW_RENAME 0x01
228 #define SW_RESV 0x02
229 #define SW_ALLOC 0x04
230 #define SW_CTL 0x08
|
191 #define swap_alloc(AP) \
192 { \
193 (AP)->an_vp = swapfs_getvp(((uintptr_t)(AP) >> AN_CACHE_ALIGN_LOG2) \
194 & AN_VPMASK); \
195 (AP)->an_off = (anoff_t)((((uintptr_t)(AP)) >> \
196 AN_VPSHIFT + AN_CACHE_ALIGN_LOG2) << PAGESHIFT); \
197 }
198
199 /*
200 * Free the page name for the specified anon slot.
201 * For now there's nothing to do.
202 */
203 #define swap_free(AP)
204
205 /* Flags for swap_phys_alloc */
206 #define SA_NOT 0x01 /* Must have slot from swap dev other than input one */
207
208 /* Special error codes for swap_newphysname() */
209 #define SE_NOSWAP -1 /* No physical swap slots available */
210 #define SE_NOANON -2 /* No anon slot for swap slot */
211 #define SE_NODEV -3 /* No swap devices on this machine. */
212
213 #ifdef _KERNEL
214 extern struct anon *swap_anon(struct vnode *vp, u_offset_t off);
215 extern int swap_phys_alloc(struct vnode **vpp, u_offset_t *offp, size_t *lenp,
216 uint_t flags);
217 extern void swap_phys_free(struct vnode *vp, u_offset_t off, size_t len);
218 extern int swap_getphysname(struct vnode *vp, u_offset_t off,
219 struct vnode **pvpp, u_offset_t *poffp);
220 extern int swap_newphysname(struct vnode *vp, u_offset_t offset,
221 u_offset_t *offp, size_t *lenp, struct vnode **pvpp, u_offset_t *poffp);
222
223 extern struct swapinfo *swapinfo;
224 extern int swap_debug;
225 #endif /* _KERNEL */
226
227 #ifdef SWAP_DEBUG
228 #define SW_RENAME 0x01
229 #define SW_RESV 0x02
230 #define SW_ALLOC 0x04
231 #define SW_CTL 0x08
|