PERFORCE change 34813 for review
Peter Wemm
peter at FreeBSD.org
Mon Jul 21 20:38:26 PDT 2003
http://perforce.freebsd.org/chv.cgi?CH=34813
Change 34813 by peter at 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
More information about the p4-projects
mailing list