swap.h revision cb15d5d96b3b2730714c28bfe06cfe7421758b8c
2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1987, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */ 2N/A/* All Rights Reserved */ 2N/A * University Copyright- Copyright (c) 1982, 1986, 1988 2N/A * The Regents of the University of California 2N/A * All Rights Reserved 2N/A * University Acknowledgment- Portions of this document are derived from 2N/A * software developed by the University of California, Berkeley, and its 2N/A#
error "Cannot use swapctl in the large files compilation environment" 2N/A/* The following are for the swapctl system call */ 2N/A#
define SC_ADD 1 /* add a specified resource for swapping */ 2N/A#
define SC_LIST 2 /* list all the swapping resources */ 2N/A#
define SC_REMOVE 3 /* remove the specified swapping resource */ 2N/A#
define SC_GETNSWP 4 /* get number of swap resources configured */ 2N/A#
define SC_AINFO 5 /* get anonymous memory resource information */ 2N/A char *
sr_name;
/* pathname of the resource specified */ 2N/A int swt_n;
/* number of swapents following */ 2N/A/* Kernel's view of user ILP32 swapres and swapent structures */ 2N/A#
endif /* _SYSCALL32 */ 2N/A#
endif /* _LP64 && _SYSCALL32 */ 2N/A/* ste_flags values */ 2N/A#
define ST_INDEL 0x01 /* Deletion of file is in progress. */ 2N/A /* Prevents others from deleting or */ 2N/A /* allocating from it */ 2N/A /* Clearing during deletion signals */ 2N/A /* that you want to add the file back */ 2N/A /* again, and will eventually cause */ 2N/A /* it to be added back */ 2N/A * VM - virtual swap device. 2N/A * Stuff to convert an anon slot pointer to a page name. 2N/A * Because the address of the slot (ap) is a unique identifier, we 2N/A * use it to generate a unique (vp,off), as shown in the comment for 2N/A * The off bits are shifted PAGESHIFT to directly form a page aligned 2N/A * offset; the vp index bits map 1-1 to a vnode. * Convert from an anon slot to associated vnode and offset. * Get a vnode name for an anon slot. * The vnum, offset are derived from anon struct address which is * 16 bytes aligned. anon structs may be kmem_cache_alloc'd concurrently by * multiple threads and come from a small range of addresses (same slab), in * which case high order AP bits do not vary much, so choose vnum from low * order bits which vary the most. Different threads will thus get different * vnums and vnodes, which avoids vph_mutex_contention on the subsequent * +-----------...-------------------+-----------------------+----+ * | swap offset | vnum |0000| * +-----------...-------------------+-----------------------+----+ * Free the page name for the specified anon slot. * For now there's nothing to do. /* Flags for swap_phys_alloc */ #
define SA_NOT 0x01 /* Must have slot from swap dev other than input one *//* Special error codes for swap_newphysname() */ #
define SE_NOSWAP -
1 /* No physical swap slots available */#
define SE_NOANON -
2 /* No anon slot for swap slot */