Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/sys don't overallocate (requested by maxv@)



details:   https://anonhg.NetBSD.org/src/rev/93cd0892767d
branches:  trunk
changeset: 935465:93cd0892767d
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 03 14:08:53 2020 +0000

description:
don't overallocate (requested by maxv@)

diffstat:

 sys/compat/sys/statvfs.h |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r af058b9578e6 -r 93cd0892767d sys/compat/sys/statvfs.h
--- a/sys/compat/sys/statvfs.h  Fri Jul 03 12:53:27 2020 +0000
+++ b/sys/compat/sys/statvfs.h  Fri Jul 03 14:08:53 2020 +0000
@@ -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 @@
 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 @@
 
 __END_DECLS
 
-#endif /* !_SYS_STATVFS_H_ */
+#endif /* !_COMPAT_SYS_STATVFS_H_ */



Home | Main Index | Thread Index | Old Index