Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Pad out the slop for kern.buf based on the passed i...



details:   https://anonhg.NetBSD.org/src/rev/d904d911bd9b
branches:  trunk
changeset: 984801:d904d911bd9b
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sat Jul 24 13:27:39 2021 +0000

description:
Pad out the slop for kern.buf based on the passed in element size,
rather than a size of an unrelated struct.

diffstat:

 sys/kern/vfs_bio.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r e258dffce9fd -r d904d911bd9b sys/kern/vfs_bio.c
--- a/sys/kern/vfs_bio.c        Sat Jul 24 11:39:18 2021 +0000
+++ b/sys/kern/vfs_bio.c        Sat Jul 24 13:27:39 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_bio.c,v 1.298 2021/04/01 06:25:59 simonb Exp $     */
+/*     $NetBSD: vfs_bio.c,v 1.299 2021/07/24 13:27:39 simonb Exp $     */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2019, 2020 The NetBSD Foundation, Inc.
@@ -123,7 +123,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.298 2021/04/01 06:25:59 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.299 2021/07/24 13:27:39 simonb Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bufcache.h"
@@ -1850,7 +1850,7 @@
 
        *oldlenp = needed;
        if (oldp == NULL)
-               *oldlenp += KERN_BUFSLOP * sizeof(buf_t);
+               *oldlenp += KERN_BUFSLOP * elem_size;
 
        return (error);
 }



Home | Main Index | Thread Index | Old Index