Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Dec 2013 20:07:02 +0000 (UTC)
From:      Alan Cox <alc@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r259107 - head/sys/vm
Message-ID:  <201312082007.rB8K72G3028102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: alc
Date: Sun Dec  8 20:07:02 2013
New Revision: 259107
URL: http://svnweb.freebsd.org/changeset/base/259107

Log:
  Eliminate a redundant parameter to vm_radix_replace().
  
  Improve the wording of the comment describing vm_radix_replace().
  
  Reviewed by:	attilio
  MFC after:	6 weeks
  Sponsored by:	EMC / Isilon Storage Division

Modified:
  head/sys/vm/vm_page.c
  head/sys/vm/vm_radix.c
  head/sys/vm/vm_radix.h

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sun Dec  8 19:32:29 2013	(r259106)
+++ head/sys/vm/vm_page.c	Sun Dec  8 20:07:02 2013	(r259107)
@@ -1200,7 +1200,7 @@ vm_page_replace(vm_page_t mnew, vm_objec
 
 	mnew->object = object;
 	mnew->pindex = pindex;
-	mold = vm_radix_replace(&object->rtree, mnew, pindex);
+	mold = vm_radix_replace(&object->rtree, mnew);
 	KASSERT(mold->queue == PQ_NONE,
 	    ("vm_page_replace: mold is on a paging queue"));
 

Modified: head/sys/vm/vm_radix.c
==============================================================================
--- head/sys/vm/vm_radix.c	Sun Dec  8 19:32:29 2013	(r259106)
+++ head/sys/vm/vm_radix.c	Sun Dec  8 20:07:02 2013	(r259107)
@@ -788,20 +788,18 @@ vm_radix_reclaim_allnodes(struct vm_radi
 }
 
 /*
- * Replace an existing page into the trie with another one.
- * Panics if the replacing page is not present or if the new page has an
- * invalid key.
+ * Replace an existing page in the trie with another one.
+ * Panics if there is not an old page in the trie at the new page's index.
  */
 vm_page_t
-vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage, vm_pindex_t index)
+vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage)
 {
 	struct vm_radix_node *rnode;
 	vm_page_t m;
+	vm_pindex_t index;
 	int slot;
 
-	KASSERT(newpage->pindex == index, ("%s: newpage index invalid",
-	    __func__));
-
+	index = newpage->pindex;
 	rnode = vm_radix_getroot(rtree);
 	if (rnode == NULL)
 		panic("%s: replacing page on an empty trie", __func__);

Modified: head/sys/vm/vm_radix.h
==============================================================================
--- head/sys/vm/vm_radix.h	Sun Dec  8 19:32:29 2013	(r259106)
+++ head/sys/vm/vm_radix.h	Sun Dec  8 20:07:02 2013	(r259107)
@@ -43,8 +43,7 @@ vm_page_t	vm_radix_lookup_ge(struct vm_r
 vm_page_t	vm_radix_lookup_le(struct vm_radix *rtree, vm_pindex_t index);
 void		vm_radix_reclaim_allnodes(struct vm_radix *rtree);
 void		vm_radix_remove(struct vm_radix *rtree, vm_pindex_t index);
-vm_page_t	vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage,
-		    vm_pindex_t index);
+vm_page_t	vm_radix_replace(struct vm_radix *rtree, vm_page_t newpage);
 
 #endif /* _KERNEL */
 #endif /* !_VM_RADIX_H_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201312082007.rB8K72G3028102>