Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 22 May 2021 09:46:24 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 12e1d859a67b - stable/13 - vm_pager: style some wrappers
Message-ID:  <202105220946.14M9kOa7012341@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=12e1d859a67bd0c0b0418cfa3215e7a18f2241e2

commit 12e1d859a67bd0c0b0418cfa3215e7a18f2241e2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-05-01 00:28:39 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-05-22 09:38:28 +0000

    vm_pager: style some wrappers
    
    (cherry picked from commit ee4211bca600af48aab95000f39b4797a74eeb85)
---
 sys/vm/vm_pager.h | 39 ++++++++++++++++++---------------------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/sys/vm/vm_pager.h b/sys/vm/vm_pager.h
index 45a5a5654806..2dfe374b9d4a 100644
--- a/sys/vm/vm_pager.h
+++ b/sys/vm/vm_pager.h
@@ -129,13 +129,9 @@ void vm_pager_init(void);
 vm_object_t vm_pager_object_lookup(struct pagerlst *, void *);
 
 static __inline void
-vm_pager_put_pages(
-	vm_object_t object,
-	vm_page_t *m,
-	int count,
-	int flags,
-	int *rtvals
-) {
+vm_pager_put_pages(vm_object_t object, vm_page_t *m, int count, int flags,
+    int *rtvals)
+{
 	VM_OBJECT_ASSERT_WLOCKED(object);
 	(*pagertab[object->type]->pgo_putpages)
 	    (object, m, count, flags, rtvals);
@@ -152,12 +148,9 @@ vm_pager_put_pages(
  *	The object must be locked.
  */
 static __inline boolean_t
-vm_pager_has_page(
-	vm_object_t object,
-	vm_pindex_t offset, 
-	int *before,
-	int *after
-) {
+vm_pager_has_page(vm_object_t object, vm_pindex_t offset, int *before,
+    int *after)
+{
 	boolean_t ret;
 
 	VM_OBJECT_ASSERT_LOCKED(object);
@@ -191,29 +184,33 @@ vm_pager_populate(vm_object_t object, vm_pindex_t pidx, int fault_type,
 static __inline void
 vm_pager_page_unswapped(vm_page_t m)
 {
+	pgo_pageunswapped_t *method;
 
-	if (pagertab[m->object->type]->pgo_pageunswapped)
-		(*pagertab[m->object->type]->pgo_pageunswapped)(m);
+	method = pagertab[m->object->type]->pgo_pageunswapped;
+	if (method != NULL)
+		method(m);
 }
 
 static __inline void
 vm_pager_update_writecount(vm_object_t object, vm_offset_t start,
     vm_offset_t end)
 {
+	pgo_writecount_t *method;
 
-	if (pagertab[object->type]->pgo_update_writecount)
-		pagertab[object->type]->pgo_update_writecount(object, start,
-		    end);
+	method = pagertab[object->type]->pgo_update_writecount;
+	if (method != NULL)
+		method(object, start, end);
 }
 
 static __inline void
 vm_pager_release_writecount(vm_object_t object, vm_offset_t start,
     vm_offset_t end)
 {
+	pgo_writecount_t *method;
 
-	if (pagertab[object->type]->pgo_release_writecount)
-		pagertab[object->type]->pgo_release_writecount(object, start,
-		    end);
+	method = pagertab[object->type]->pgo_release_writecount;
+	if (method != NULL)
+		method(object, start, end);
 }
 
 struct cdev_pager_ops {



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