Module Name: src
Committed By: martin
Date: Tue Jun 10 15:44:27 UTC 2014
Modified Files:
src/sys/fs/tmpfs: tmpfs_mem.c
Log Message:
Make sure to expand "freepages" to 64bit before shifting to byte values -
on rump we may have all our virtual address space "free".
Pointed out by pooka@.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 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.6 src/sys/fs/tmpfs/tmpfs_mem.c:1.7
--- src/sys/fs/tmpfs/tmpfs_mem.c:1.6 Sat Jun 7 09:54:34 2014
+++ src/sys/fs/tmpfs/tmpfs_mem.c Tue Jun 10 15:44:27 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: tmpfs_mem.c,v 1.6 2014/06/07 09:54:34 martin Exp $ */
+/* $NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin 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.6 2014/06/07 09:54:34 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -123,7 +123,8 @@ tmpfs_bytes_max(struct tmpfs_mount *mp)
} else {
freepages -= uvmexp.freetarg;
}
- avail_mem = round_page(mp->tm_bytes_used) + (freepages << PAGE_SHIFT);
+ avail_mem = round_page(mp->tm_bytes_used)
+ + ((uint64_t)freepages << PAGE_SHIFT);
return MIN(mp->tm_mem_limit, avail_mem);
}