Module Name: src Committed By: pooka Date: Fri Jun 13 11:57:48 UTC 2014
Modified Files: src/sys/fs/tmpfs: tmpfs_mem.c Log Message: use psize_t for physical memory calculation To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/fs/tmpfs/tmpfs_mem.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/fs/tmpfs/tmpfs_mem.c diff -u src/sys/fs/tmpfs/tmpfs_mem.c:1.7 src/sys/fs/tmpfs/tmpfs_mem.c:1.8 --- src/sys/fs/tmpfs/tmpfs_mem.c:1.7 Tue Jun 10 15:44:27 2014 +++ src/sys/fs/tmpfs/tmpfs_mem.c Fri Jun 13 11:57:48 2014 @@ -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 @@ tmpfs_mem_info(bool total) 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 @@ tmpfs_bytes_max(struct tmpfs_mount *mp) } 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); }