Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Sanitize the symbol namespace. NFC.
details: https://anonhg.NetBSD.org/src/rev/b1c73e1b11a7
branches: trunk
changeset: 990008:b1c73e1b11a7
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sat Oct 23 16:58:17 2021 +0000
description:
Sanitize the symbol namespace. NFC.
diffstat:
sys/fs/msdosfs/denode.h | 46 +++++++++---------
sys/fs/msdosfs/direntry.h | 28 +++++-----
sys/fs/msdosfs/fat.h | 22 ++++----
sys/fs/msdosfs/msdosfs_conv.c | 26 ++++++----
sys/fs/msdosfs/msdosfs_denode.c | 42 ++++++++--------
sys/fs/msdosfs/msdosfs_fat.c | 47 ++++++++++--------
sys/fs/msdosfs/msdosfs_lookup.c | 76 +++++++++++++++++-------------
sys/fs/msdosfs/msdosfs_rename.c | 23 ++++----
sys/fs/msdosfs/msdosfs_vfsops.c | 13 ++--
sys/fs/msdosfs/msdosfs_vnops.c | 83 ++++++++++++++++++---------------
usr.sbin/makefs/msdos/msdosfs_denode.c | 30 ++++++-----
usr.sbin/makefs/msdos/msdosfs_vfsops.c | 7 +-
usr.sbin/makefs/msdos/msdosfs_vnops.c | 45 ++++++++++-------
13 files changed, 265 insertions(+), 223 deletions(-)
diffs (truncated from 1645 to 300 lines):
diff -r 57a4a0dde985 -r b1c73e1b11a7 sys/fs/msdosfs/denode.h
--- a/sys/fs/msdosfs/denode.h Sat Oct 23 15:20:26 2021 +0000
+++ b/sys/fs/msdosfs/denode.h Sat Oct 23 16:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: denode.h,v 1.28 2021/10/23 07:45:03 hannken Exp $ */
+/* $NetBSD: denode.h,v 1.29 2021/10/23 16:58:17 thorpej Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -305,34 +305,36 @@
struct componentname;
struct direntry;
struct kauth_cred;
-int msdosfs_update(struct vnode *, const struct timespec *,
+int msdosfs_update(struct vnode *, const struct timespec *,
const struct timespec *, int);
-int createde(struct denode *, struct denode *,
+int msdosfs_createde(struct denode *, struct denode *,
const struct msdosfs_lookup_results *,
struct denode **, struct componentname *);
-int deextend(struct denode *, u_long, struct kauth_cred *);
+int msdosfs_deextend(struct denode *, u_long, struct kauth_cred *);
#ifdef MAKEFS
-int deget(struct msdosfsmount *, u_long, u_long, struct denode **);
+int msdosfs_deget(struct msdosfsmount *, u_long, u_long, struct denode **);
#else
-int deget(struct msdosfsmount *, u_long, u_long, struct vnode **);
+int msdosfs_deget(struct msdosfsmount *, u_long, u_long, struct vnode **);
#endif
-int detrunc(struct denode *, u_long, int, struct kauth_cred *);
-int deupdat(struct denode *, int);
-int dosdirempty(struct denode *);
-int readde(struct denode *, struct buf **, struct direntry **);
-int readep(struct msdosfsmount *, u_long, u_long,
+int msdosfs_detrunc(struct denode *, u_long, int, struct kauth_cred *);
+int msdosfs_deupdat(struct denode *, int);
+int msdosfs_dosdirempty(struct denode *);
+int msdosfs_readde(struct denode *, struct buf **, struct direntry **);
+int msdosfs_readep(struct msdosfsmount *, u_long, u_long,
struct buf **, struct direntry **);
-int removede(struct denode *, struct denode *,
+int msdosfs_removede(struct denode *, struct denode *,
const struct msdosfs_lookup_results *);
-int uniqdosname(struct denode *, struct componentname *, u_char *);
-int findwin95(struct denode *);
-int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int, struct kauth_cred *);
-void msdosfs_gop_markupdate(struct vnode *, int);
-void msdosfs_detimes(struct denode *, const struct timespec *,
- const struct timespec *, const struct timespec *, int);
-int msdosfs_fh_enter(struct msdosfsmount *, uint32_t, uint32_t, uint32_t *);
-int msdosfs_fh_remove(struct msdosfsmount *, uint32_t, uint32_t);
-int msdosfs_fh_lookup(struct msdosfsmount *, uint32_t, uint32_t, uint32_t *);
-void msdosfs_fh_destroy(struct msdosfsmount *);
+int msdosfs_uniqdosname(struct denode *, struct componentname *, u_char *);
+int msdosfs_findwin95(struct denode *);
+int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int,
+ struct kauth_cred *);
+void msdosfs_gop_markupdate(struct vnode *, int);
+void msdosfs_detimes(struct denode *, const struct timespec *,
+ const struct timespec *, const struct timespec *, int);
+int msdosfs_fh_enter(struct msdosfsmount *, uint32_t, uint32_t, uint32_t *);
+int msdosfs_fh_remove(struct msdosfsmount *, uint32_t, uint32_t);
+int msdosfs_fh_lookup(struct msdosfsmount *, uint32_t, uint32_t,
+ uint32_t *);
+void msdosfs_fh_destroy(struct msdosfsmount *);
#endif /* _KERNEL || MAKEFS */
#endif /* _MSDOSFS_DENODE_H_ */
diff -r 57a4a0dde985 -r b1c73e1b11a7 sys/fs/msdosfs/direntry.h
--- a/sys/fs/msdosfs/direntry.h Sat Oct 23 15:20:26 2021 +0000
+++ b/sys/fs/msdosfs/direntry.h Sat Oct 23 16:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: direntry.h,v 1.11 2016/02/01 02:59:33 christos Exp $ */
+/* $NetBSD: direntry.h,v 1.12 2021/10/23 16:58:17 thorpej Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -128,20 +128,20 @@
#if defined(_KERNEL) || defined(MAKEFS)
struct dirent;
-void unix2dostime(const struct timespec *tsp, int gmtoff, uint16_t *ddp,
- uint16_t *dtp, uint8_t *dhp);
-void dos2unixtime(unsigned int dd, unsigned int dt, unsigned int dh,
+void msdosfs_unix2dostime(const struct timespec *tsp, int gmtoff,
+ uint16_t *ddp, uint16_t *dtp, uint8_t *dhp);
+void msdosfs_dos2unixtime(unsigned int dd, unsigned int dt, unsigned int dh,
int gmtoff, struct timespec *tsp);
-int dos2unixfn(unsigned char dn[11], unsigned char *un, int lower);
-int unix2dosfn(const unsigned char *un, unsigned char dn[12], int unlen,
- unsigned int gen);
-int unix2winfn(const unsigned char *un, int unlen, struct winentry *wep,
- int cnt, int chksum, int utf8);
-int winChkName(const unsigned char *un, int unlen, struct winentry *wep,
- int chksum, int utf8);
-int win2unixfn(struct winentry *wep, struct dirent *dp, int chksum,
+int msdosfs_dos2unixfn(unsigned char dn[11], unsigned char *un, int lower);
+int msdosfs_unix2dosfn(const unsigned char *un, unsigned char dn[12],
+ int unlen, unsigned int gen);
+int msdosfs_unix2winfn(const unsigned char *un, int unlen,
+ struct winentry *wep, int cnt, int chksum, int utf8);
+int msdosfs_winChkName(const unsigned char *un, int unlen,
+ struct winentry *wep, int chksum, int utf8);
+int msdosfs_win2unixfn(struct winentry *wep, struct dirent *dp, int chksum,
uint16_t *namlen, int utf8);
-uint8_t winChksum(uint8_t *name);
-int winSlotCnt(const unsigned char *un, int unlen, int utf8);
+uint8_t msdosfs_winChksum(uint8_t *name);
+int msdosfs_winSlotCnt(const unsigned char *un, int unlen, int utf8);
#endif /* _KERNEL || MAKEFS */
#endif /* _MSDOSFS_DIRENTRY_H_ */
diff -r 57a4a0dde985 -r b1c73e1b11a7 sys/fs/msdosfs/fat.h
--- a/sys/fs/msdosfs/fat.h Sat Oct 23 15:20:26 2021 +0000
+++ b/sys/fs/msdosfs/fat.h Sat Oct 23 16:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fat.h,v 1.9 2014/10/18 08:33:28 snj Exp $ */
+/* $NetBSD: fat.h,v 1.10 2021/10/23 16:58:17 thorpej Exp $ */
/*-
* Copyright (C) 1994, 1997 Wolfgang Solfrank.
@@ -106,14 +106,16 @@
*/
#define DE_CLEAR 1 /* Zero out the blocks allocated */
-int pcbmap(struct denode *, u_long, daddr_t *, u_long *, int *);
-int clusterfree(struct msdosfsmount *, u_long, u_long *);
-int clusteralloc(struct msdosfsmount *, u_long, u_long,u_long *,u_long *);
-int extendfile(struct denode *, u_long, struct buf **, u_long *, int);
-int fatentry(int, struct msdosfsmount *, u_long, u_long *, u_long);
-void fc_purge(struct denode *, u_int);
-void fc_lookup(struct denode *, u_long, u_long *, u_long *);
-int fillinusemap(struct msdosfsmount *);
-int freeclusterchain(struct msdosfsmount *, u_long);
+int msdosfs_pcbmap(struct denode *, u_long, daddr_t *, u_long *, int *);
+int msdosfs_clusterfree(struct msdosfsmount *, u_long, u_long *);
+int msdosfs_clusteralloc(struct msdosfsmount *, u_long, u_long, u_long *,
+ u_long *);
+int msdosfs_extendfile(struct denode *, u_long, struct buf **, u_long *,
+ int);
+int msdosfs_fatentry(int, struct msdosfsmount *, u_long, u_long *, u_long);
+void msdosfs_fc_purge(struct denode *, u_int);
+void msdosfs_fc_lookup(struct denode *, u_long, u_long *, u_long *);
+int msdosfs_fillinusemap(struct msdosfsmount *);
+int msdosfs_freeclusterchain(struct msdosfsmount *, u_long);
#endif /* _KERNEL || MAKEFS */
#endif /* _MSDOSFS_FAT_H_ */
diff -r 57a4a0dde985 -r b1c73e1b11a7 sys/fs/msdosfs/msdosfs_conv.c
--- a/sys/fs/msdosfs/msdosfs_conv.c Sat Oct 23 15:20:26 2021 +0000
+++ b/sys/fs/msdosfs/msdosfs_conv.c Sat Oct 23 16:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $ */
+/* $NetBSD: msdosfs_conv.c,v 1.18 2021/10/23 16:58:17 thorpej Exp $ */
/*-
* Copyright (C) 1995, 1997 Wolfgang Solfrank.
@@ -58,7 +58,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.18 2021/10/23 16:58:17 thorpej Exp $");
/*
* System include files.
@@ -117,7 +117,8 @@
* file timestamps. The passed in unix time is assumed to be in GMT.
*/
void
-unix2dostime(const struct timespec *tsp, int gmtoff, u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp)
+msdosfs_unix2dostime(const struct timespec *tsp, int gmtoff,
+ u_int16_t *ddp, u_int16_t *dtp, u_int8_t *dhp)
{
u_long t;
struct clock_ymdhms ymd;
@@ -170,7 +171,8 @@
* not be too efficient.
*/
void
-dos2unixtime(u_int dd, u_int dt, u_int dh, int gmtoff, struct timespec *tsp)
+msdosfs_dos2unixtime(u_int dd, u_int dt, u_int dh, int gmtoff,
+ struct timespec *tsp)
{
time_t seconds;
struct clock_ymdhms ymd;
@@ -320,7 +322,7 @@
* null.
*/
int
-dos2unixfn(u_char dn[11], u_char *un, int lower)
+msdosfs_dos2unixfn(u_char dn[11], u_char *un, int lower)
{
int i, j;
int thislong = 1;
@@ -383,7 +385,7 @@
* 3 if conversion was successful and generation number was inserted
*/
int
-unix2dosfn(const u_char *un, u_char dn[12], int unlen, u_int gen)
+msdosfs_unix2dosfn(const u_char *un, u_char dn[12], int unlen, u_int gen)
{
int i, j, l;
int conv = 1;
@@ -536,7 +538,8 @@
* i.e. doesn't consist solely of blanks and dots
*/
int
-unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt, int chksum, int utf8)
+msdosfs_unix2winfn(const u_char *un, int unlen, struct winentry *wep, int cnt,
+ int chksum, int utf8)
{
u_int16_t wn[WIN_MAXLEN], *p;
int i, len;
@@ -592,7 +595,8 @@
* Returns the checksum or -1 if no match
*/
int
-winChkName(const u_char *un, int unlen, struct winentry *wep, int chksum, int utf8)
+msdosfs_winChkName(const u_char *un, int unlen, struct winentry *wep,
+ int chksum, int utf8)
{
u_int16_t wn[WIN_MAXLEN], *p;
u_int16_t buf[WIN_CHARS];
@@ -648,7 +652,7 @@
* Returns the checksum or -1 if impossible
*/
int
-win2unixfn(struct winentry *wep, struct dirent *dp, int chksum,
+msdosfs_win2unixfn(struct winentry *wep, struct dirent *dp, int chksum,
uint16_t *namlen, int utf8)
{
u_int16_t wn[WIN_CHARS], *p;
@@ -722,7 +726,7 @@
* Compute the checksum of a DOS filename for Win95 use
*/
u_int8_t
-winChksum(u_int8_t *name)
+msdosfs_winChksum(u_int8_t *name)
{
int i;
u_int8_t s;
@@ -736,7 +740,7 @@
* Determine the number of slots necessary for Win95 names
*/
int
-winSlotCnt(const u_char *un, int unlen, int utf8)
+msdosfs_winSlotCnt(const u_char *un, int unlen, int utf8)
{
const u_char *cp;
int len;
diff -r 57a4a0dde985 -r b1c73e1b11a7 sys/fs/msdosfs/msdosfs_denode.c
--- a/sys/fs/msdosfs/msdosfs_denode.c Sat Oct 23 15:20:26 2021 +0000
+++ b/sys/fs/msdosfs/msdosfs_denode.c Sat Oct 23 16:58:17 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_denode.c,v 1.59 2020/04/23 21:47:07 ad Exp $ */
+/* $NetBSD: msdosfs_denode.c,v 1.60 2021/10/23 16:58:17 thorpej Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.59 2020/04/23 21:47:07 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_denode.c,v 1.60 2021/10/23 16:58:17 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -179,7 +179,7 @@
* vpp - returns the address of the gotten vnode.
*/
int
-deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset,
+msdosfs_deget(struct msdosfsmount *pmp, u_long dirclust, u_long diroffset,
struct vnode **vpp)
/* pmp: so we know the maj/min number */
/* dirclust: cluster this dir entry came from */
@@ -243,7 +243,7 @@
ldep->de_pmp = pmp;
ldep->de_devvp = pmp->pm_devvp;
ldep->de_refcnt = 1;
- fc_purge(ldep, 0); /* init the FAT cache for this denode */
+ msdosfs_fc_purge(ldep, 0); /* init the FAT cache for this denode */
/*
* Copy the directory entry into the denode area of the vnode.
@@ -280,8 +280,8 @@
ldep->de_MDate = ldep->de_CDate;
/* leave the other fields as garbage */
} else {
- error = readep(pmp, ldep->de_dirclust, ldep->de_diroffset,
- &bp, &direntptr);
+ error = msdosfs_readep(pmp, ldep->de_dirclust,
+ ldep->de_diroffset, &bp, &direntptr);
if (error) {
pool_put(&msdosfs_denode_pool, ldep);
return error;
@@ -305,7 +305,7 @@
vp->v_type = VDIR;
if (ldep->de_StartCluster != MSDOSFSROOT) {
- error = pcbmap(ldep, CLUST_END, 0, &size, 0);
Home |
Main Index |
Thread Index |
Old Index