Source-Changes-HG archive

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

[src/trunk]: src/lib/libpuffs Use size_t in place of voff_t in puffs_setrooti...



details:   https://anonhg.NetBSD.org/src/rev/d4cebd0a1dff
branches:  trunk
changeset: 1026618:d4cebd0a1dff
user:      pho <pho%NetBSD.org@localhost>
date:      Fri Dec 03 17:12:17 2021 +0000

description:
Use size_t in place of voff_t in puffs_setrootinfo(3)

Chuck Silvers pointed out that voff_t was also supposed to be
kernel-only. The correct type to use in userland would be off_t, but
since changing vsize_t to either voff_t or off_t is an ABI change on
32-bit platforms, we use size_t knowing that it is technically
incorrect.

diffstat:

 lib/libpuffs/puffs.3 |  4 ++--
 lib/libpuffs/puffs.c |  8 ++++----
 lib/libpuffs/puffs.h |  4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diffs (72 lines):

diff -r 2e5a13a92a8b -r d4cebd0a1dff lib/libpuffs/puffs.3
--- a/lib/libpuffs/puffs.3      Fri Dec 03 14:00:59 2021 +0000
+++ b/lib/libpuffs/puffs.3      Fri Dec 03 17:12:17 2021 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: puffs.3,v 1.65 2021/12/03 14:00:59 pho Exp $
+.\"    $NetBSD: puffs.3,v 1.66 2021/12/03 17:12:17 pho Exp $
 .\"
 .\" Copyright (c) 2006, 2007, 2008 Antti Kantee.  All rights reserved.
 .\"
@@ -55,7 +55,7 @@
 .Fn puffs_setroot "struct puffs_usermount *pu" "struct puffs_node *node"
 .Ft void
 .Fo puffs_setrootinfo
-.Fa "struct puffs_usermount *pu" "enum vtype vt" "voff_t vsize" "dev_t rdev"
+.Fa "struct puffs_usermount *pu" "enum vtype vt" "size_t vsize" "dev_t rdev"
 .Fc
 .Ft struct puffs_node *
 .Fn puffs_getroot "struct puffs_usermount *pu"
diff -r 2e5a13a92a8b -r d4cebd0a1dff lib/libpuffs/puffs.c
--- a/lib/libpuffs/puffs.c      Fri Dec 03 14:00:59 2021 +0000
+++ b/lib/libpuffs/puffs.c      Fri Dec 03 17:12:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs.c,v 1.126 2021/12/03 14:00:59 pho Exp $  */
+/*     $NetBSD: puffs.c,v 1.127 2021/12/03 17:12:17 pho Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if !defined(lint)
-__RCSID("$NetBSD: puffs.c,v 1.126 2021/12/03 14:00:59 pho Exp $");
+__RCSID("$NetBSD: puffs.c,v 1.127 2021/12/03 17:12:17 pho Exp $");
 #endif /* !lint */
 
 #include <sys/param.h>
@@ -265,7 +265,7 @@
 
 void
 puffs_setrootinfo(struct puffs_usermount *pu, enum vtype vt,
-       voff_t vsize, dev_t rdev)
+       size_t vsize, dev_t rdev)
 {
        struct puffs_kargs *pargs = pu->pu_kargp;
 
@@ -275,7 +275,7 @@
        }
 
        pargs->pa_root_vtype = vt;
-       pargs->pa_root_vsize = vsize;
+       pargs->pa_root_vsize = (voff_t)vsize;
        pargs->pa_root_rdev = rdev;
 }
 
diff -r 2e5a13a92a8b -r d4cebd0a1dff lib/libpuffs/puffs.h
--- a/lib/libpuffs/puffs.h      Fri Dec 03 14:00:59 2021 +0000
+++ b/lib/libpuffs/puffs.h      Fri Dec 03 17:12:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs.h,v 1.129 2021/12/03 14:00:59 pho Exp $  */
+/*     $NetBSD: puffs.h,v 1.130 2021/12/03 17:12:17 pho Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -503,7 +503,7 @@
                                      struct puffs_node *);
 struct puffs_node      *puffs_getroot(struct puffs_usermount *);
 void                   puffs_setrootinfo(struct puffs_usermount *,
-                                         enum vtype, voff_t, dev_t); 
+                                         enum vtype, size_t, dev_t); 
 
 void                   *puffs_getspecific(struct puffs_usermount *);
 void                   puffs_setspecific(struct puffs_usermount *, void *);



Home | Main Index | Thread Index | Old Index