Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Don't do variable stack allocations for systems ...



details:   https://anonhg.NetBSD.org/src/rev/7b7d6c4135d9
branches:  trunk
changeset: 346612:7b7d6c4135d9
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 21 18:10:47 2016 +0000

description:
Don't do variable stack allocations for systems with non-const PAGE_SIZE;
instead assume that the smallest pagesize is 1024.

diffstat:

 sys/ufs/lfs/lfs_pages.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r cc13d51de264 -r 7b7d6c4135d9 sys/ufs/lfs/lfs_pages.c
--- a/sys/ufs/lfs/lfs_pages.c   Thu Jul 21 17:45:00 2016 +0000
+++ b/sys/ufs/lfs/lfs_pages.c   Thu Jul 21 18:10:47 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_pages.c,v 1.7 2015/08/12 18:26:27 dholland Exp $   */
+/*     $NetBSD: lfs_pages.c,v 1.8 2016/07/21 18:10:47 christos Exp $   */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.7 2015/08/12 18:26:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_pages.c,v 1.8 2016/07/21 18:10:47 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -244,7 +244,8 @@
 {
        int by_list;
        struct vm_page *curpg = NULL; /* XXX: gcc */
-       struct vm_page *pgs[MAXBSIZE / PAGE_SIZE], *pg;
+       struct vm_page *pgs[MAXBSIZE /
+           (__builtin_constant_p(PAGE_SIZE) ? PAGE_SIZE : 1024)], *pg;
        off_t soff = 0; /* XXX: gcc */
        voff_t off;
        int i;



Home | Main Index | Thread Index | Old Index