From owner-p4-projects@FreeBSD.ORG Mon Jul 21 20:38:25 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D1F6C37B404; Mon, 21 Jul 2003 20:38:24 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6255637B401 for ; Mon, 21 Jul 2003 20:38:24 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id E239443F75 for ; Mon, 21 Jul 2003 20:38:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id h6M3cN0U032918 for ; Mon, 21 Jul 2003 20:38:23 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id h6M3cNTm032915 for perforce@freebsd.org; Mon, 21 Jul 2003 20:38:23 -0700 (PDT) Date: Mon, 21 Jul 2003 20:38:23 -0700 (PDT) Message-Id: <200307220338.h6M3cNTm032915@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Subject: PERFORCE change 34813 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jul 2003 03:38:26 -0000 http://perforce.freebsd.org/chv.cgi?CH=34813 Change 34813 by peter@peter_hammer on 2003/07/21 20:37:57 *kick* dillon. Define inlined functions before using them. Affected files ... .. //depot/projects/hammer/sys/vm/swap_pager.c#13 edit Differences ... ==== //depot/projects/hammer/sys/vm/swap_pager.c#13 (text+ko) ==== @@ -290,6 +290,35 @@ } /* + * SWP_PAGER_HASH() - hash swap meta data + * + * This is an inline helper function which hashes the swapblk given + * the object and page index. It returns a pointer to a pointer + * to the object, or a pointer to a NULL pointer if it could not + * find a swapblk. + * + * This routine must be called at splvm(). + */ +static __inline struct swblock ** +swp_pager_hash(vm_object_t object, vm_pindex_t index) +{ + struct swblock **pswap; + struct swblock *swap; + + index &= ~(vm_pindex_t)SWAP_META_MASK; + pswap = &swhash[(index ^ (int)(intptr_t)object) & swhash_mask]; + while ((swap = *pswap) != NULL) { + if (swap->swb_object == object && + swap->swb_index == index + ) { + break; + } + pswap = &swap->swb_hnext; + } + return (pswap); +} + +/* * SWAP_PAGER_INIT() - initialize the swap pager! * * Expected to be started from system init. NOTE: This code is run @@ -1860,34 +1889,6 @@ * appropriate tracking counters. */ -/* - * SWP_PAGER_HASH() - hash swap meta data - * - * This is an inline helper function which hashes the swapblk given - * the object and page index. It returns a pointer to a pointer - * to the object, or a pointer to a NULL pointer if it could not - * find a swapblk. - * - * This routine must be called at splvm(). - */ -static __inline struct swblock ** -swp_pager_hash(vm_object_t object, vm_pindex_t index) -{ - struct swblock **pswap; - struct swblock *swap; - - index &= ~(vm_pindex_t)SWAP_META_MASK; - pswap = &swhash[(index ^ (int)(intptr_t)object) & swhash_mask]; - while ((swap = *pswap) != NULL) { - if (swap->swb_object == object && - swap->swb_index == index - ) { - break; - } - pswap = &swap->swb_hnext; - } - return (pswap); -} /* * SWP_PAGER_META_BUILD() - add swap block to swap meta data for object