static struct simplelock uao_list_lock;
static simple_lock_data_t uao_list_lock;
static struct uao_swhash_elt	*uao_find_swhash_elt __P((struct uvm_aobj *,							  int, boolean_t));static int			 uao_find_swslot __P((struct uvm_aobj *, int));static boolean_t		 uao_flush __P((struct uvm_object *,						voff_t, voff_t, int));static void			 uao_free __P((struct uvm_aobj *));static int			 uao_get __P((struct uvm_object *, voff_t,					      struct vm_page **, int *, int,					      vm_prot_t, int, int));static boolean_t		 uao_releasepg __P((struct vm_page *,						    struct vm_page **));static boolean_t		 uao_pagein __P((struct uvm_aobj *, int, int));static boolean_t		 uao_pagein_page __P((struct uvm_aobj *, int));/* * aobj_pager * * note that some functions (e.g. put) are handled elsewhere */struct uvm_pagerops aobj_pager = {	NULL,			/* init */	uao_reference,		/* reference */	uao_detach,		/* detach */	NULL,			/* fault */	uao_flush,		/* flush */	uao_get,		/* get */	NULL,			/* put (done by pagedaemon) */	NULL,			/* cluster */	NULL,			/* mk_pcluster */	uao_releasepg		/* releasepg */};/* * uao_list: global list of active aobjs, locked by uao_list_lock */static LIST_HEAD(aobjlist, uvm_aobj) uao_list;static struct simplelock uao_list_lock;/* * functions *//* * hash table/array related functions *//* * uao_find_swhash_elt: find (or create) a hash table entry for a page * offset. * * => the object should be locked by the caller */static struct uao_swhash_elt *uao_find_swhash_elt(aobj, pageidx, create)	struct uvm_aobj *aobj;	int pageidx;	boolean_t create;{	struct uao_swhash *swhash;	struct uao_swhash_elt *elt;	voff_t page_tag;	swhash = UAO_SWHASH_HASH(aobj, pageidx);	page_tag = UAO_SWHASH_ELT_TAG(pageidx);	/*	 * now search the bucket for the requested tag	 */	LIST_FOREACH(elt, swhash, list) {		if (elt->tag == page_tag) {			return elt;		}	}	if (!create) {		return NULL;	}	/*	 * allocate a new entry for the bucket and init/insert it in	 */	elt = pool_get(&uao_swhash_elt_pool, PR_NOWAIT);	if (elt == NULL) {		return NULL;	}	LIST_INSERT_HEAD(swhash, elt, list);	elt->tag = page_tag;	elt->count = 0;	memset(elt->slots, 0, sizeof(elt->slots));	return elt;}