Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jul 2022 13:48:15 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 709550b451e3 - stable/13 - vm_map: Simplify a call to vm_object_allocate_anon()
Message-ID:  <202207191348.26JDmFmU024548@gitrepo.freebsd.org>

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

URL: https://cgit.FreeBSD.org/src/commit/?id=709550b451e3e2ac8a1bf49c3d8d5f45aea92281

commit 709550b451e3e2ac8a1bf49c3d8d5f45aea92281
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-07-12 12:53:17 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-07-19 13:36:21 +0000

    vm_map: Simplify a call to vm_object_allocate_anon()
    
    vm_object_allocate_anon() automatically sets "charge" to 0 if no cred
    reference is provided, so the caller doesn't need any conditional logic.
    
    No functional change intended.
    
    Reviewed by:    alc, kib
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 70b2996120a7f96527ce5c676f938886e8aa292d)
---
 sys/vm/vm_map.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
index 83b9811fae6c..fa57cea48dae 100644
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -5062,7 +5062,7 @@ RetryLookupLocked:
 		if (vm_map_lock_upgrade(map))
 			goto RetryLookup;
 		entry->object.vm_object = vm_object_allocate_anon(atop(size),
-		    NULL, entry->cred, entry->cred != NULL ? size : 0);
+		    NULL, entry->cred, size);
 		entry->offset = 0;
 		entry->cred = NULL;
 		vm_map_lock_downgrade(map);



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