Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/tmpfs use psize_t for physical memory calculation



details:   https://anonhg.NetBSD.org/src/rev/1bab427fb66d
branches:  trunk
changeset: 796665:1bab427fb66d
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Jun 13 11:57:48 2014 +0000

description:
use psize_t for physical memory calculation

diffstat:

 sys/fs/tmpfs/tmpfs_mem.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (37 lines):

diff -r a468abf0655c -r 1bab427fb66d sys/fs/tmpfs/tmpfs_mem.c
--- a/sys/fs/tmpfs/tmpfs_mem.c  Fri Jun 13 11:53:48 2014 +0000
+++ b/sys/fs/tmpfs/tmpfs_mem.c  Fri Jun 13 11:57:48 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin Exp $     */
+/*     $NetBSD: tmpfs_mem.c,v 1.8 2014/06/13 11:57:48 pooka Exp $      */
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.8 2014/06/13 11:57:48 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -115,7 +115,7 @@
 uint64_t
 tmpfs_bytes_max(struct tmpfs_mount *mp)
 {
-       size_t freepages = tmpfs_mem_info(false);
+       psize_t freepages = tmpfs_mem_info(false);
        uint64_t avail_mem;
 
        if (freepages < uvmexp.freetarg) {
@@ -123,8 +123,7 @@
        } else {
                freepages -= uvmexp.freetarg;
        }
-       avail_mem = round_page(mp->tm_bytes_used)
-           + ((uint64_t)freepages << PAGE_SHIFT);
+       avail_mem = round_page(mp->tm_bytes_used) + (freepages << PAGE_SHIFT);
        return MIN(mp->tm_mem_limit, avail_mem);
 }
 



Home | Main Index | Thread Index | Old Index