Module Name:    src
Committed By:   christos
Date:           Fri Jul  3 14:08:53 UTC 2020

Modified Files:
        src/sys/compat/sys: statvfs.h

Log Message:
don't overallocate (requested by maxv@)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/sys/statvfs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/sys/statvfs.h
diff -u src/sys/compat/sys/statvfs.h:1.1 src/sys/compat/sys/statvfs.h:1.2
--- src/sys/compat/sys/statvfs.h:1.1	Sun Sep 22 19:18:53 2019
+++ src/sys/compat/sys/statvfs.h	Fri Jul  3 10:08:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: statvfs.h,v 1.1 2019/09/22 23:18:53 christos Exp $	 */
+/*	$NetBSD: statvfs.h,v 1.2 2020/07/03 14:08:53 christos Exp $	 */
 
 /*-
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -112,12 +112,12 @@ statvfs_to_statvfs90(const struct statvf
 static __inline int
 statvfs_to_statvfs90_copy(const void *vs, void *vs90, size_t l)
 {
-	struct statvfs90 *s90 = STATVFSBUF_GET();
+	struct statvfs90 *s90 = kmem_zalloc(sizeof(*s90), KM_SLEEP);
 	int error;
 
 	statvfs_to_statvfs90(vs, s90);
 	error = copyout(s90, vs90, l);
-	STATVFSBUF_PUT(s90);
+	kmem_free(s90, sizeof(*s90));
 
 	return error;
 }
@@ -158,4 +158,4 @@ int	__getmntinfo90(struct statvfs **, in
 
 __END_DECLS
 
-#endif /* !_SYS_STATVFS_H_ */
+#endif /* !_COMPAT_SYS_STATVFS_H_ */

Reply via email to