diff options
59 files changed, 611 insertions, 880 deletions
diff --git a/sys/dev/dgb/dgb.c b/sys/dev/dgb/dgb.c index 6dd2a25..e96cbc7 100644 --- a/sys/dev/dgb/dgb.c +++ b/sys/dev/dgb/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.12 1995/12/10 15:54:01 bde Exp $ + * dgb.c $Id: dgb.c,v 1.13 1995/12/10 20:54:21 bde Exp $ * * Digiboard driver. * @@ -37,6 +37,7 @@ #include <sys/file.h> #include <sys/uio.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/devconf.h> @@ -157,9 +158,9 @@ struct dgb_softc { }; -struct dgb_softc dgb_softc[NDGB]; -struct dgb_p dgb_ports[NDGBPORTS]; -struct tty dgb_tty[NDGBPORTS]; +static struct dgb_softc dgb_softc[NDGB]; +static struct dgb_p dgb_ports[NDGBPORTS]; +static struct tty dgb_tty[NDGBPORTS]; /* * The public functions in the com module ought to be declared in a com-driver @@ -167,8 +168,8 @@ struct tty dgb_tty[NDGBPORTS]; */ /* Interrupt handling entry points. */ -void dgbintr __P((int unit)); -void dgbpoll __P((void *unit_c)); +static void dgbintr __P((int unit)); +static void dgbpoll __P((void *unit_c)); /* Device switch entry points. */ #define dgbreset noreset @@ -235,11 +236,10 @@ static struct speedtab dgbspeedtab[] = { -1, -1 }; -#ifdef DEBUG - int dgbdebug=1; -#else - int dgbdebug=0; -#endif +static int dgbdebug=0; +SYSCTL_INT(_debug, OID_AUTO, dgb_debug, CTLFLAG_RW, + &dgbdebug, 0, ""); + static int polltimeout=0; @@ -1178,7 +1178,8 @@ dgbwrite(dev, uio, flag) return error; } -void dgbpoll(unit_c) +static void +dgbpoll(unit_c) void *unit_c; { int unit=(int)unit_c; @@ -1399,7 +1400,7 @@ void dgbpoll(unit_c) timeout(dgbpoll, unit_c, hz/25); } -void +static void dgbintr(unit) int unit; { diff --git a/sys/gnu/ext2fs/ext2_extern.h b/sys/gnu/ext2fs/ext2_extern.h index ea83912..5b9623f 100644 --- a/sys/gnu/ext2fs/ext2_extern.h +++ b/sys/gnu/ext2fs/ext2_extern.h @@ -65,28 +65,14 @@ int ext2_blkatoff __P((struct vop_blkatoff_args *)); void ext2_blkfree __P((struct inode *, daddr_t, long)); daddr_t ext2_blkpref __P((struct inode *, daddr_t, int, daddr_t *, daddr_t)); int ext2_bmap __P((struct vop_bmap_args *)); -int ext2_fhtovp __P((struct mount *, struct fid *, struct mbuf *, - struct vnode **, int *, struct ucred **)); -int ext2_fsync __P((struct vop_fsync_args *)); int ext2_init __P((void)); -int ext2_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); -int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); -int ext2_mountroot __P((void)); -int ext2_read __P((struct vop_read_args *)); int ext2_reallocblks __P((struct vop_reallocblks_args *)); int ext2_reclaim __P((struct vop_reclaim_args *)); void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t)); -int ext2_statfs __P((struct mount *, struct statfs *, struct proc *)); -int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *)); int ext2_truncate __P((struct vop_truncate_args *)); -int ext2_unmount __P((struct mount *, int, struct proc *)); int ext2_update __P((struct vop_update_args *)); int ext2_valloc __P((struct vop_valloc_args *)); int ext2_vfree __P((struct vop_vfree_args *)); -int ext2_vget __P((struct mount *, ino_t, struct vnode **)); -int ext2_vptofh __P((struct vnode *, struct fid *)); -int ext2_write __P((struct vop_write_args *)); int ext2_lookup __P((struct vop_lookup_args *)); int ext2_readdir __P((struct vop_readdir_args *)); void ext2_print_dinode __P((struct dinode *)); @@ -111,9 +97,6 @@ unsigned long ext2_count_free __P((struct buf *map, unsigned int numchars)); void ext2_free_blocks (struct mount * mp, unsigned long block, unsigned long count); void ext2_free_inode (struct inode * inode); -int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); -int ext2_reload __P((struct mount *mountp, struct ucred *cred, - struct proc *p)); void ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di)); void ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei)); void mark_buffer_dirty __P((struct buf *bh)); diff --git a/sys/gnu/ext2fs/ext2_readwrite.c b/sys/gnu/ext2fs/ext2_readwrite.c index 8deb0b1..093f7fb 100644 --- a/sys/gnu/ext2fs/ext2_readwrite.c +++ b/sys/gnu/ext2fs/ext2_readwrite.c @@ -55,7 +55,7 @@ * Vnode op for reading. */ /* ARGSUSED */ -int +static int READ(ap) struct vop_read_args /* { struct vnode *a_vp; @@ -159,7 +159,7 @@ READ(ap) /* * Vnode op for writing. */ -int +static int WRITE(ap) struct vop_write_args /* { struct vnode *a_vp; diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index 09f4282..1054e49 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -72,9 +72,23 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_fs_sb.h> -int ext2_sbupdate __P((struct ufsmount *, int)); +static int ext2_fhtovp __P((struct mount *, struct fid *, struct mbuf *, + struct vnode **, int *, struct ucred **)); +static int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); +static int ext2_mount __P((struct mount *, + char *, caddr_t, struct nameidata *, struct proc *)); +static int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); +static int ext2_mountroot __P((void)); +static int ext2_reload __P((struct mount *mountp, struct ucred *cred, + struct proc *p)); +static int ext2_sbupdate __P((struct ufsmount *, int)); +static int ext2_statfs __P((struct mount *, struct statfs *, struct proc *)); +static int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *)); +static int ext2_unmount __P((struct mount *, int, struct proc *)); +static int ext2_vget __P((struct mount *, ino_t, struct vnode **)); +static int ext2_vptofh __P((struct vnode *, struct fid *)); -struct vfsops ext2fs_vfsops = { +static struct vfsops ext2fs_vfsops = { ext2_mount, ufs_start, /* empty function */ ext2_unmount, @@ -96,7 +110,7 @@ VFS_SET(ext2fs_vfsops, ext2fs, MOUNT_EXT2FS, 0); extern u_long nextgennumber; #ifdef __FreeBSD__ -int ext2fs_inode_hash_lock; +static int ext2fs_inode_hash_lock; #endif /* @@ -110,7 +124,7 @@ static int compute_sb_data __P((struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs)); -int +static int ext2_mountroot() { #if !defined(__FreeBSD__) @@ -173,7 +187,7 @@ ext2_mountroot() * * mount system call */ -int +static int ext2_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -431,7 +445,7 @@ static int compute_sb_data(devvp, es, fs) * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -int +static int ext2_reload(mountp, cred, p) register struct mount *mountp; struct ucred *cred; @@ -524,7 +538,7 @@ loop: /* * Common code for mount and mountroot */ -int +static int ext2_mountfs(devvp, mp, p) register struct vnode *devvp; struct mount *mp; @@ -651,7 +665,7 @@ out: /* * unmount system call */ -int +static int ext2_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -702,7 +716,7 @@ ext2_unmount(mp, mntflags, p) /* * Flush out all the files in a filesystem. */ -int +static int ext2_flushfiles(mp, flags, p) register struct mount *mp; int flags; @@ -743,7 +757,7 @@ ext2_flushfiles(mp, flags, p) * Get file system statistics. * taken from ext2/super.c ext2_statfs */ -int +static int ext2_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -798,7 +812,7 @@ ext2_statfs(mp, sbp, p) * * Note: we are always called with the filesystem marked `MPBUSY'. */ -int +static int ext2_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -876,7 +890,7 @@ loop: * return the inode locked. Detection and handling of mount points must be * done by the calling routine. */ -int +static int ext2_vget(mp, ino, vpp) struct mount *mp; ino_t ino; @@ -1034,7 +1048,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); * - check that the given client host has export rights and return * those rights via. exflagsp and credanonp */ -int +static int ext2_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) register struct mount *mp; struct fid *fhp; @@ -1058,7 +1072,7 @@ ext2_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle */ /* ARGSUSED */ -int +static int ext2_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; @@ -1077,7 +1091,7 @@ ext2_vptofh(vp, fhp) /* * Write a superblock and associated information back to disk. */ -int +static int ext2_sbupdate(mp, waitfor) struct ufsmount *mp; int waitfor; diff --git a/sys/gnu/ext2fs/ext2_vnops.c b/sys/gnu/ext2fs/ext2_vnops.c index 681097e..bdbafa0 100644 --- a/sys/gnu/ext2fs/ext2_vnops.c +++ b/sys/gnu/ext2fs/ext2_vnops.c @@ -79,9 +79,13 @@ #include <gnu/ext2fs/fs.h> #include <gnu/ext2fs/ext2_extern.h> +static int ext2_fsync __P((struct vop_fsync_args *)); +static int ext2_read __P((struct vop_read_args *)); +static int ext2_write __P((struct vop_write_args *)); + /* Global vfs data structures for ufs. */ vop_t **ext2_vnodeop_p; -struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { +static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)ext2_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)ufs_create }, /* create */ @@ -126,11 +130,11 @@ struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_vnodeop_opv_desc = +static struct vnodeopv_desc ext2fs_vnodeop_opv_desc = { &ext2_vnodeop_p, ext2_vnodeop_entries }; vop_t **ext2_specop_p; -struct vnodeopv_entry_desc ext2_specop_entries[] = { +static struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)spec_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)spec_create }, /* create */ @@ -175,11 +179,11 @@ struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_specop_opv_desc = +static struct vnodeopv_desc ext2fs_specop_opv_desc = { &ext2_specop_p, ext2_specop_entries }; vop_t **ext2_fifoop_p; -struct vnodeopv_entry_desc ext2_fifoop_entries[] = { +static struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)fifo_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)fifo_create }, /* create */ @@ -224,7 +228,7 @@ struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_fifoop_opv_desc = +static struct vnodeopv_desc ext2fs_fifoop_opv_desc = { &ext2_fifoop_p, ext2_fifoop_entries }; #if defined(__FreeBSD__) @@ -238,9 +242,9 @@ struct vnodeopv_desc ext2fs_fifoop_opv_desc = */ #ifdef DEBUG #include <sys/sysctl.h> -int doclusterread = 1; +static int doclusterread = 1; SYSCTL_INT(_debug, 11, doclusterread, CTLFLAG_RW, &doclusterread, 0, ""); -int doclusterwrite = 1; +static int doclusterwrite = 1; SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); #endif @@ -261,7 +265,7 @@ SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); * Synch an open file. */ /* ARGSUSED */ -int +static int ext2_fsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; diff --git a/sys/gnu/fs/ext2fs/ext2_extern.h b/sys/gnu/fs/ext2fs/ext2_extern.h index ea83912..5b9623f 100644 --- a/sys/gnu/fs/ext2fs/ext2_extern.h +++ b/sys/gnu/fs/ext2fs/ext2_extern.h @@ -65,28 +65,14 @@ int ext2_blkatoff __P((struct vop_blkatoff_args *)); void ext2_blkfree __P((struct inode *, daddr_t, long)); daddr_t ext2_blkpref __P((struct inode *, daddr_t, int, daddr_t *, daddr_t)); int ext2_bmap __P((struct vop_bmap_args *)); -int ext2_fhtovp __P((struct mount *, struct fid *, struct mbuf *, - struct vnode **, int *, struct ucred **)); -int ext2_fsync __P((struct vop_fsync_args *)); int ext2_init __P((void)); -int ext2_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); -int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); -int ext2_mountroot __P((void)); -int ext2_read __P((struct vop_read_args *)); int ext2_reallocblks __P((struct vop_reallocblks_args *)); int ext2_reclaim __P((struct vop_reclaim_args *)); void ext2_setblock __P((struct ext2_sb_info *, u_char *, daddr_t)); -int ext2_statfs __P((struct mount *, struct statfs *, struct proc *)); -int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *)); int ext2_truncate __P((struct vop_truncate_args *)); -int ext2_unmount __P((struct mount *, int, struct proc *)); int ext2_update __P((struct vop_update_args *)); int ext2_valloc __P((struct vop_valloc_args *)); int ext2_vfree __P((struct vop_vfree_args *)); -int ext2_vget __P((struct mount *, ino_t, struct vnode **)); -int ext2_vptofh __P((struct vnode *, struct fid *)); -int ext2_write __P((struct vop_write_args *)); int ext2_lookup __P((struct vop_lookup_args *)); int ext2_readdir __P((struct vop_readdir_args *)); void ext2_print_dinode __P((struct dinode *)); @@ -111,9 +97,6 @@ unsigned long ext2_count_free __P((struct buf *map, unsigned int numchars)); void ext2_free_blocks (struct mount * mp, unsigned long block, unsigned long count); void ext2_free_inode (struct inode * inode); -int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); -int ext2_reload __P((struct mount *mountp, struct ucred *cred, - struct proc *p)); void ext2_ei2di __P((struct ext2_inode *ei, struct dinode *di)); void ext2_di2ei __P((struct dinode *di, struct ext2_inode *ei)); void mark_buffer_dirty __P((struct buf *bh)); diff --git a/sys/gnu/fs/ext2fs/ext2_readwrite.c b/sys/gnu/fs/ext2fs/ext2_readwrite.c index 8deb0b1..093f7fb 100644 --- a/sys/gnu/fs/ext2fs/ext2_readwrite.c +++ b/sys/gnu/fs/ext2fs/ext2_readwrite.c @@ -55,7 +55,7 @@ * Vnode op for reading. */ /* ARGSUSED */ -int +static int READ(ap) struct vop_read_args /* { struct vnode *a_vp; @@ -159,7 +159,7 @@ READ(ap) /* * Vnode op for writing. */ -int +static int WRITE(ap) struct vop_write_args /* { struct vnode *a_vp; diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 09f4282..1054e49 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -72,9 +72,23 @@ #include <gnu/ext2fs/ext2_fs.h> #include <gnu/ext2fs/ext2_fs_sb.h> -int ext2_sbupdate __P((struct ufsmount *, int)); +static int ext2_fhtovp __P((struct mount *, struct fid *, struct mbuf *, + struct vnode **, int *, struct ucred **)); +static int ext2_flushfiles __P((struct mount *mp, int flags, struct proc *p)); +static int ext2_mount __P((struct mount *, + char *, caddr_t, struct nameidata *, struct proc *)); +static int ext2_mountfs __P((struct vnode *, struct mount *, struct proc *)); +static int ext2_mountroot __P((void)); +static int ext2_reload __P((struct mount *mountp, struct ucred *cred, + struct proc *p)); +static int ext2_sbupdate __P((struct ufsmount *, int)); +static int ext2_statfs __P((struct mount *, struct statfs *, struct proc *)); +static int ext2_sync __P((struct mount *, int, struct ucred *, struct proc *)); +static int ext2_unmount __P((struct mount *, int, struct proc *)); +static int ext2_vget __P((struct mount *, ino_t, struct vnode **)); +static int ext2_vptofh __P((struct vnode *, struct fid *)); -struct vfsops ext2fs_vfsops = { +static struct vfsops ext2fs_vfsops = { ext2_mount, ufs_start, /* empty function */ ext2_unmount, @@ -96,7 +110,7 @@ VFS_SET(ext2fs_vfsops, ext2fs, MOUNT_EXT2FS, 0); extern u_long nextgennumber; #ifdef __FreeBSD__ -int ext2fs_inode_hash_lock; +static int ext2fs_inode_hash_lock; #endif /* @@ -110,7 +124,7 @@ static int compute_sb_data __P((struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs)); -int +static int ext2_mountroot() { #if !defined(__FreeBSD__) @@ -173,7 +187,7 @@ ext2_mountroot() * * mount system call */ -int +static int ext2_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -431,7 +445,7 @@ static int compute_sb_data(devvp, es, fs) * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -int +static int ext2_reload(mountp, cred, p) register struct mount *mountp; struct ucred *cred; @@ -524,7 +538,7 @@ loop: /* * Common code for mount and mountroot */ -int +static int ext2_mountfs(devvp, mp, p) register struct vnode *devvp; struct mount *mp; @@ -651,7 +665,7 @@ out: /* * unmount system call */ -int +static int ext2_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -702,7 +716,7 @@ ext2_unmount(mp, mntflags, p) /* * Flush out all the files in a filesystem. */ -int +static int ext2_flushfiles(mp, flags, p) register struct mount *mp; int flags; @@ -743,7 +757,7 @@ ext2_flushfiles(mp, flags, p) * Get file system statistics. * taken from ext2/super.c ext2_statfs */ -int +static int ext2_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -798,7 +812,7 @@ ext2_statfs(mp, sbp, p) * * Note: we are always called with the filesystem marked `MPBUSY'. */ -int +static int ext2_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -876,7 +890,7 @@ loop: * return the inode locked. Detection and handling of mount points must be * done by the calling routine. */ -int +static int ext2_vget(mp, ino, vpp) struct mount *mp; ino_t ino; @@ -1034,7 +1048,7 @@ printf("ext2_vget(%d) dbn= %d ", ino, fsbtodb(fs, ino_to_fsba(fs, ino))); * - check that the given client host has export rights and return * those rights via. exflagsp and credanonp */ -int +static int ext2_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) register struct mount *mp; struct fid *fhp; @@ -1058,7 +1072,7 @@ ext2_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle */ /* ARGSUSED */ -int +static int ext2_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; @@ -1077,7 +1091,7 @@ ext2_vptofh(vp, fhp) /* * Write a superblock and associated information back to disk. */ -int +static int ext2_sbupdate(mp, waitfor) struct ufsmount *mp; int waitfor; diff --git a/sys/gnu/fs/ext2fs/ext2_vnops.c b/sys/gnu/fs/ext2fs/ext2_vnops.c index 681097e..bdbafa0 100644 --- a/sys/gnu/fs/ext2fs/ext2_vnops.c +++ b/sys/gnu/fs/ext2fs/ext2_vnops.c @@ -79,9 +79,13 @@ #include <gnu/ext2fs/fs.h> #include <gnu/ext2fs/ext2_extern.h> +static int ext2_fsync __P((struct vop_fsync_args *)); +static int ext2_read __P((struct vop_read_args *)); +static int ext2_write __P((struct vop_write_args *)); + /* Global vfs data structures for ufs. */ vop_t **ext2_vnodeop_p; -struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { +static struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)ext2_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)ufs_create }, /* create */ @@ -126,11 +130,11 @@ struct vnodeopv_entry_desc ext2_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_vnodeop_opv_desc = +static struct vnodeopv_desc ext2fs_vnodeop_opv_desc = { &ext2_vnodeop_p, ext2_vnodeop_entries }; vop_t **ext2_specop_p; -struct vnodeopv_entry_desc ext2_specop_entries[] = { +static struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)spec_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)spec_create }, /* create */ @@ -175,11 +179,11 @@ struct vnodeopv_entry_desc ext2_specop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_specop_opv_desc = +static struct vnodeopv_desc ext2fs_specop_opv_desc = { &ext2_specop_p, ext2_specop_entries }; vop_t **ext2_fifoop_p; -struct vnodeopv_entry_desc ext2_fifoop_entries[] = { +static struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)fifo_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)fifo_create }, /* create */ @@ -224,7 +228,7 @@ struct vnodeopv_entry_desc ext2_fifoop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ext2fs_fifoop_opv_desc = +static struct vnodeopv_desc ext2fs_fifoop_opv_desc = { &ext2_fifoop_p, ext2_fifoop_entries }; #if defined(__FreeBSD__) @@ -238,9 +242,9 @@ struct vnodeopv_desc ext2fs_fifoop_opv_desc = */ #ifdef DEBUG #include <sys/sysctl.h> -int doclusterread = 1; +static int doclusterread = 1; SYSCTL_INT(_debug, 11, doclusterread, CTLFLAG_RW, &doclusterread, 0, ""); -int doclusterwrite = 1; +static int doclusterwrite = 1; SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); #endif @@ -261,7 +265,7 @@ SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); * Synch an open file. */ /* ARGSUSED */ -int +static int ext2_fsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; diff --git a/sys/gnu/i386/fpemul/fpu_proto.h b/sys/gnu/i386/fpemul/fpu_proto.h index a6e9c02..c44a026 100644 --- a/sys/gnu/i386/fpemul/fpu_proto.h +++ b/sys/gnu/i386/fpemul/fpu_proto.h @@ -1,6 +1,6 @@ /* * - * $Id: fpu_proto.h,v 1.3 1995/03/16 18:11:11 bde Exp $ + * $Id: fpu_proto.h,v 1.4 1995/12/14 09:50:23 phk Exp $ * */ @@ -58,7 +58,6 @@ extern int math_emulate(struct trapframe * info); /* fpu_etc.c */ extern void fp_etc(void); /* fpu_trig.c */ -extern void convert_l2reg(long *arg, FPU_REG * dest); extern void trig_a(void); extern void trig_b(void); /* get_address.c */ diff --git a/sys/gnu/i386/fpemul/fpu_trig.c b/sys/gnu/i386/fpemul/fpu_trig.c index ca32f91..4dc8101 100644 --- a/sys/gnu/i386/fpemul/fpu_trig.c +++ b/sys/gnu/i386/fpemul/fpu_trig.c @@ -56,7 +56,7 @@ * W. Metzenthen June 1994. * * - * $Id: fpu_trig.c,v 1.3 1994/04/29 21:16:25 gclarkii Exp $ + * $Id: fpu_trig.c,v 1.4 1994/06/10 07:44:27 rich Exp $ * */ @@ -73,6 +73,8 @@ #include "reg_constant.h" #include "control_w.h" +static void convert_l2reg(long *arg, FPU_REG * dest); + static int trig_arg(FPU_REG * X) { @@ -104,7 +106,7 @@ trig_arg(FPU_REG * X) /* Convert a long to register */ -void +static void convert_l2reg(long *arg, FPU_REG * dest) { long num = *arg; diff --git a/sys/gnu/i386/isa/dgb.c b/sys/gnu/i386/isa/dgb.c index 6dd2a25..e96cbc7 100644 --- a/sys/gnu/i386/isa/dgb.c +++ b/sys/gnu/i386/isa/dgb.c @@ -1,5 +1,5 @@ /*- - * dgb.c $Id: dgb.c,v 1.12 1995/12/10 15:54:01 bde Exp $ + * dgb.c $Id: dgb.c,v 1.13 1995/12/10 20:54:21 bde Exp $ * * Digiboard driver. * @@ -37,6 +37,7 @@ #include <sys/file.h> #include <sys/uio.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/malloc.h> #include <sys/syslog.h> #include <sys/devconf.h> @@ -157,9 +158,9 @@ struct dgb_softc { }; -struct dgb_softc dgb_softc[NDGB]; -struct dgb_p dgb_ports[NDGBPORTS]; -struct tty dgb_tty[NDGBPORTS]; +static struct dgb_softc dgb_softc[NDGB]; +static struct dgb_p dgb_ports[NDGBPORTS]; +static struct tty dgb_tty[NDGBPORTS]; /* * The public functions in the com module ought to be declared in a com-driver @@ -167,8 +168,8 @@ struct tty dgb_tty[NDGBPORTS]; */ /* Interrupt handling entry points. */ -void dgbintr __P((int unit)); -void dgbpoll __P((void *unit_c)); +static void dgbintr __P((int unit)); +static void dgbpoll __P((void *unit_c)); /* Device switch entry points. */ #define dgbreset noreset @@ -235,11 +236,10 @@ static struct speedtab dgbspeedtab[] = { -1, -1 }; -#ifdef DEBUG - int dgbdebug=1; -#else - int dgbdebug=0; -#endif +static int dgbdebug=0; +SYSCTL_INT(_debug, OID_AUTO, dgb_debug, CTLFLAG_RW, + &dgbdebug, 0, ""); + static int polltimeout=0; @@ -1178,7 +1178,8 @@ dgbwrite(dev, uio, flag) return error; } -void dgbpoll(unit_c) +static void +dgbpoll(unit_c) void *unit_c; { int unit=(int)unit_c; @@ -1399,7 +1400,7 @@ void dgbpoll(unit_c) timeout(dgbpoll, unit_c, hz/25); } -void +static void dgbintr(unit) int unit; { diff --git a/sys/gnu/i386/isa/nic3008.c b/sys/gnu/i386/isa/nic3008.c index d6edea3..27bd01b 100644 --- a/sys/gnu/i386/isa/nic3008.c +++ b/sys/gnu/i386/isa/nic3008.c @@ -1,6 +1,6 @@ -static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.12 1995/12/08 11:12:45 julian Exp $"; +static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.13 1995/12/08 23:19:29 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.12 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.13 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char nic38_id[] = "@(#)$Id: nic3008.c,v 1.12 1995/12/08 11:12:45 juli * ******************************************************************************* * $Log: nic3008.c,v $ + * Revision 1.13 1995/12/08 23:19:29 phk + * Julian forgot to make the *devsw structures static. + * * Revision 1.12 1995/12/08 11:12:45 julian * Pass 3 of the great devsw changes * most devsw referenced functions are now static, as they are @@ -138,17 +141,17 @@ extern int Isdn_Appl, Isdn_Ctrl, Isdn_Typ; static old_spy= 0; -extern int nicattach __P((struct isa_device *is)); -extern int nicprobe __P((struct isa_device *is)); -extern int nic_accept __P((int cn, int an, int rea)); -extern int nic_connect __P((int cn, int ap, int b_channel, int inf_mask, +static int nicattach __P((struct isa_device *is)); +static int nicprobe __P((struct isa_device *is)); +static int nic_accept __P((int cn, int an, int rea)); +static int nic_connect __P((int cn, int ap, int b_channel, int inf_mask, int out_serv, int out_serv_add, int src_subadr, unsigned ad_len, char *dest_addr, int spv)); -extern int nic_disconnect __P((int cn, int rea)); -extern int nic_listen __P((int cn, int ap, int inf_mask, int subadr_mask, +static int nic_disconnect __P((int cn, int rea)); +static int nic_listen __P((int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv)); -extern int nic_output __P((int cn)); +static int nic_output __P((int cn)); static short bsintr; @@ -183,7 +186,7 @@ typedef struct char *more_b; } chan_t; -struct nic_softc +static struct nic_softc { dpr_type *sc_dpr; /* card RAM virtual memory base */ u_short sc_vector; /* interrupt vector */ @@ -414,7 +417,7 @@ badstate(mbx_type * mbx, int n, int mb, dpr_type *dpr) printf("\n"); } -int +static int nic_connect(int cn, int ap, int b_channel, int inf_mask, int out_serv ,int out_serv_add, int src_subadr, unsigned ad_len ,char *dest_addr, int spv) @@ -437,7 +440,7 @@ nic_connect(int cn, int ap, int b_channel, int inf_mask, int out_serv return (en_q_d(&nic_sc[isdn_ctrl[cn].unit], DD_CONN_REQ, MK_APPL(ap), ad_len + 10, buf)); } -int +static int nic_listen(int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv) { u_short sbuf[4]; @@ -448,7 +451,7 @@ nic_listen(int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv) return (en_q_d(&nic_sc[isdn_ctrl[cn].unit], DD_LISTEN_REQ, MK_APPL(ap), 8, (u_char *) sbuf)); } -int +static int nic_disconnect(int cn, int rea) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; @@ -486,7 +489,7 @@ nic_disconnect(int cn, int rea) return(err); } -int +static int nic_accept(int cn, int an, int rea) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; @@ -507,7 +510,7 @@ nic_accept(int cn, int an, int rea) return(sel_b2_prot_req(sc, C_CHAN(cn), chan->plci, &appl->dlpd)); } -int +static int nic_output(int cn) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; diff --git a/sys/gnu/i386/isa/nic3009.c b/sys/gnu/i386/isa/nic3009.c index e4f4109..75d0440 100644 --- a/sys/gnu/i386/isa/nic3009.c +++ b/sys/gnu/i386/isa/nic3009.c @@ -1,6 +1,6 @@ -static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.12 1995/12/08 11:12:47 julian Exp $"; +static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.13 1995/12/08 23:19:30 phk Exp $"; /******************************************************************************* - * II - Version 0.1 $Revision: 1.12 $ $State: Exp $ + * II - Version 0.1 $Revision: 1.13 $ $State: Exp $ * * Copyright 1994 Dietmar Friede ******************************************************************************* @@ -10,6 +10,9 @@ static char nic39_id[] = "@(#)$Id: nic3009.c,v 1.12 1995/12/08 11:12:47 juli * ******************************************************************************* * $Log: nic3009.c,v $ + * Revision 1.13 1995/12/08 23:19:30 phk + * Julian forgot to make the *devsw structures static. + * * Revision 1.12 1995/12/08 11:12:47 julian * Pass 3 of the great devsw changes * most devsw referenced functions are now static, as they are @@ -133,18 +136,18 @@ extern int Isdn_Appl, Isdn_Ctrl, Isdn_Typ; static old_spy= 0; -extern int nnicattach __P((struct isa_device *is)); -extern int nnicprobe __P((struct isa_device *is)); -extern int nnic_accept __P((int cn, int an, int rea)); -extern int nnic_connect __P((int cn, int ap, int b_channel, int inf_mask, +static int nnicattach __P((struct isa_device *is)); +static int nnicprobe __P((struct isa_device *is)); +static int nnic_accept __P((int cn, int an, int rea)); +static int nnic_connect __P((int cn, int ap, int b_channel, int inf_mask, int out_serv, int out_serv_add, int src_subadr, unsigned ad_len, char *dest_addr, int spv)); -extern int nnic_disconnect __P((int cn, int rea)); -extern int nnic_listen __P((int cn, int ap, int inf_mask, +static int nnic_disconnect __P((int cn, int rea)); +static int nnic_listen __P((int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv)); -extern int nnic_output __P((int cn)); -extern int nnic_state __P((int cn)); +static int nnic_output __P((int cn)); +static int nnic_state __P((int cn)); static d_open_t nnicopen; static d_close_t nnicclose; @@ -181,7 +184,7 @@ typedef struct char *more_b; } chan_t; -struct nnic_softc +static struct nnic_softc { dpr_type *sc_dpr; /* card RAM virtual memory base */ u_short sc_vector; /* interrupt vector */ @@ -213,7 +216,7 @@ static int sel_b3_prot_req __P((int unit, int mb, u_short pl, ncpd_t *ncpd)); static void up_intr __P((unsigned unit, struct nnic_softc *sc)); -int +static int nnicprobe(struct isa_device * is) { register struct nnic_softc *sc = &nnic_sc[is->id_unit & 127]; @@ -262,7 +265,7 @@ nnic_reset(struct nnic_softc *sc, int reset) /* * nnicattach() Install device */ -int +static int nnicattach(struct isa_device * is) { struct nnic_softc *sc; @@ -364,7 +367,7 @@ badstate(mbx_type * mbx, int n, int mb, dpr_type *dpr) printf("\n"); } -int +static int nnic_state(int cn) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; @@ -384,7 +387,7 @@ nnic_state(int cn) return(0); } -int +static int nnic_output(int cn) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; @@ -504,7 +507,7 @@ con_b3_resp(int unit, int mb, u_short ncci, u_short pl, u_char reject) return(en_q(unit, mb | BD_CONN_B3_RSP,0, pl, l, buf)); } -int +static int nnic_connect(int cn, int ap, int b_channel, int inf_mask, int out_serv ,int out_serv_add, int src_subadr, unsigned ad_len ,char *dest_addr, int spv) @@ -527,7 +530,7 @@ nnic_connect(int cn, int ap, int b_channel, int inf_mask, int out_serv return (en_q(isdn_ctrl[cn].unit, DD_CONN_REQ, 0, MK_APPL(ap), ad_len + 10, buf)); } -int +static int nnic_listen(int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv) { u_short sbuf[4]; @@ -540,7 +543,7 @@ nnic_listen(int cn, int ap, int inf_mask, int subadr_mask, int si_mask, int spv) return (en_q(isdn_ctrl[cn].unit, DD_LISTEN_REQ, 0, MK_APPL(ap), 8, (u_char *) sbuf)); } -int +static int nnic_disconnect(int cn, int rea) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; @@ -568,7 +571,7 @@ nnic_disconnect(int cn, int rea) return(err); } -int +static int nnic_accept(int cn, int an, int rea) { isdn_ctrl_t *ctrl = &isdn_ctrl[cn]; diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h index 58b1e97..03464f4 100644 --- a/sys/nfs/nfs.h +++ b/sys/nfs/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index 303cb22..4ae5efe 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.19 1995/12/03 10:02:52 bde Exp $ + * $Id: nfs_bio.c,v 1.20 1995/12/07 12:47:23 davidg Exp $ */ #include <sys/param.h> @@ -58,7 +58,7 @@ #include <nfs/nqnfs.h> #include <nfs/nfsnode.h> -extern struct buf *nfs_getcacheblk __P((struct vnode *vp, daddr_t bn, int size, +static struct buf *nfs_getcacheblk __P((struct vnode *vp, daddr_t bn, int size, struct proc *p)); extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; @@ -613,7 +613,7 @@ again: * interrupted by a signal for an interruptible mount point, return * NULL. */ -struct buf * +static struct buf * nfs_getcacheblk(vp, bn, size, p) struct vnode *vp; daddr_t bn; diff --git a/sys/nfs/nfs_common.c b/sys/nfs/nfs_common.c index d590ce4..46327bf 100644 --- a/sys/nfs/nfs_common.c +++ b/sys/nfs/nfs_common.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.24 1995/10/29 15:33:08 phk Exp $ + * $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $ */ /* @@ -93,8 +93,13 @@ u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false; /* And other global data */ static u_long nfs_xid = 0; -enum vtype nv2tov_type[8] = { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON }; -enum vtype nv3tov_type[8]={ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO }; +static enum vtype nv2tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON +}; +enum vtype nv3tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO +}; + int nfs_ticks; struct nfs_reqq nfs_reqq; diff --git a/sys/nfs/nfs_nqlease.c b/sys/nfs/nfs_nqlease.c index 6048727..5af47fb 100644 --- a/sys/nfs/nfs_nqlease.c +++ b/sys/nfs/nfs_nqlease.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_nqlease.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_nqlease.c,v 1.16 1995/10/29 15:32:55 phk Exp $ + * $Id: nfs_nqlease.c,v 1.17 1995/11/21 15:51:31 bde Exp $ */ /* @@ -78,24 +78,26 @@ time_t nqnfsstarttime = (time_t)0; int nqsrv_clockskew = NQ_CLOCKSKEW; int nqsrv_writeslack = NQ_WRITESLACK; int nqsrv_maxlease = NQ_MAXLEASE; -int nqsrv_maxnumlease = NQ_MAXNUMLEASE; +static int nqsrv_maxnumlease = NQ_MAXNUMLEASE; struct vop_lease_args; +static int nqsrv_cmpnam __P((struct nfssvc_sock *,struct mbuf *, + struct nqhost *)); extern void nqnfs_lease_check __P((struct vnode *vp, struct proc *p, struct ucred *cred, int flag)); extern void nqnfs_lease_updatetime __P((int deltat)); -extern int nqnfs_vacated __P((struct vnode *vp, struct ucred *cred)); +static int nqnfs_vacated __P((struct vnode *vp, struct ucred *cred)); extern int nqnfs_vop_lease_check __P((struct vop_lease_args *ap)); -extern void nqsrv_addhost __P((struct nqhost *lph, struct nfssvc_sock *slp, +static void nqsrv_addhost __P((struct nqhost *lph, struct nfssvc_sock *slp, struct mbuf *nam)); -extern void nqsrv_instimeq __P((struct nqlease *lp, u_long duration)); -extern void nqsrv_locklease __P((struct nqlease *lp)); -extern void nqsrv_send_eviction __P((struct vnode *vp, struct nqlease *lp, +static void nqsrv_instimeq __P((struct nqlease *lp, u_long duration)); +static void nqsrv_locklease __P((struct nqlease *lp)); +static void nqsrv_send_eviction __P((struct vnode *vp, struct nqlease *lp, struct nfssvc_sock *slp, struct mbuf *nam, struct ucred *cred)); -extern void nqsrv_unlocklease __P((struct nqlease *lp)); -extern void nqsrv_waitfor_expiry __P((struct nqlease *lp)); +static void nqsrv_unlocklease __P((struct nqlease *lp)); +static void nqsrv_waitfor_expiry __P((struct nqlease *lp)); /* * Signifies which rpcs can have piggybacked lease requests @@ -367,7 +369,7 @@ nqnfs_vop_lease_check(ap) /* * Add a host to an nqhost structure for a lease. */ -void +static void nqsrv_addhost(lph, slp, nam) register struct nqhost *lph; struct nfssvc_sock *slp; @@ -395,7 +397,7 @@ nqsrv_addhost(lph, slp, nam) /* * Update the lease expiry time and position it in the timer queue correctly. */ -void +static void nqsrv_instimeq(lp, duration) register struct nqlease *lp; u_long duration; @@ -434,7 +436,7 @@ nqsrv_instimeq(lp, duration) * This is somewhat messy due to the union in the nqhost structure. * The local host is indicated by the special value of NQLOCALSLP for slp. */ -int +static int nqsrv_cmpnam(slp, nam, lph) register struct nfssvc_sock *slp; struct mbuf *nam; @@ -475,7 +477,7 @@ nqsrv_cmpnam(slp, nam, lph) /* * Send out eviction notice messages to all other hosts for the lease. */ -void +static void nqsrv_send_eviction(vp, lp, slp, nam, cred) struct vnode *vp; register struct nqlease *lp; @@ -586,7 +588,7 @@ nextone: * This will occur when all clients have sent "vacated" messages to * this server OR when it expires do to timeout. */ -void +static void nqsrv_waitfor_expiry(lp) register struct nqlease *lp; { @@ -893,7 +895,7 @@ nqnfs_getlease(vp, rwflag, cred, p) /* * Client vacated message function. */ -int +static int nqnfs_vacated(vp, cred) register struct vnode *vp; struct ucred *cred; @@ -1205,7 +1207,7 @@ nqnfs_lease_updatetime(deltat) /* * Lock a server lease. */ -void +static void nqsrv_locklease(lp) struct nqlease *lp; { @@ -1221,7 +1223,7 @@ nqsrv_locklease(lp) /* * Unlock a server lease. */ -void +static void nqsrv_unlocklease(lp) struct nqlease *lp; { diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 0173c99..3fc96a4 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.25 1995/10/29 15:32:59 phk Exp $ + * $Id: nfs_serv.c,v 1.26 1995/12/07 12:47:25 davidg Exp $ */ /* @@ -70,6 +70,7 @@ #include <sys/dirent.h> #include <sys/stat.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <ufs/ufs/dir.h> #include <vm/vm.h> @@ -95,11 +96,14 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000; -#ifdef NFS_ASYNC -int nfs_async = 1; -#else int nfs_async; -#endif +SYSCTL_INT(_fs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, ""); + + +static int nfsrv_access __P((struct vnode *,int,struct ucred *,int, + struct proc *)); +static void nfsrvw_coalesce __P((struct nfsrv_descript *, + struct nfsrv_descript *)); /* * nfs v3 access service @@ -1198,7 +1202,7 @@ loop1: * - put nfsd on owp's nd_coalesce list * NB: Must be called at splsoftclock(). */ -void +static void nfsrvw_coalesce(owp, nfsd) register struct nfsrv_descript *owp; register struct nfsrv_descript *nfsd; @@ -3390,7 +3394,7 @@ nfsrv_noop(nfsd, slp, procp, mrq) * this because it opens a security hole, but since the nfs server opens * a security hole the size of a barn door anyhow, what the heck. */ -int +static int nfsrv_access(vp, flags, cred, rdonly, p) register struct vnode *vp; int flags; diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index f497afe..0059f5e 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.11 1995/11/21 15:51:32 bde Exp $ + * $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $ */ /* @@ -134,10 +134,14 @@ static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, }; int nfsrtton = 0; struct nfsrtt nfsrtt; -extern void nfs_realign __P((struct mbuf *m, int hsiz)); -extern int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, +static int nfs_msg __P((struct proc *,char *,char *)); +static int nfs_rcvlock __P((struct nfsreq *)); +static void nfs_rcvunlock __P((int *flagp)); +static void nfs_realign __P((struct mbuf *m, int hsiz)); +static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, struct mbuf **mp)); -extern int nfs_reconnect __P((struct nfsreq *rep)); +static int nfs_reconnect __P((struct nfsreq *rep)); +static int nfsrv_getstream __P((struct nfssvc_sock *,int)); int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, @@ -317,7 +321,7 @@ bad: * If this fails the mount point is DEAD! * nb: Must be called with the nfs_sndlock() set on the mount point. */ -int +static int nfs_reconnect(rep) register struct nfsreq *rep; { @@ -441,7 +445,7 @@ nfs_send(so, nam, top, rep) * For SOCK_STREAM we must be very careful to read an entire record once * we have read any of it, even if the system call has been interrupted. */ -int +static int nfs_receive(rep, aname, mp) register struct nfsreq *rep; struct mbuf **aname; @@ -1456,7 +1460,7 @@ nfs_sndunlock(flagp) } } -int +static int nfs_rcvlock(rep) register struct nfsreq *rep; { @@ -1485,7 +1489,7 @@ nfs_rcvlock(rep) /* * Unlock the stream socket for others. */ -void +static void nfs_rcvunlock(flagp) register int *flagp; { @@ -1503,7 +1507,7 @@ nfs_rcvunlock(flagp) * Check for badly aligned mbuf data areas and * realign data in an mbuf list by copying the data areas up, as required. */ -void +static void nfs_realign(m, hsiz) register struct mbuf *m; int hsiz; @@ -1708,7 +1712,7 @@ dorecs: * stream socket. The "waitflag" argument indicates whether or not it * can sleep. */ -int +static int nfsrv_getstream(slp, waitflag) register struct nfssvc_sock *slp; int waitflag; @@ -2142,7 +2146,7 @@ nfsrv_wakenfsd(slp) nfsd_head_flag |= NFSD_CHECKSLP; } -int +static int nfs_msg(p, server, msg) struct proc *p; char *server, *msg; diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index acdce0d..574729c 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_srvcache.c 8.1 (Berkeley) 6/10/93 - * $Id: nfs_srvcache.c,v 1.5 1994/10/17 17:47:36 phk Exp $ + * $Id: nfs_srvcache.c,v 1.6 1995/06/27 11:06:43 dfr Exp $ */ /* @@ -66,7 +66,8 @@ extern struct nfsstats nfsstats; extern int nfsv2_procid[NFS_NPROCS]; -long numnfsrvcache, desirednfsrvcache = NFSRVCACHESIZ; +long numnfsrvcache; +static long desirednfsrvcache = NFSRVCACHESIZ; #define NFSRCHASH(xid) \ (&nfsrvhashtbl[((xid) + ((xid) >> 24)) & nfsrvhash]) @@ -83,7 +84,7 @@ u_long nfsrvhash; /* * Static array that defines which nfs rpc's are nonidempotent */ -int nonidempotent[NFS_NPROCS] = { +static int nonidempotent[NFS_NPROCS] = { FALSE, FALSE, TRUE, diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index d590ce4..46327bf 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.24 1995/10/29 15:33:08 phk Exp $ + * $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $ */ /* @@ -93,8 +93,13 @@ u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false; /* And other global data */ static u_long nfs_xid = 0; -enum vtype nv2tov_type[8] = { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON }; -enum vtype nv3tov_type[8]={ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO }; +static enum vtype nv2tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON +}; +enum vtype nv3tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO +}; + int nfs_ticks; struct nfs_reqq nfs_reqq; diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 44789f7..68d7dc1 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.10 1995/11/21 15:51:34 bde Exp $ + * $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $ */ #include <sys/param.h> @@ -86,14 +86,14 @@ extern int nfsrtton; extern struct nfsstats nfsstats; extern int nfsrvw_procrastinate; struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock; -int nuidhash_max = NFS_MAXUIDHASH; +static int nuidhash_max = NFS_MAXUIDHASH; static int nfs_numnfsd = 0; int nfsd_waiting = 0; static int notstarted = 1; static int modify_flag = 0; static struct nfsdrt nfsdrt; -extern void nfsrv_zapsock __P((struct nfssvc_sock *slp)); +static void nfsrv_zapsock __P((struct nfssvc_sock *slp)); #define TRUE 1 #define FALSE 0 @@ -102,6 +102,9 @@ static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd, int cacherep)); +static int nfssvc_addsock __P((struct file *,struct mbuf *)); +static int nfssvc_iod __P((struct proc *)); +static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); /* * NFS server system calls @@ -332,7 +335,7 @@ nfssvc(p, uap, retval) /* * Adds a socket to the list for servicing by nfsds. */ -int +static int nfssvc_addsock(fp, mynam) struct file *fp; struct mbuf *mynam; @@ -422,7 +425,7 @@ nfssvc_addsock(fp, mynam) * Called by nfssvc() for nfsds. Just loops around servicing rpc requests * until it is killed by a signal. */ -int +static int nfssvc_nfsd(nsd, argp, p) struct nfsd_srvargs *nsd; caddr_t argp; @@ -705,7 +708,7 @@ done: * They do read-ahead and write-behind operations on the block I/O cache. * Never returns unless it fails or gets killed. */ -int +static int nfssvc_iod(p) struct proc *p; { @@ -788,7 +791,7 @@ nfssvc_iod(p) * will stop using it and clear ns_flag at the end so that it will not be * reassigned during cleanup. */ -void +static void nfsrv_zapsock(slp) register struct nfssvc_sock *slp; { diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 9387aa8..77ec917 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.22 1995/12/03 10:03:12 bde Exp $ + * $Id: nfs_vfsops.c,v 1.23 1995/12/07 12:47:27 davidg Exp $ */ #include <sys/param.h> @@ -45,6 +45,7 @@ #include <sys/namei.h> #include <sys/vnode.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/mount.h> #include <sys/buf.h> #include <sys/mbuf.h> @@ -75,18 +76,37 @@ extern int nfs_mountroot __P((void)); extern int nfs_ticks; struct nfsstats nfsstats; +SYSCTL_NODE(_fs, MOUNT_NFS, nfs, CTLFLAG_RW, 0, "NFS filesystem"); +SYSCTL_STRUCT(_fs_nfs, OID_AUTO, nfsstats, CTLFLAG_RD, + &nfsstats, nfsstats, ""); static int nfs_iosize __P((struct nfsmount *nmp)); -static int nfs_sysctl(int *, u_int, void *, size_t *, void *, size_t, - struct proc *); +static int mountnfs __P((struct nfs_args *,struct mount *, + struct mbuf *,char *,char *,struct vnode **)); +static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data, + struct nameidata *ndp, struct proc *p)); +static int nfs_start __P(( struct mount *mp, int flags, + struct proc *p)); +static int nfs_unmount __P(( struct mount *mp, int mntflags, + struct proc *p)); +static int nfs_root __P(( struct mount *mp, struct vnode **vpp)); +static int nfs_quotactl __P(( struct mount *mp, int cmds, uid_t uid, + caddr_t arg, struct proc *p)); +static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp, + struct proc *p)); +static int nfs_sync __P(( struct mount *mp, int waitfor, + struct ucred *cred, struct proc *p)); +static int nfs_vptofh __P(( struct vnode *vp, struct fid *fhp)); +static int nfs_fhtovp __P((struct mount *mp, struct fid *fhp, + struct mbuf *nam, struct vnode **vpp, + int *exflagsp, struct ucred **credanonp)); +static int nfs_vget __P((struct mount *, ino_t, struct vnode **)); + /* * nfs vfs operations. */ -struct vfsops nfs_vfsops = { -#ifdef __NetBSD__ - MOUNT_NFS, -#endif +static struct vfsops nfs_vfsops = { nfs_mount, nfs_start, nfs_unmount, @@ -98,13 +118,8 @@ struct vfsops nfs_vfsops = { nfs_fhtovp, nfs_vptofh, nfs_init, -#ifdef __FreeBSD__ - nfs_sysctl -#endif }; -#ifdef __FreeBSD__ VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, VFCF_NETWORK); -#endif /* * This structure must be filled in by a primary bootstrap or bootstrap @@ -490,7 +505,7 @@ nfs_mountdiskless(path, which, mountflag, sin, args, vpp) * an error after that means that I have to release the mbuf. */ /* ARGSUSED */ -int +static int nfs_mount(mp, path, data, ndp, p) struct mount *mp; char *path; @@ -532,7 +547,7 @@ nfs_mount(mp, path, data, ndp, p) /* * Common code for mount and mountroot */ -int +static int mountnfs(argp, mp, nam, pth, hst, vpp) register struct nfs_args *argp; register struct mount *mp; @@ -716,7 +731,7 @@ bad: /* * unmount system call */ -int +static int nfs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -793,7 +808,7 @@ nfs_unmount(mp, mntflags, p) /* * Return root of a filesystem */ -int +static int nfs_root(mp, vpp) struct mount *mp; struct vnode **vpp; @@ -822,7 +837,7 @@ extern int syncprt; * Flush out the buffer cache */ /* ARGSUSED */ -int +static int nfs_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -862,7 +877,7 @@ loop: * Currently unsupported. */ /* ARGSUSED */ -int +static int nfs_vget(mp, ino, vpp) struct mount *mp; ino_t ino; @@ -876,7 +891,7 @@ nfs_vget(mp, ino, vpp) * At this point, this should never happen */ /* ARGSUSED */ -int +static int nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) register struct mount *mp; struct fid *fhp; @@ -893,7 +908,7 @@ nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle, should never happen either */ /* ARGSUSED */ -int +static int nfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; @@ -906,7 +921,7 @@ nfs_vptofh(vp, fhp) * Vfs start routine, a no-op. */ /* ARGSUSED */ -int +static int nfs_start(mp, flags, p) struct mount *mp; int flags; @@ -920,7 +935,7 @@ nfs_start(mp, flags, p) * Do operations associated with quotas, not supported */ /* ARGSUSED */ -int +static int nfs_quotactl(mp, cmd, uid, arg, p) struct mount *mp; int cmd; @@ -932,46 +947,3 @@ nfs_quotactl(mp, cmd, uid, arg, p) return (EOPNOTSUPP); } -/* - * Do that sysctl thang... - */ -static int -nfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, - size_t newlen, struct proc *p) -{ - int rv; - - /* - * All names at this level are terminal. - */ - if(namelen > 1) - return ENOTDIR; /* overloaded */ - - switch(name[0]) { - case NFS_NFSSTATS: - if(!oldp) { - *oldlenp = sizeof nfsstats; - return 0; - } - - if(*oldlenp < sizeof nfsstats) { - *oldlenp = sizeof nfsstats; - return ENOMEM; - } - - rv = copyout(&nfsstats, oldp, sizeof nfsstats); - if(rv) return rv; - - if(newp && newlen != sizeof nfsstats) - return EINVAL; - - if(newp) { - return copyin(newp, &nfsstats, sizeof nfsstats); - } - return 0; - - default: - return EOPNOTSUPP; - } -} - diff --git a/sys/nfs/nfsmount.h b/sys/nfs/nfsmount.h index 5bfcab0..1bd71c5 100644 --- a/sys/nfs/nfsmount.h +++ b/sys/nfs/nfsmount.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsmount.h 8.1 (Berkeley) 6/10/93 - * $Id: nfsmount.h,v 1.5 1995/06/27 11:06:56 dfr Exp $ + * $Id: nfsmount.h,v 1.6 1995/11/21 12:54:40 bde Exp $ */ #ifndef _NFS_NFSMOUNT_H_ @@ -91,51 +91,4 @@ struct nfsmount { #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) #endif /* KERNEL */ -/* - * Prototypes for NFS mount operations - */ -int nfs_mount __P(( - struct mount *mp, - char *path, - caddr_t data, - struct nameidata *ndp, - struct proc *p)); -int nfs_start __P(( - struct mount *mp, - int flags, - struct proc *p)); -int nfs_unmount __P(( - struct mount *mp, - int mntflags, - struct proc *p)); -int nfs_root __P(( - struct mount *mp, - struct vnode **vpp)); -int nfs_quotactl __P(( - struct mount *mp, - int cmds, - uid_t uid, - caddr_t arg, - struct proc *p)); -int nfs_statfs __P(( - struct mount *mp, - struct statfs *sbp, - struct proc *p)); -int nfs_sync __P(( - struct mount *mp, - int waitfor, - struct ucred *cred, - struct proc *p)); -int nfs_fhtovp __P(( - struct mount *mp, - struct fid *fhp, - struct mbuf *nam, - struct vnode **vpp, - int *exflagsp, - struct ucred **credanonp)); -int nfs_vptofh __P(( - struct vnode *vp, - struct fid *fhp)); -int nfs_init __P((void)); - #endif diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h index 02cc1c3..49e96da 100644 --- a/sys/nfs/nfsnode.h +++ b/sys/nfs/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.4 (Berkeley) 2/13/94 - * $Id: nfsnode.h,v 1.13 1995/11/06 00:36:03 bde Exp $ + * $Id: nfsnode.h,v 1.14 1995/11/09 08:16:59 bde Exp $ */ #ifndef _NFS_NFSNODE_H_ @@ -179,7 +179,6 @@ int nfs_reclaim __P((struct vop_reclaim_args *)); int nfs_lock __P((struct vop_lock_args *)); int nfs_unlock __P((struct vop_unlock_args *)); int nfs_islocked __P((struct vop_islocked_args *)); -int nfs_vget __P((struct mount *, ino_t, struct vnode **)); #define nfs_reallocblks \ ((int (*) __P((struct vop_reallocblks_args *)))eopnotsupp) diff --git a/sys/nfs/nqnfs.h b/sys/nfs/nqnfs.h index 58fdc4c..6a603f9 100644 --- a/sys/nfs/nqnfs.h +++ b/sys/nfs/nqnfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nqnfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nqnfs.h,v 1.8 1995/07/29 11:42:23 bde Exp $ + * $Id: nqnfs.h,v 1.9 1995/11/21 12:54:42 bde Exp $ */ #ifndef _NFS_NQNFS_H_ @@ -200,7 +200,6 @@ extern u_long nqfhhash; #if defined(KERNEL) || defined(_KERNEL) void nqnfs_lease_check __P((struct vnode *, struct proc *, struct ucred *, int)); void nqnfs_lease_updatetime __P((int)); -int nqsrv_cmpnam __P((struct nfssvc_sock *,struct mbuf *,struct nqhost *)); int nqsrv_getlease __P((struct vnode *,u_long *,int,struct nfssvc_sock *,struct proc *,struct mbuf *,int *,u_quad_t *,struct ucred *)); int nqnfs_getlease __P((struct vnode *,int,struct ucred *,struct proc *)); int nqnfs_callback __P((struct nfsmount *,struct mbuf *,struct mbuf *,caddr_t)); diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h index 58b1e97..03464f4 100644 --- a/sys/nfsclient/nfs.h +++ b/sys/nfsclient/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c index 303cb22..4ae5efe 100644 --- a/sys/nfsclient/nfs_bio.c +++ b/sys/nfsclient/nfs_bio.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_bio.c 8.5 (Berkeley) 1/4/94 - * $Id: nfs_bio.c,v 1.19 1995/12/03 10:02:52 bde Exp $ + * $Id: nfs_bio.c,v 1.20 1995/12/07 12:47:23 davidg Exp $ */ #include <sys/param.h> @@ -58,7 +58,7 @@ #include <nfs/nqnfs.h> #include <nfs/nfsnode.h> -extern struct buf *nfs_getcacheblk __P((struct vnode *vp, daddr_t bn, int size, +static struct buf *nfs_getcacheblk __P((struct vnode *vp, daddr_t bn, int size, struct proc *p)); extern struct proc *nfs_iodwant[NFS_MAXASYNCDAEMON]; @@ -613,7 +613,7 @@ again: * interrupted by a signal for an interruptible mount point, return * NULL. */ -struct buf * +static struct buf * nfs_getcacheblk(vp, bn, size, p) struct vnode *vp; daddr_t bn; diff --git a/sys/nfsclient/nfs_nfsiod.c b/sys/nfsclient/nfs_nfsiod.c index 44789f7..68d7dc1 100644 --- a/sys/nfsclient/nfs_nfsiod.c +++ b/sys/nfsclient/nfs_nfsiod.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.10 1995/11/21 15:51:34 bde Exp $ + * $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $ */ #include <sys/param.h> @@ -86,14 +86,14 @@ extern int nfsrtton; extern struct nfsstats nfsstats; extern int nfsrvw_procrastinate; struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock; -int nuidhash_max = NFS_MAXUIDHASH; +static int nuidhash_max = NFS_MAXUIDHASH; static int nfs_numnfsd = 0; int nfsd_waiting = 0; static int notstarted = 1; static int modify_flag = 0; static struct nfsdrt nfsdrt; -extern void nfsrv_zapsock __P((struct nfssvc_sock *slp)); +static void nfsrv_zapsock __P((struct nfssvc_sock *slp)); #define TRUE 1 #define FALSE 0 @@ -102,6 +102,9 @@ static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd, int cacherep)); +static int nfssvc_addsock __P((struct file *,struct mbuf *)); +static int nfssvc_iod __P((struct proc *)); +static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); /* * NFS server system calls @@ -332,7 +335,7 @@ nfssvc(p, uap, retval) /* * Adds a socket to the list for servicing by nfsds. */ -int +static int nfssvc_addsock(fp, mynam) struct file *fp; struct mbuf *mynam; @@ -422,7 +425,7 @@ nfssvc_addsock(fp, mynam) * Called by nfssvc() for nfsds. Just loops around servicing rpc requests * until it is killed by a signal. */ -int +static int nfssvc_nfsd(nsd, argp, p) struct nfsd_srvargs *nsd; caddr_t argp; @@ -705,7 +708,7 @@ done: * They do read-ahead and write-behind operations on the block I/O cache. * Never returns unless it fails or gets killed. */ -int +static int nfssvc_iod(p) struct proc *p; { @@ -788,7 +791,7 @@ nfssvc_iod(p) * will stop using it and clear ns_flag at the end so that it will not be * reassigned during cleanup. */ -void +static void nfsrv_zapsock(slp) register struct nfssvc_sock *slp; { diff --git a/sys/nfsclient/nfs_socket.c b/sys/nfsclient/nfs_socket.c index f497afe..0059f5e 100644 --- a/sys/nfsclient/nfs_socket.c +++ b/sys/nfsclient/nfs_socket.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.11 1995/11/21 15:51:32 bde Exp $ + * $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $ */ /* @@ -134,10 +134,14 @@ static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, }; int nfsrtton = 0; struct nfsrtt nfsrtt; -extern void nfs_realign __P((struct mbuf *m, int hsiz)); -extern int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, +static int nfs_msg __P((struct proc *,char *,char *)); +static int nfs_rcvlock __P((struct nfsreq *)); +static void nfs_rcvunlock __P((int *flagp)); +static void nfs_realign __P((struct mbuf *m, int hsiz)); +static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, struct mbuf **mp)); -extern int nfs_reconnect __P((struct nfsreq *rep)); +static int nfs_reconnect __P((struct nfsreq *rep)); +static int nfsrv_getstream __P((struct nfssvc_sock *,int)); int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, @@ -317,7 +321,7 @@ bad: * If this fails the mount point is DEAD! * nb: Must be called with the nfs_sndlock() set on the mount point. */ -int +static int nfs_reconnect(rep) register struct nfsreq *rep; { @@ -441,7 +445,7 @@ nfs_send(so, nam, top, rep) * For SOCK_STREAM we must be very careful to read an entire record once * we have read any of it, even if the system call has been interrupted. */ -int +static int nfs_receive(rep, aname, mp) register struct nfsreq *rep; struct mbuf **aname; @@ -1456,7 +1460,7 @@ nfs_sndunlock(flagp) } } -int +static int nfs_rcvlock(rep) register struct nfsreq *rep; { @@ -1485,7 +1489,7 @@ nfs_rcvlock(rep) /* * Unlock the stream socket for others. */ -void +static void nfs_rcvunlock(flagp) register int *flagp; { @@ -1503,7 +1507,7 @@ nfs_rcvunlock(flagp) * Check for badly aligned mbuf data areas and * realign data in an mbuf list by copying the data areas up, as required. */ -void +static void nfs_realign(m, hsiz) register struct mbuf *m; int hsiz; @@ -1708,7 +1712,7 @@ dorecs: * stream socket. The "waitflag" argument indicates whether or not it * can sleep. */ -int +static int nfsrv_getstream(slp, waitflag) register struct nfssvc_sock *slp; int waitflag; @@ -2142,7 +2146,7 @@ nfsrv_wakenfsd(slp) nfsd_head_flag |= NFSD_CHECKSLP; } -int +static int nfs_msg(p, server, msg) struct proc *p; char *server, *msg; diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c index d590ce4..46327bf 100644 --- a/sys/nfsclient/nfs_subs.c +++ b/sys/nfsclient/nfs_subs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.24 1995/10/29 15:33:08 phk Exp $ + * $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $ */ /* @@ -93,8 +93,13 @@ u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false; /* And other global data */ static u_long nfs_xid = 0; -enum vtype nv2tov_type[8] = { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON }; -enum vtype nv3tov_type[8]={ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO }; +static enum vtype nv2tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON +}; +enum vtype nv3tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO +}; + int nfs_ticks; struct nfs_reqq nfs_reqq; diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 9387aa8..77ec917 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_vfsops.c,v 1.22 1995/12/03 10:03:12 bde Exp $ + * $Id: nfs_vfsops.c,v 1.23 1995/12/07 12:47:27 davidg Exp $ */ #include <sys/param.h> @@ -45,6 +45,7 @@ #include <sys/namei.h> #include <sys/vnode.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/mount.h> #include <sys/buf.h> #include <sys/mbuf.h> @@ -75,18 +76,37 @@ extern int nfs_mountroot __P((void)); extern int nfs_ticks; struct nfsstats nfsstats; +SYSCTL_NODE(_fs, MOUNT_NFS, nfs, CTLFLAG_RW, 0, "NFS filesystem"); +SYSCTL_STRUCT(_fs_nfs, OID_AUTO, nfsstats, CTLFLAG_RD, + &nfsstats, nfsstats, ""); static int nfs_iosize __P((struct nfsmount *nmp)); -static int nfs_sysctl(int *, u_int, void *, size_t *, void *, size_t, - struct proc *); +static int mountnfs __P((struct nfs_args *,struct mount *, + struct mbuf *,char *,char *,struct vnode **)); +static int nfs_mount __P(( struct mount *mp, char *path, caddr_t data, + struct nameidata *ndp, struct proc *p)); +static int nfs_start __P(( struct mount *mp, int flags, + struct proc *p)); +static int nfs_unmount __P(( struct mount *mp, int mntflags, + struct proc *p)); +static int nfs_root __P(( struct mount *mp, struct vnode **vpp)); +static int nfs_quotactl __P(( struct mount *mp, int cmds, uid_t uid, + caddr_t arg, struct proc *p)); +static int nfs_statfs __P(( struct mount *mp, struct statfs *sbp, + struct proc *p)); +static int nfs_sync __P(( struct mount *mp, int waitfor, + struct ucred *cred, struct proc *p)); +static int nfs_vptofh __P(( struct vnode *vp, struct fid *fhp)); +static int nfs_fhtovp __P((struct mount *mp, struct fid *fhp, + struct mbuf *nam, struct vnode **vpp, + int *exflagsp, struct ucred **credanonp)); +static int nfs_vget __P((struct mount *, ino_t, struct vnode **)); + /* * nfs vfs operations. */ -struct vfsops nfs_vfsops = { -#ifdef __NetBSD__ - MOUNT_NFS, -#endif +static struct vfsops nfs_vfsops = { nfs_mount, nfs_start, nfs_unmount, @@ -98,13 +118,8 @@ struct vfsops nfs_vfsops = { nfs_fhtovp, nfs_vptofh, nfs_init, -#ifdef __FreeBSD__ - nfs_sysctl -#endif }; -#ifdef __FreeBSD__ VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, VFCF_NETWORK); -#endif /* * This structure must be filled in by a primary bootstrap or bootstrap @@ -490,7 +505,7 @@ nfs_mountdiskless(path, which, mountflag, sin, args, vpp) * an error after that means that I have to release the mbuf. */ /* ARGSUSED */ -int +static int nfs_mount(mp, path, data, ndp, p) struct mount *mp; char *path; @@ -532,7 +547,7 @@ nfs_mount(mp, path, data, ndp, p) /* * Common code for mount and mountroot */ -int +static int mountnfs(argp, mp, nam, pth, hst, vpp) register struct nfs_args *argp; register struct mount *mp; @@ -716,7 +731,7 @@ bad: /* * unmount system call */ -int +static int nfs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -793,7 +808,7 @@ nfs_unmount(mp, mntflags, p) /* * Return root of a filesystem */ -int +static int nfs_root(mp, vpp) struct mount *mp; struct vnode **vpp; @@ -822,7 +837,7 @@ extern int syncprt; * Flush out the buffer cache */ /* ARGSUSED */ -int +static int nfs_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -862,7 +877,7 @@ loop: * Currently unsupported. */ /* ARGSUSED */ -int +static int nfs_vget(mp, ino, vpp) struct mount *mp; ino_t ino; @@ -876,7 +891,7 @@ nfs_vget(mp, ino, vpp) * At this point, this should never happen */ /* ARGSUSED */ -int +static int nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) register struct mount *mp; struct fid *fhp; @@ -893,7 +908,7 @@ nfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle, should never happen either */ /* ARGSUSED */ -int +static int nfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; @@ -906,7 +921,7 @@ nfs_vptofh(vp, fhp) * Vfs start routine, a no-op. */ /* ARGSUSED */ -int +static int nfs_start(mp, flags, p) struct mount *mp; int flags; @@ -920,7 +935,7 @@ nfs_start(mp, flags, p) * Do operations associated with quotas, not supported */ /* ARGSUSED */ -int +static int nfs_quotactl(mp, cmd, uid, arg, p) struct mount *mp; int cmd; @@ -932,46 +947,3 @@ nfs_quotactl(mp, cmd, uid, arg, p) return (EOPNOTSUPP); } -/* - * Do that sysctl thang... - */ -static int -nfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp, - size_t newlen, struct proc *p) -{ - int rv; - - /* - * All names at this level are terminal. - */ - if(namelen > 1) - return ENOTDIR; /* overloaded */ - - switch(name[0]) { - case NFS_NFSSTATS: - if(!oldp) { - *oldlenp = sizeof nfsstats; - return 0; - } - - if(*oldlenp < sizeof nfsstats) { - *oldlenp = sizeof nfsstats; - return ENOMEM; - } - - rv = copyout(&nfsstats, oldp, sizeof nfsstats); - if(rv) return rv; - - if(newp && newlen != sizeof nfsstats) - return EINVAL; - - if(newp) { - return copyin(newp, &nfsstats, sizeof nfsstats); - } - return 0; - - default: - return EOPNOTSUPP; - } -} - diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h index 58b1e97..03464f4 100644 --- a/sys/nfsclient/nfsargs.h +++ b/sys/nfsclient/nfsargs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/nfsclient/nfsmount.h b/sys/nfsclient/nfsmount.h index 5bfcab0..1bd71c5 100644 --- a/sys/nfsclient/nfsmount.h +++ b/sys/nfsclient/nfsmount.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsmount.h 8.1 (Berkeley) 6/10/93 - * $Id: nfsmount.h,v 1.5 1995/06/27 11:06:56 dfr Exp $ + * $Id: nfsmount.h,v 1.6 1995/11/21 12:54:40 bde Exp $ */ #ifndef _NFS_NFSMOUNT_H_ @@ -91,51 +91,4 @@ struct nfsmount { #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) #endif /* KERNEL */ -/* - * Prototypes for NFS mount operations - */ -int nfs_mount __P(( - struct mount *mp, - char *path, - caddr_t data, - struct nameidata *ndp, - struct proc *p)); -int nfs_start __P(( - struct mount *mp, - int flags, - struct proc *p)); -int nfs_unmount __P(( - struct mount *mp, - int mntflags, - struct proc *p)); -int nfs_root __P(( - struct mount *mp, - struct vnode **vpp)); -int nfs_quotactl __P(( - struct mount *mp, - int cmds, - uid_t uid, - caddr_t arg, - struct proc *p)); -int nfs_statfs __P(( - struct mount *mp, - struct statfs *sbp, - struct proc *p)); -int nfs_sync __P(( - struct mount *mp, - int waitfor, - struct ucred *cred, - struct proc *p)); -int nfs_fhtovp __P(( - struct mount *mp, - struct fid *fhp, - struct mbuf *nam, - struct vnode **vpp, - int *exflagsp, - struct ucred **credanonp)); -int nfs_vptofh __P(( - struct vnode *vp, - struct fid *fhp)); -int nfs_init __P((void)); - #endif diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index 02cc1c3..49e96da 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfsnode.h 8.4 (Berkeley) 2/13/94 - * $Id: nfsnode.h,v 1.13 1995/11/06 00:36:03 bde Exp $ + * $Id: nfsnode.h,v 1.14 1995/11/09 08:16:59 bde Exp $ */ #ifndef _NFS_NFSNODE_H_ @@ -179,7 +179,6 @@ int nfs_reclaim __P((struct vop_reclaim_args *)); int nfs_lock __P((struct vop_lock_args *)); int nfs_unlock __P((struct vop_unlock_args *)); int nfs_islocked __P((struct vop_islocked_args *)); -int nfs_vget __P((struct mount *, ino_t, struct vnode **)); #define nfs_reallocblks \ ((int (*) __P((struct vop_reallocblks_args *)))eopnotsupp) diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h index 58b1e97..03464f4 100644 --- a/sys/nfsclient/nfsstats.h +++ b/sys/nfsclient/nfsstats.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index 58b1e97..03464f4 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c index 0173c99..3fc96a4 100644 --- a/sys/nfsserver/nfs_serv.c +++ b/sys/nfsserver/nfs_serv.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_serv.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_serv.c,v 1.25 1995/10/29 15:32:59 phk Exp $ + * $Id: nfs_serv.c,v 1.26 1995/12/07 12:47:25 davidg Exp $ */ /* @@ -70,6 +70,7 @@ #include <sys/dirent.h> #include <sys/stat.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <ufs/ufs/dir.h> #include <vm/vm.h> @@ -95,11 +96,14 @@ nfstype nfsv3_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFSOCK, NFFIFO, NFNON }; int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000; -#ifdef NFS_ASYNC -int nfs_async = 1; -#else int nfs_async; -#endif +SYSCTL_INT(_fs_nfs, OID_AUTO, async, CTLFLAG_RW, &nfs_async, 0, ""); + + +static int nfsrv_access __P((struct vnode *,int,struct ucred *,int, + struct proc *)); +static void nfsrvw_coalesce __P((struct nfsrv_descript *, + struct nfsrv_descript *)); /* * nfs v3 access service @@ -1198,7 +1202,7 @@ loop1: * - put nfsd on owp's nd_coalesce list * NB: Must be called at splsoftclock(). */ -void +static void nfsrvw_coalesce(owp, nfsd) register struct nfsrv_descript *owp; register struct nfsrv_descript *nfsd; @@ -3390,7 +3394,7 @@ nfsrv_noop(nfsd, slp, procp, mrq) * this because it opens a security hole, but since the nfs server opens * a security hole the size of a barn door anyhow, what the heck. */ -int +static int nfsrv_access(vp, flags, cred, rdonly, p) register struct vnode *vp; int flags; diff --git a/sys/nfsserver/nfs_srvcache.c b/sys/nfsserver/nfs_srvcache.c index acdce0d..574729c 100644 --- a/sys/nfsserver/nfs_srvcache.c +++ b/sys/nfsserver/nfs_srvcache.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_srvcache.c 8.1 (Berkeley) 6/10/93 - * $Id: nfs_srvcache.c,v 1.5 1994/10/17 17:47:36 phk Exp $ + * $Id: nfs_srvcache.c,v 1.6 1995/06/27 11:06:43 dfr Exp $ */ /* @@ -66,7 +66,8 @@ extern struct nfsstats nfsstats; extern int nfsv2_procid[NFS_NPROCS]; -long numnfsrvcache, desirednfsrvcache = NFSRVCACHESIZ; +long numnfsrvcache; +static long desirednfsrvcache = NFSRVCACHESIZ; #define NFSRCHASH(xid) \ (&nfsrvhashtbl[((xid) + ((xid) >> 24)) & nfsrvhash]) @@ -83,7 +84,7 @@ u_long nfsrvhash; /* * Static array that defines which nfs rpc's are nonidempotent */ -int nonidempotent[NFS_NPROCS] = { +static int nonidempotent[NFS_NPROCS] = { FALSE, FALSE, TRUE, diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index f497afe..0059f5e 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_socket.c 8.3 (Berkeley) 1/12/94 - * $Id: nfs_socket.c,v 1.11 1995/11/21 15:51:32 bde Exp $ + * $Id: nfs_socket.c,v 1.12 1995/12/03 10:02:59 bde Exp $ */ /* @@ -134,10 +134,14 @@ static int nfs_backoff[8] = { 2, 4, 8, 16, 32, 64, 128, 256, }; int nfsrtton = 0; struct nfsrtt nfsrtt; -extern void nfs_realign __P((struct mbuf *m, int hsiz)); -extern int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, +static int nfs_msg __P((struct proc *,char *,char *)); +static int nfs_rcvlock __P((struct nfsreq *)); +static void nfs_rcvunlock __P((int *flagp)); +static void nfs_realign __P((struct mbuf *m, int hsiz)); +static int nfs_receive __P((struct nfsreq *rep, struct mbuf **aname, struct mbuf **mp)); -extern int nfs_reconnect __P((struct nfsreq *rep)); +static int nfs_reconnect __P((struct nfsreq *rep)); +static int nfsrv_getstream __P((struct nfssvc_sock *,int)); int (*nfsrv3_procs[NFS_NPROCS]) __P((struct nfsrv_descript *nd, struct nfssvc_sock *slp, @@ -317,7 +321,7 @@ bad: * If this fails the mount point is DEAD! * nb: Must be called with the nfs_sndlock() set on the mount point. */ -int +static int nfs_reconnect(rep) register struct nfsreq *rep; { @@ -441,7 +445,7 @@ nfs_send(so, nam, top, rep) * For SOCK_STREAM we must be very careful to read an entire record once * we have read any of it, even if the system call has been interrupted. */ -int +static int nfs_receive(rep, aname, mp) register struct nfsreq *rep; struct mbuf **aname; @@ -1456,7 +1460,7 @@ nfs_sndunlock(flagp) } } -int +static int nfs_rcvlock(rep) register struct nfsreq *rep; { @@ -1485,7 +1489,7 @@ nfs_rcvlock(rep) /* * Unlock the stream socket for others. */ -void +static void nfs_rcvunlock(flagp) register int *flagp; { @@ -1503,7 +1507,7 @@ nfs_rcvunlock(flagp) * Check for badly aligned mbuf data areas and * realign data in an mbuf list by copying the data areas up, as required. */ -void +static void nfs_realign(m, hsiz) register struct mbuf *m; int hsiz; @@ -1708,7 +1712,7 @@ dorecs: * stream socket. The "waitflag" argument indicates whether or not it * can sleep. */ -int +static int nfsrv_getstream(slp, waitflag) register struct nfssvc_sock *slp; int waitflag; @@ -2142,7 +2146,7 @@ nfsrv_wakenfsd(slp) nfsd_head_flag |= NFSD_CHECKSLP; } -int +static int nfs_msg(p, server, msg) struct proc *p; char *server, *msg; diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index d590ce4..46327bf 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_subs.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_subs.c,v 1.24 1995/10/29 15:33:08 phk Exp $ + * $Id: nfs_subs.c,v 1.25 1995/12/07 12:47:26 davidg Exp $ */ /* @@ -93,8 +93,13 @@ u_long nfs_prog, nqnfs_prog, nfs_true, nfs_false; /* And other global data */ static u_long nfs_xid = 0; -enum vtype nv2tov_type[8] = { VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON }; -enum vtype nv3tov_type[8]={ VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO }; +static enum vtype nv2tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VNON, VNON +}; +enum vtype nv3tov_type[8]= { + VNON, VREG, VDIR, VBLK, VCHR, VLNK, VSOCK, VFIFO +}; + int nfs_ticks; struct nfs_reqq nfs_reqq; diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c index 44789f7..68d7dc1 100644 --- a/sys/nfsserver/nfs_syscalls.c +++ b/sys/nfsserver/nfs_syscalls.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs_syscalls.c 8.3 (Berkeley) 1/4/94 - * $Id: nfs_syscalls.c,v 1.10 1995/11/21 15:51:34 bde Exp $ + * $Id: nfs_syscalls.c,v 1.11 1995/12/03 10:03:06 bde Exp $ */ #include <sys/param.h> @@ -86,14 +86,14 @@ extern int nfsrtton; extern struct nfsstats nfsstats; extern int nfsrvw_procrastinate; struct nfssvc_sock *nfs_udpsock, *nfs_cltpsock; -int nuidhash_max = NFS_MAXUIDHASH; +static int nuidhash_max = NFS_MAXUIDHASH; static int nfs_numnfsd = 0; int nfsd_waiting = 0; static int notstarted = 1; static int modify_flag = 0; static struct nfsdrt nfsdrt; -extern void nfsrv_zapsock __P((struct nfssvc_sock *slp)); +static void nfsrv_zapsock __P((struct nfssvc_sock *slp)); #define TRUE 1 #define FALSE 0 @@ -102,6 +102,9 @@ static int nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; static void nfsd_rt __P((int sotype, struct nfsrv_descript *nd, int cacherep)); +static int nfssvc_addsock __P((struct file *,struct mbuf *)); +static int nfssvc_iod __P((struct proc *)); +static int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); /* * NFS server system calls @@ -332,7 +335,7 @@ nfssvc(p, uap, retval) /* * Adds a socket to the list for servicing by nfsds. */ -int +static int nfssvc_addsock(fp, mynam) struct file *fp; struct mbuf *mynam; @@ -422,7 +425,7 @@ nfssvc_addsock(fp, mynam) * Called by nfssvc() for nfsds. Just loops around servicing rpc requests * until it is killed by a signal. */ -int +static int nfssvc_nfsd(nsd, argp, p) struct nfsd_srvargs *nsd; caddr_t argp; @@ -705,7 +708,7 @@ done: * They do read-ahead and write-behind operations on the block I/O cache. * Never returns unless it fails or gets killed. */ -int +static int nfssvc_iod(p) struct proc *p; { @@ -788,7 +791,7 @@ nfssvc_iod(p) * will stop using it and clear ns_flag at the end so that it will not be * reassigned during cleanup. */ -void +static void nfsrv_zapsock(slp) register struct nfssvc_sock *slp; { diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h index 58b1e97..03464f4 100644 --- a/sys/nfsserver/nfsrvstats.h +++ b/sys/nfsserver/nfsrvstats.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * @(#)nfs.h 8.1 (Berkeley) 6/10/93 - * $Id: nfs.h,v 1.14 1995/11/21 12:54:38 bde Exp $ + * $Id: nfs.h,v 1.15 1995/12/03 10:02:41 bde Exp $ */ #ifndef _NFS_NFS_H_ @@ -502,8 +502,6 @@ int nfsm_disct __P((struct mbuf **,caddr_t *,int,int,caddr_t *)); void nfsm_srvfattr __P((struct nfsrv_descript *,struct vattr *,struct nfs_fattr *)); void nfsm_srvwcc __P((struct nfsrv_descript *,int,struct vattr *,int,struct vattr *,struct mbuf **,char **)); void nfsm_srvpostopattr __P((struct nfsrv_descript *,int,struct vattr *,struct mbuf **,char **)); -int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **,struct ucred *,struct nfssvc_sock *,struct mbuf *,int *,int)); -int nfsrv_access __P((struct vnode *,int,struct ucred *,int,struct proc *)); int netaddr_match __P((int,union nethostaddr *,struct mbuf *)); int nfs_request __P((struct vnode *,struct mbuf *,int,struct proc *,struct ucred *,struct mbuf **,struct mbuf **,caddr_t *)); int nfs_loadattrcache __P((struct vnode **,struct mbuf **,caddr_t *,struct vattr *)); @@ -511,26 +509,19 @@ int nfs_namei __P((struct nameidata *,fhandle_t *,int,struct nfssvc_sock *,struc void nfsm_adj __P((struct mbuf *,int,int)); int nfsm_mbuftouio __P((struct mbuf **,struct uio *,int,caddr_t *)); void nfsrv_initcache __P((void)); -int nfs_rcvlock __P((struct nfsreq *)); -void nfs_rcvunlock __P((int *flagp)); int nfs_getauth __P((struct nfsmount *,struct nfsreq *,struct ucred *,char **,int *,char *,int *,NFSKERBKEY_T)); int nfs_getnickauth __P((struct nfsmount *,struct ucred *,char **,int *,char *,int)); int nfs_savenickauth __P((struct nfsmount *,struct ucred *,int,NFSKERBKEY_T,struct mbuf **,char **,struct mbuf *)); -int nfs_msg __P((struct proc *,char *,char *)); int nfs_adv __P((struct mbuf **,caddr_t *,int,int)); -int nfsrv_getstream __P((struct nfssvc_sock *,int)); void nfs_nhinit __P((void)); void nfs_timer __P((void*)); u_long nfs_hash __P((nfsfh_t *,int)); -int nfssvc_iod __P((struct proc *)); -int nfssvc_nfsd __P((struct nfsd_srvargs *,caddr_t,struct proc *)); -int nfssvc_addsock __P((struct file *,struct mbuf *)); void nfsrv_slpderef __P((struct nfssvc_sock *slp)); int nfsrv_dorec __P((struct nfssvc_sock *,struct nfsd *,struct nfsrv_descript **)); void nfsrv_cleancache __P((void)); int nfsrv_getcache __P((struct nfsrv_descript *,struct nfssvc_sock *,struct mbuf **)); +int nfs_init __P((void)); void nfsrv_updatecache __P((struct nfsrv_descript *,int,struct mbuf *)); -int mountnfs __P((struct nfs_args *,struct mount *,struct mbuf *,char *,char *,struct vnode **)); int nfs_connect __P((struct nfsmount *,struct nfsreq *)); void nfs_disconnect __P((struct nfsmount *nmp)); int nfs_getattrcache __P((struct vnode *,struct vattr *)); @@ -540,7 +531,6 @@ int nfsm_uiotombuf __P((struct uio *,struct mbuf **,int,caddr_t *)); void nfsrv_init __P((int)); void nfs_clearcommit __P((struct mount *)); int nfsrv_errmap __P((struct nfsrv_descript *, int)); -void nfsrvw_coalesce __P((struct nfsrv_descript *,struct nfsrv_descript *)); void nfsrv_rcv __P((struct socket *so, caddr_t arg, int waitflag)); void nfsrvw_sort __P((gid_t [],int)); void nfsrv_setcred __P((struct ucred *,struct ucred *)); @@ -560,6 +550,9 @@ int nfsrv_commit __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_create __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); +int nfsrv_fhtovp __P((fhandle_t *,int,struct vnode **, + struct ucred *,struct nfssvc_sock *,struct mbuf *, + int *,int)); int nfsrv_fsinfo __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); int nfsrv_getattr __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, @@ -604,6 +597,7 @@ int nfsrv_symlink __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, int nfsrv_write __P((struct nfsrv_descript *nfsd, struct nfssvc_sock *slp, struct proc *procp, struct mbuf **mrq)); + #endif /* KERNEL */ #endif diff --git a/sys/ufs/ffs/ffs_alloc.c b/sys/ufs/ffs/ffs_alloc.c index 33653d5..b000d56 100644 --- a/sys/ufs/ffs/ffs_alloc.c +++ b/sys/ufs/ffs/ffs_alloc.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94 - * $Id: ffs_alloc.c,v 1.20 1995/12/03 11:16:21 bde Exp $ + * $Id: ffs_alloc.c,v 1.21 1995/12/15 03:36:25 peter Exp $ */ #include <sys/param.h> @@ -41,6 +41,7 @@ #include <sys/vnode.h> #include <sys/mount.h> #include <sys/kernel.h> +#include <sys/sysctl.h> #include <sys/syslog.h> #include <vm/vm.h> @@ -59,7 +60,9 @@ typedef long allocfcn_t __P((struct inode *ip, int cg, daddr_t bpref, static daddr_t ffs_alloccg __P((struct inode *, int, daddr_t, int)); static daddr_t ffs_alloccgblk __P((struct fs *, struct cg *, daddr_t)); +#ifdef notyet static daddr_t ffs_clusteralloc __P((struct inode *, int, daddr_t, int)); +#endif static ino_t ffs_dirpref __P((struct fs *)); static daddr_t ffs_fragextend __P((struct inode *, int, long, int, int)); static void ffs_fserr __P((struct fs *, u_int, char *)); @@ -68,7 +71,7 @@ static u_long ffs_hashalloc static ino_t ffs_nodealloccg __P((struct inode *, int, daddr_t, int)); static daddr_t ffs_mapsearch __P((struct fs *, struct cg *, daddr_t, int)); -void ffs_clusteracct __P((struct fs *, struct cg *, daddr_t, int)); +static void ffs_clusteracct __P((struct fs *, struct cg *, daddr_t, int)); /* * Allocate a block in the file system. @@ -325,11 +328,8 @@ nospace: * Note that the error return is not reflected back to the user. Rather * the previous block allocation will be used. */ -#include <sys/sysctl.h> -int doasyncfree = 1; -#ifdef DEBUG -SYSCTL_INT(_debug, 14, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""); -#endif +static int doasyncfree = 1; +SYSCTL_INT(_debug, OID_AUTO, doasyncfree, CTLFLAG_RW, &doasyncfree, 0, ""); int ffs_reallocblks(ap) struct vop_reallocblks_args /* { @@ -337,7 +337,7 @@ ffs_reallocblks(ap) struct cluster_save *a_buflist; } */ *ap; { -#if 1 +#if !defined (not_yes) return (ENOSPC); #else struct fs *fs; @@ -1006,6 +1006,7 @@ gotit: return (cgp->cg_cgx * fs->fs_fpg + bno); } +#ifdef notyet /* * Determine whether a cluster can be allocated. * @@ -1094,6 +1095,7 @@ fail: brelse(bp); return (0); } +#endif /* * Determine whether an inode can be allocated. @@ -1415,7 +1417,7 @@ ffs_mapsearch(fs, cgp, bpref, allocsiz) * * Cnt == 1 means free; cnt == -1 means allocating. */ -void +static void ffs_clusteracct(fs, cgp, blkno, cnt) struct fs *fs; struct cg *cgp; diff --git a/sys/ufs/ffs/ffs_extern.h b/sys/ufs/ffs/ffs_extern.h index 9a4bbfd..efcf06e 100644 --- a/sys/ufs/ffs/ffs_extern.h +++ b/sys/ufs/ffs/ffs_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_extern.h 8.3 (Berkeley) 4/16/94 - * $Id: ffs_extern.h,v 1.7 1995/09/06 05:41:16 dyson Exp $ + * $Id: ffs_extern.h,v 1.8 1995/11/09 08:14:04 bde Exp $ */ struct buf; @@ -62,14 +62,10 @@ int ffs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, struct vnode **, int *, struct ucred **)); int ffs_flushfiles __P((struct mount *, int, struct proc *)); void ffs_fragacct __P((struct fs *, int, long [], int)); -int ffs_fsync __P((struct vop_fsync_args *)); int ffs_init __P((void)); int ffs_isblock __P((struct fs *, u_char *, daddr_t)); -int ffs_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); int ffs_mountfs __P((struct vnode *, struct mount *, struct proc *)); int ffs_mountroot __P((void)); -int ffs_read __P((struct vop_read_args *)); int ffs_reallocblks __P((struct vop_reallocblks_args *)); int ffs_realloccg __P((struct inode *, daddr_t, daddr_t, int, int, struct ucred *, struct buf **)); @@ -84,8 +80,6 @@ int ffs_valloc __P((struct vop_valloc_args *)); int ffs_vfree __P((struct vop_vfree_args *)); int ffs_vget __P((struct mount *, ino_t, struct vnode **)); int ffs_vptofh __P((struct vnode *, struct fid *)); -int ffs_write __P((struct vop_write_args *)); -int ffs_getpages __P((struct vop_getpages_args *)); #ifdef DIAGNOSTIC void ffs_checkoverlap __P((struct buf *, struct inode *)); diff --git a/sys/ufs/ffs/ffs_subr.c b/sys/ufs/ffs/ffs_subr.c index e6aa986..0ad07cd 100644 --- a/sys/ufs/ffs/ffs_subr.c +++ b/sys/ufs/ffs/ffs_subr.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_subr.c 8.2 (Berkeley) 9/21/93 - * $Id: ffs_subr.c,v 1.4 1995/05/30 08:15:00 rgrimes Exp $ + * $Id: ffs_subr.c,v 1.5 1995/09/04 00:20:55 dyson Exp $ */ #include <sys/param.h> @@ -118,7 +118,7 @@ ffs_fragacct(fs, fragmap, fraglist, cnt) } } -#if defined(KERNEL) && defined(DIAGNOSTIC) +#if defined(KERNEL) && defined(DIAGNOSTIC) && defined(DDB) void ffs_checkoverlap(bp, ip) struct buf *bp; diff --git a/sys/ufs/ffs/ffs_tables.c b/sys/ufs/ffs/ffs_tables.c index 089334f..9fe3424 100644 --- a/sys/ufs/ffs/ffs_tables.c +++ b/sys/ufs/ffs/ffs_tables.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_tables.c 8.1 (Berkeley) 6/11/93 - * $Id: ffs_tables.c,v 1.2 1994/08/02 07:54:22 davidg Exp $ + * $Id: ffs_tables.c,v 1.3 1995/05/30 08:15:02 rgrimes Exp $ */ #include <sys/param.h> @@ -59,7 +59,7 @@ int inside[9] = { * These tables are used by the scanc instruction on the VAX to * quickly find an appropriate fragment. */ -u_char fragtbl124[256] = { +static u_char fragtbl124[256] = { 0x00, 0x16, 0x16, 0x2a, 0x16, 0x16, 0x26, 0x4e, 0x16, 0x16, 0x16, 0x3e, 0x2a, 0x3e, 0x4e, 0x8a, 0x16, 0x16, 0x16, 0x3e, 0x16, 0x16, 0x36, 0x5e, @@ -94,7 +94,7 @@ u_char fragtbl124[256] = { 0x9e, 0x9e, 0x9e, 0xbe, 0xaa, 0xbe, 0xce, 0x8a, }; -u_char fragtbl8[256] = { +static u_char fragtbl8[256] = { 0x00, 0x01, 0x01, 0x02, 0x01, 0x01, 0x02, 0x04, 0x01, 0x01, 0x01, 0x03, 0x02, 0x03, 0x04, 0x08, 0x01, 0x01, 0x01, 0x03, 0x01, 0x01, 0x03, 0x05, diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 3c9774a..288e69c 100644 --- a/sys/ufs/ffs/ffs_vfsops.c +++ b/sys/ufs/ffs/ffs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94 - * $Id: ffs_vfsops.c,v 1.30 1995/12/07 12:47:51 davidg Exp $ + * $Id: ffs_vfsops.c,v 1.31 1995/12/11 04:57:39 dyson Exp $ */ #include <sys/param.h> @@ -66,9 +66,11 @@ #include <vm/vm_page.h> #include <vm/vm_object.h> -int ffs_sbupdate __P((struct ufsmount *, int)); -int ffs_reload __P((struct mount *,struct ucred *,struct proc *)); -int ffs_oldfscompat __P((struct fs *)); +static int ffs_sbupdate __P((struct ufsmount *, int)); +static int ffs_reload __P((struct mount *,struct ucred *,struct proc *)); +static int ffs_oldfscompat __P((struct fs *)); +static int ffs_mount __P((struct mount *, + char *, caddr_t, struct nameidata *, struct proc *)); struct vfsops ufs_vfsops = { ffs_mount, @@ -126,7 +128,7 @@ extern u_long nextgennumber; * system call will fail with EFAULT in copyinstr in * namei() if it is a genuine NULL from the user. */ -int +static int ffs_mount( mp, path, data, ndp, p) register struct mount *mp; /* mount struct pointer*/ char *path; /* path to mount point*/ @@ -350,7 +352,7 @@ success: * 5) invalidate all cached file data. * 6) re-read inode data for all active vnodes. */ -int +static int ffs_reload(mp, cred, p) register struct mount *mp; struct ucred *cred; @@ -598,7 +600,7 @@ out: * * XXX - goes away some day. */ -int +static int ffs_oldfscompat(fs) struct fs *fs; { @@ -823,7 +825,7 @@ loop: * return the inode locked. Detection and handling of mount points must be * done by the calling routine. */ -int ffs_inode_hash_lock; +static int ffs_inode_hash_lock; int ffs_vget(mp, ino, vpp) @@ -1005,7 +1007,7 @@ ffs_vptofh(vp, fhp) /* * Write a superblock and associated information back to disk. */ -int +static int ffs_sbupdate(mp, waitfor) struct ufsmount *mp; int waitfor; diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c index 9df1715..f768986 100644 --- a/sys/ufs/ffs/ffs_vnops.c +++ b/sys/ufs/ffs/ffs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ffs_vnops.c 8.7 (Berkeley) 2/3/94 - * $Id: ffs_vnops.c,v 1.18 1995/11/14 09:40:06 phk Exp $ + * $Id: ffs_vnops.c,v 1.19 1995/12/07 12:47:52 davidg Exp $ */ #include <sys/param.h> @@ -67,9 +67,14 @@ #include <ufs/ffs/fs.h> #include <ufs/ffs/ffs_extern.h> +static int ffs_fsync __P((struct vop_fsync_args *)); +static int ffs_getpages __P((struct vop_getpages_args *)); +static int ffs_read __P((struct vop_read_args *)); +static int ffs_write __P((struct vop_write_args *)); + /* Global vfs data structures for ufs. */ vop_t **ffs_vnodeop_p; -struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { +static struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)ufs_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)ufs_create }, /* create */ @@ -115,11 +120,11 @@ struct vnodeopv_entry_desc ffs_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ffs_vnodeop_opv_desc = +static struct vnodeopv_desc ffs_vnodeop_opv_desc = { &ffs_vnodeop_p, ffs_vnodeop_entries }; vop_t **ffs_specop_p; -struct vnodeopv_entry_desc ffs_specop_entries[] = { +static struct vnodeopv_entry_desc ffs_specop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)spec_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)spec_create }, /* create */ @@ -165,11 +170,11 @@ struct vnodeopv_entry_desc ffs_specop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ffs_specop_opv_desc = +static struct vnodeopv_desc ffs_specop_opv_desc = { &ffs_specop_p, ffs_specop_entries }; vop_t **ffs_fifoop_p; -struct vnodeopv_entry_desc ffs_fifoop_entries[] = { +static struct vnodeopv_entry_desc ffs_fifoop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)fifo_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)fifo_create }, /* create */ @@ -214,7 +219,7 @@ struct vnodeopv_entry_desc ffs_fifoop_entries[] = { { &vop_bwrite_desc, (vop_t *)vn_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc ffs_fifoop_opv_desc = +static struct vnodeopv_desc ffs_fifoop_opv_desc = { &ffs_fifoop_p, ffs_fifoop_entries }; VNODEOP_SET(ffs_vnodeop_opv_desc); @@ -242,7 +247,7 @@ SYSCTL_INT(_debug, 12, doclusterwrite, CTLFLAG_RW, &doclusterwrite, 0, ""); * Synch an open file. */ /* ARGSUSED */ -int +static int ffs_fsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index 045e743..4816ab2 100644 --- a/sys/ufs/lfs/lfs_bio.c +++ b/sys/ufs/lfs/lfs_bio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_bio.c 8.4 (Berkeley) 12/30/93 - * $Id: lfs_bio.c,v 1.6 1995/08/11 11:31:16 davidg Exp $ + * $Id: lfs_bio.c,v 1.7 1995/12/03 11:16:35 bde Exp $ */ #include <sys/param.h> @@ -50,7 +50,7 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> -extern void lfs_flush __P((void)); +static void lfs_flush __P((void)); /* * LFS block write function. @@ -61,7 +61,7 @@ extern void lfs_flush __P((void)); */ int lfs_allclean_wakeup; /* Cleaner wakeup address. */ int locked_queue_count; /* XXX Count of locked-down buffers. */ -int lfs_writing; /* Set if already kicked off a writer +static int lfs_writing; /* Set if already kicked off a writer because of buffer space */ /* #define WRITE_THRESHHOLD ((nbuf >> 2) - 10) @@ -133,7 +133,7 @@ lfs_bwrite(ap) * buffers, so we can't have more than a single file system. To make this * work for multiple file systems, put the count into the mount structure. */ -void +static void lfs_flush() { register struct mount *mp; diff --git a/sys/ufs/lfs/lfs_extern.h b/sys/ufs/lfs/lfs_extern.h index 4390bcb..64575dd 100644 --- a/sys/ufs/lfs/lfs_extern.h +++ b/sys/ufs/lfs/lfs_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_extern.h 8.2 (Berkeley) 4/16/94 - * $Id: lfs_extern.h,v 1.8 1995/11/09 08:14:13 bde Exp $ + * $Id: lfs_extern.h,v 1.9 1995/12/06 19:46:37 bde Exp $ */ #ifndef _UFS_LFS_LFS_EXTERN_H_ @@ -48,55 +48,33 @@ struct inode; struct uio; struct mbuf; + int lfs_balloc __P((struct vnode *, u_long, daddr_t, struct buf **)); int lfs_blkatoff __P((struct vop_blkatoff_args *)); int lfs_bwrite __P((struct vop_bwrite_args *)); int lfs_check __P((struct vnode *, daddr_t)); -int lfs_close __P((struct vop_close_args *)); -int lfs_create __P((struct vop_create_args *)); -int lfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, - struct vnode **, int *, struct ucred **)); void lfs_free_buffer __P((caddr_t, int)); -int lfs_fsync __P((struct vop_fsync_args *)); int lfs_gatherblock __P((struct segment *, struct buf *, int *)); -int lfs_getattr __P((struct vop_getattr_args *)); struct dinode * lfs_ifind __P((struct lfs *, ino_t, struct dinode *)); -int lfs_inactive __P((struct vop_inactive_args *)); int lfs_init __P((void)); int lfs_initseg __P((struct lfs *)); -int lfs_link __P((struct vop_link_args *)); int lfs_makeinode __P((int, struct nameidata *, struct inode **)); -int lfs_mkdir __P((struct vop_mkdir_args *)); -int lfs_mknod __P((struct vop_mknod_args *)); -int lfs_mount __P((struct mount *, - char *, caddr_t, struct nameidata *, struct proc *)); int lfs_mountroot __P((void)); struct buf * lfs_newbuf __P((struct vnode *, daddr_t, size_t)); -int lfs_read __P((struct vop_read_args *)); -int lfs_remove __P((struct vop_remove_args *)); -int lfs_rmdir __P((struct vop_rmdir_args *)); -int lfs_rename __P((struct vop_rename_args *)); void lfs_seglock __P((struct lfs *, unsigned long flags)); void lfs_segunlock __P((struct lfs *)); int lfs_segwrite __P((struct mount *, int)); -int lfs_statfs __P((struct mount *, struct statfs *, struct proc *)); -int lfs_symlink __P((struct vop_symlink_args *)); -int lfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); int lfs_truncate __P((struct vop_truncate_args *)); -int lfs_unmount __P((struct mount *, int, struct proc *)); int lfs_update __P((struct vop_update_args *)); void lfs_updatemeta __P((struct segment *)); int lfs_valloc __P((struct vop_valloc_args *)); int lfs_vcreate __P((struct mount *, ino_t, struct vnode **)); int lfs_vfree __P((struct vop_vfree_args *)); int lfs_vflush __P((struct vnode *)); -int lfs_vget __P((struct mount *, ino_t, struct vnode **)); -int lfs_vptofh __P((struct vnode *, struct fid *)); int lfs_vref __P((struct vnode *)); void lfs_vunref __P((struct vnode *)); -int lfs_write __P((struct vop_write_args *)); int lfs_writeinode __P((struct lfs *, struct segment *, struct inode *)); int lfs_writeseg __P((struct lfs *, struct segment *)); void lfs_writesuper __P((struct lfs *)); diff --git a/sys/ufs/lfs/lfs_segment.c b/sys/ufs/lfs/lfs_segment.c index 1fc1dec..e08e07d 100644 --- a/sys/ufs/lfs/lfs_segment.c +++ b/sys/ufs/lfs/lfs_segment.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_segment.c 8.5 (Berkeley) 1/4/94 - * $Id: lfs_segment.c,v 1.14 1995/09/04 00:21:01 dyson Exp $ + * $Id: lfs_segment.c,v 1.15 1995/12/03 11:16:46 bde Exp $ */ #include <sys/param.h> @@ -61,18 +61,18 @@ #include <ufs/lfs/lfs_extern.h> extern int count_lock_queue __P((void)); -extern caddr_t lfs_alloc_buffer __P((int size)); -extern void lfs_reclaim_buffers __P((void)); +static caddr_t lfs_alloc_buffer __P((int size)); +static void lfs_reclaim_buffers __P((void)); #define MAX_ACTIVE 10 #define MAX_IO_BUFS 256 #define MAX_IO_SIZE (1024*512) -int lfs_total_io_size; -int lfs_total_io_count; -volatile int lfs_total_free_count; -int lfs_free_needed; -int lfs_in_buffer_reclaim; -struct lfs_freebuf { +static int lfs_total_io_size; +static int lfs_total_io_count; +static volatile int lfs_total_free_count; +static int lfs_free_needed; +static int lfs_in_buffer_reclaim; +static struct lfs_freebuf { int size; caddr_t address; } lfs_freebufs[MAX_IO_BUFS]; @@ -88,7 +88,7 @@ lfs_free_buffer( caddr_t address, int size) { } } -void +static void lfs_reclaim_buffers() { int i,s; int reclaimed = 0; @@ -114,7 +114,7 @@ lfs_reclaim_buffers() { } } -caddr_t +static caddr_t lfs_alloc_buffer(int size) { int s; caddr_t rtval; @@ -145,19 +145,19 @@ lfs_alloc_buffer(int size) { ((fs)->lfs_dbpseg - ((fs)->lfs_offset - (fs)->lfs_curseg) > \ 1 << (fs)->lfs_fsbtodb) -void lfs_callback __P((struct buf *)); -void lfs_gather __P((struct lfs *, struct segment *, +static void lfs_callback __P((struct buf *)); +static void lfs_gather __P((struct lfs *, struct segment *, struct vnode *, int (*) __P((struct lfs *, struct buf *)))); void lfs_iset __P((struct inode *, daddr_t, time_t)); -int lfs_match_data __P((struct lfs *, struct buf *)); -int lfs_match_dindir __P((struct lfs *, struct buf *)); -int lfs_match_indir __P((struct lfs *, struct buf *)); -int lfs_match_tindir __P((struct lfs *, struct buf *)); -void lfs_newseg __P((struct lfs *)); -void lfs_shellsort __P((struct buf **, daddr_t *, register int)); -void lfs_supercallback __P((struct buf *)); -void lfs_writefile __P((struct lfs *, struct segment *, struct vnode *)); -void lfs_writevnodes __P((struct lfs *fs, struct mount *mp, +static int lfs_match_data __P((struct lfs *, struct buf *)); +static int lfs_match_dindir __P((struct lfs *, struct buf *)); +static int lfs_match_indir __P((struct lfs *, struct buf *)); +static int lfs_match_tindir __P((struct lfs *, struct buf *)); +static void lfs_newseg __P((struct lfs *)); +static void lfs_shellsort __P((struct buf **, daddr_t *, register int)); +static void lfs_supercallback __P((struct buf *)); +static void lfs_writefile __P((struct lfs *, struct segment *, struct vnode *)); +static void lfs_writevnodes __P((struct lfs *fs, struct mount *mp, struct segment *sp, int dirops)); /* Statistics Counters */ @@ -233,7 +233,7 @@ lfs_vflush(vp) return (0); } -void +static void lfs_writevnodes(fs, mp, sp, op) struct lfs *fs; struct mount *mp; @@ -402,7 +402,7 @@ redo: /* * Write the dirty blocks associated with a vnode. */ -void +static void lfs_writefile(fs, sp, vp) struct lfs *fs; struct segment *sp; @@ -594,7 +594,7 @@ lfs_gatherblock(sp, bp, sptr) return(0); } -void +static void lfs_gather(fs, sp, vp, match) struct lfs *fs; struct segment *sp; @@ -784,7 +784,7 @@ lfs_initseg(fs) /* * Return the next segment to write. */ -void +static void lfs_newseg(fs) struct lfs *fs; { @@ -1028,7 +1028,7 @@ lfs_writesuper(fs) * Logical block number match routines used when traversing the dirty block * chain. */ -int +static int lfs_match_data(fs, bp) struct lfs *fs; struct buf *bp; @@ -1036,7 +1036,7 @@ lfs_match_data(fs, bp) return (bp->b_lblkno >= 0); } -int +static int lfs_match_indir(fs, bp) struct lfs *fs; struct buf *bp; @@ -1047,7 +1047,7 @@ lfs_match_indir(fs, bp) return (lbn < 0 && (-lbn - NDADDR) % NINDIR(fs) == 0); } -int +static int lfs_match_dindir(fs, bp) struct lfs *fs; struct buf *bp; @@ -1058,7 +1058,7 @@ lfs_match_dindir(fs, bp) return (lbn < 0 && (-lbn - NDADDR) % NINDIR(fs) == 1); } -int +static int lfs_match_tindir(fs, bp) struct lfs *fs; struct buf *bp; @@ -1096,7 +1096,7 @@ lfs_newbuf(vp, daddr, size) return (bp); } -void +static void lfs_callback(bp) struct buf *bp; { @@ -1115,7 +1115,7 @@ lfs_callback(bp) } -void +static void lfs_supercallback(bp) struct buf *bp; { @@ -1137,7 +1137,7 @@ lfs_supercallback(bp) * of logical block numbers to a unsigned in this routine so that the * negative block numbers (meta data blocks) sort AFTER the data blocks. */ -void +static void lfs_shellsort(bp_array, lb_array, nmemb) struct buf **bp_array; daddr_t *lb_array; diff --git a/sys/ufs/lfs/lfs_syscalls.c b/sys/ufs/lfs/lfs_syscalls.c index b978cfb..09ec9bb 100644 --- a/sys/ufs/lfs/lfs_syscalls.c +++ b/sys/ufs/lfs/lfs_syscalls.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_syscalls.c 8.5 (Berkeley) 4/20/94 - * $Id: lfs_syscalls.c,v 1.12 1995/09/04 00:21:02 dyson Exp $ + * $Id: lfs_syscalls.c,v 1.13 1995/11/12 06:43:17 bde Exp $ */ #include <sys/param.h> @@ -65,8 +65,8 @@ if (sp->sum_bytes_left < (s)) { \ (void) lfs_writeseg(fs, sp); \ } -struct buf *lfs_fakebuf __P((struct vnode *, int, size_t, caddr_t)); -int lfs_fastvget __P((struct mount *, ino_t, daddr_t, struct vnode **, +static struct buf *lfs_fakebuf __P((struct vnode *, int, size_t, caddr_t)); +static int lfs_fastvget __P((struct mount *, ino_t, daddr_t, struct vnode **, struct dinode *)); /* @@ -448,7 +448,7 @@ lfs_segwait(p, uap, retval) * processing IINFO structures, it may have the ondisk inode already, so * don't go retrieving it again. */ -int +static int lfs_fastvget(mp, ino, daddr, vpp, dinp) struct mount *mp; ino_t ino; @@ -557,7 +557,7 @@ lfs_fastvget(mp, ino, daddr, vpp, dinp) *vpp = vp; return (0); } -struct buf * +static struct buf * lfs_fakebuf(vp, lbn, size, uaddr) struct vnode *vp; int lbn; diff --git a/sys/ufs/lfs/lfs_vfsops.c b/sys/ufs/lfs/lfs_vfsops.c index 80fb731..58de7b7 100644 --- a/sys/ufs/lfs/lfs_vfsops.c +++ b/sys/ufs/lfs/lfs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_vfsops.c 8.7 (Berkeley) 4/16/94 - * $Id: lfs_vfsops.c,v 1.11 1995/03/19 14:29:20 davidg Exp $ + * $Id: lfs_vfsops.c,v 1.12 1995/08/28 09:19:12 julian Exp $ */ #include <sys/param.h> @@ -60,7 +60,16 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> -int lfs_mountfs __P((struct vnode *, struct mount *, struct proc *)); +static int lfs_fhtovp __P((struct mount *, struct fid *, struct mbuf *, + struct vnode **, int *, struct ucred **)); +static int lfs_mount __P((struct mount *, char *, caddr_t, + struct nameidata *, struct proc *)); +static int lfs_mountfs __P((struct vnode *, struct mount *, struct proc *)); +static int lfs_statfs __P((struct mount *, struct statfs *, struct proc *)); +static int lfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); +static int lfs_unmount __P((struct mount *, int, struct proc *)); +static int lfs_vget __P((struct mount *, ino_t, struct vnode **)); +static int lfs_vptofh __P((struct vnode *, struct fid *)); struct vfsops lfs_vfsops = { lfs_mount, @@ -118,7 +127,7 @@ VFS_SET(lfs_vfsops, lfs, MOUNT_LFS, 0); * * Root mounts are not currently supported. */ -int +static int lfs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -253,7 +262,7 @@ success: * Common code for mount and mountroot * LFS specific */ -int +static int lfs_mountfs(devvp, mp, p) register struct vnode *devvp; struct mount *mp; @@ -380,7 +389,7 @@ out: /* * unmount system call */ -int +static int lfs_unmount(mp, mntflags, p) struct mount *mp; int mntflags; @@ -439,7 +448,7 @@ lfs_unmount(mp, mntflags, p) /* * Get file system statistics. */ -int +static int lfs_statfs(mp, sbp, p) struct mount *mp; register struct statfs *sbp; @@ -478,7 +487,7 @@ lfs_statfs(mp, sbp, p) * * Note: we are always called with the filesystem marked `MPBUSY'. */ -int +static int lfs_sync(mp, waitfor, cred, p) struct mount *mp; int waitfor; @@ -500,7 +509,7 @@ lfs_sync(mp, waitfor, cred, p) * in core, read it in from the specified device. Return the inode locked. * Detection and handling of mount points must be done by the calling routine. */ -int +static int lfs_vget(mp, ino, vpp) struct mount *mp; ino_t ino; @@ -606,7 +615,7 @@ lfs_vget(mp, ino, vpp) * what is the relationship between my generational number and the NFS * generational number. */ -int +static int lfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) register struct mount *mp; struct fid *fhp; @@ -627,7 +636,7 @@ lfs_fhtovp(mp, fhp, nam, vpp, exflagsp, credanonp) * Vnode pointer to File handle */ /* ARGSUSED */ -int +static int lfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; diff --git a/sys/ufs/lfs/lfs_vnops.c b/sys/ufs/lfs/lfs_vnops.c index 948f011..49f6b1b 100644 --- a/sys/ufs/lfs/lfs_vnops.c +++ b/sys/ufs/lfs/lfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)lfs_vnops.c 8.5 (Berkeley) 12/30/93 - * $Id: lfs_vnops.c,v 1.15 1995/11/09 08:14:15 bde Exp $ + * $Id: lfs_vnops.c,v 1.16 1995/12/07 12:47:56 davidg Exp $ */ #include <sys/param.h> @@ -68,9 +68,17 @@ #include <ufs/lfs/lfs.h> #include <ufs/lfs/lfs_extern.h> +static int lfs_close __P((struct vop_close_args *)); +static int lfs_fsync __P((struct vop_fsync_args *)); +static int lfs_getattr __P((struct vop_getattr_args *)); +static int lfs_inactive __P((struct vop_inactive_args *)); +static int lfs_read __P((struct vop_read_args *)); +static int lfs_write __P((struct vop_write_args *)); + + /* Global vfs data structures for lfs. */ vop_t **lfs_vnodeop_p; -struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { +static struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)ufs_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)ufs_create }, /* create */ @@ -114,11 +122,11 @@ struct vnodeopv_entry_desc lfs_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *)lfs_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc lfs_vnodeop_opv_desc = +static struct vnodeopv_desc lfs_vnodeop_opv_desc = { &lfs_vnodeop_p, lfs_vnodeop_entries }; vop_t **lfs_specop_p; -struct vnodeopv_entry_desc lfs_specop_entries[] = { +static struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)spec_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)spec_create }, /* create */ @@ -162,11 +170,11 @@ struct vnodeopv_entry_desc lfs_specop_entries[] = { { &vop_bwrite_desc, (vop_t *)lfs_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc lfs_specop_opv_desc = +static struct vnodeopv_desc lfs_specop_opv_desc = { &lfs_specop_p, lfs_specop_entries }; vop_t **lfs_fifoop_p; -struct vnodeopv_entry_desc lfs_fifoop_entries[] = { +static struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)fifo_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)fifo_create }, /* create */ @@ -210,7 +218,7 @@ struct vnodeopv_entry_desc lfs_fifoop_entries[] = { { &vop_bwrite_desc, (vop_t *)lfs_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc lfs_fifoop_opv_desc = +static struct vnodeopv_desc lfs_fifoop_opv_desc = { &lfs_fifoop_p, lfs_fifoop_entries }; VNODEOP_SET(lfs_vnodeop_opv_desc); @@ -225,7 +233,7 @@ VNODEOP_SET(lfs_fifoop_opv_desc); * Synch an open file. */ /* ARGSUSED */ -int +static int lfs_fsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; @@ -265,155 +273,9 @@ lfs_fsync(ap) #define MARK_VNODE(dvp) (dvp)->v_flag |= VDIROP -int -lfs_symlink(ap) - struct vop_symlink_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - char *a_target; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - ret = ufs_symlink(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_mknod(ap) - struct vop_mknod_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - ret = ufs_mknod(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - ret = ufs_create(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; -{ - int ret; - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - ret = ufs_mkdir(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_remove(ap) - struct vop_remove_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - MARK_VNODE(ap->a_vp); - ret = ufs_remove(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_rmdir(ap) - struct vop_rmdir_args /* { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_dvp)->i_lfs); - MARK_VNODE(ap->a_dvp); - MARK_VNODE(ap->a_vp); - ret = ufs_rmdir(ap); - SET_ENDOP(VTOI(ap->a_dvp)->i_lfs); - return (ret); -} - -int -lfs_link(ap) - struct vop_link_args /* { - struct vnode *a_tdvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_tdvp)->i_lfs); - MARK_VNODE(ap->a_tdvp); - ret = ufs_link(ap); - SET_ENDOP(VTOI(ap->a_tdvp)->i_lfs); - return (ret); -} - -int -lfs_rename(ap) - struct vop_rename_args /* { - struct vnode *a_fdvp; - struct vnode *a_fvp; - struct componentname *a_fcnp; - struct vnode *a_tdvp; - struct vnode *a_tvp; - struct componentname *a_tcnp; - } */ *ap; -{ - int ret; - - SET_DIROP(VTOI(ap->a_fdvp)->i_lfs); - MARK_VNODE(ap->a_fdvp); - MARK_VNODE(ap->a_tdvp); - ret = ufs_rename(ap); - SET_ENDOP(VTOI(ap->a_fdvp)->i_lfs); - return (ret); -} /* XXX hack to avoid calling ITIMES in getattr */ -int +static int lfs_getattr(ap) struct vop_getattr_args /* { struct vnode *a_vp; @@ -461,7 +323,7 @@ lfs_getattr(ap) * count. */ /* ARGSUSED */ -int +static int lfs_close(ap) struct vop_close_args /* { struct vnode *a_vp; @@ -487,7 +349,7 @@ lfs_close(ap) * Stub inactive routine that avoids calling ufs_inactive in some cases. */ -int +static int lfs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; diff --git a/sys/ufs/mfs/mfs_extern.h b/sys/ufs/mfs/mfs_extern.h index 887c3d7..2464659 100644 --- a/sys/ufs/mfs/mfs_extern.h +++ b/sys/ufs/mfs/mfs_extern.h @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_extern.h 8.1 (Berkeley) 6/11/93 - * $Id: mfs_extern.h,v 1.3 1994/08/21 07:16:10 paul Exp $ + * $Id: mfs_extern.h,v 1.4 1995/08/28 09:19:13 julian Exp $ */ #ifndef _UFS_MFS_MFS_EXTERN_H_ @@ -46,23 +46,9 @@ struct ucred; struct vnode; __BEGIN_DECLS -int mfs_badop __P((void)); -int mfs_bmap __P((struct vop_bmap_args *)); -int mfs_close __P((struct vop_close_args *)); void mfs_doio __P((struct buf *bp, caddr_t base)); -int mfs_inactive __P((struct vop_inactive_args *)); /* XXX */ -int mfs_reclaim __P((struct vop_reclaim_args *)); /* XXX */ -int mfs_init __P((void)); -int mfs_ioctl __P((struct vop_ioctl_args *)); -int mfs_mount __P((struct mount *mp, - char *path, caddr_t data, struct nameidata *ndp, struct proc *p)); int mfs_mountfs __P((struct vnode *, struct mount *, struct proc *)); int mfs_mountroot __P((void)); -int mfs_open __P((struct vop_open_args *)); -int mfs_print __P((struct vop_print_args *)); /* XXX */ -int mfs_start __P((struct mount *mp, int flags, struct proc *p)); -int mfs_statfs __P((struct mount *mp, struct statfs *sbp, struct proc *p)); -int mfs_strategy __P((struct vop_strategy_args *)); /* XXX */ __END_DECLS #endif diff --git a/sys/ufs/mfs/mfs_vfsops.c b/sys/ufs/mfs/mfs_vfsops.c index af009e6..5a788f6 100644 --- a/sys/ufs/mfs/mfs_vfsops.c +++ b/sys/ufs/mfs/mfs_vfsops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_vfsops.c 8.4 (Berkeley) 4/16/94 - * $Id: mfs_vfsops.c,v 1.18 1995/12/14 14:25:03 peter Exp $ + * $Id: mfs_vfsops.c,v 1.19 1995/12/14 20:16:15 bde Exp $ */ #include <sys/param.h> @@ -68,16 +68,24 @@ # include <i386/i386/cons.h> /* console IO */ #endif -extern int mfs_imageload __P((dev_t dev, caddr_t addr, int size)); +static int mfs_imageload __P((dev_t dev, caddr_t addr, int size)); extern int mfs_initminiroot __P((caddr_t base)); -caddr_t mfs_rootbase; /* address of mini-root in kernel virtual memory */ -u_long mfs_rootsize; /* size of mini-root in bytes */ +static caddr_t mfs_rootbase; /* address of mini-root in kernel virtual memory */ +static u_long mfs_rootsize; /* size of mini-root in bytes */ static int mfs_minor; /* used for building internal dev_t */ extern vop_t **mfs_vnodeop_p; +static int mfs_mount __P((struct mount *mp, + char *path, caddr_t data, struct nameidata *ndp, + struct proc *p)); +static int mfs_start __P((struct mount *mp, int flags, struct proc *p)); +static int mfs_statfs __P((struct mount *mp, struct statfs *sbp, + struct proc *p)); +static int mfs_init __P((void)); + /* * mfs vfs operations. */ @@ -99,8 +107,8 @@ VFS_SET(mfs_vfsops, mfs, MOUNT_MFS, 0); #ifdef MFS_ROOT -u_char mfs_root[MFS_ROOT*1024] = "MFS Filesystem goes here"; -u_char end_mfs_root[] = "MFS Filesystem had better STOP here"; +static u_char mfs_root[MFS_ROOT*1024] = "MFS Filesystem goes here"; +static u_char end_mfs_root[] = "MFS Filesystem had better STOP here"; #ifdef MFS_AUTOLOAD /* @@ -114,7 +122,7 @@ u_char end_mfs_root[] = "MFS Filesystem had better STOP here"; */ #define IMAGE_BLOCKING (32 * 1024) -int +static int mfs_imageload (dev, addr, size) dev_t dev; caddr_t addr; @@ -211,7 +219,7 @@ out: * namei() if it is a genuine NULL from the user. */ /* ARGSUSED */ -int +static int mfs_mount(mp, path, data, ndp, p) register struct mount *mp; char *path; @@ -421,7 +429,7 @@ success: } -int mfs_pri = PWAIT | PCATCH; /* XXX prob. temp */ +static int mfs_pri = PWAIT | PCATCH; /* XXX prob. temp */ /* * Used to grab the process and keep it in the kernel to service @@ -432,7 +440,7 @@ int mfs_pri = PWAIT | PCATCH; /* XXX prob. temp */ * address space. */ /* ARGSUSED */ -int +static int mfs_start(mp, flags, p) struct mount *mp; int flags; @@ -476,7 +484,7 @@ mfs_start(mp, flags, p) /* * Get file system statistics. */ -int +static int mfs_statfs(mp, sbp, p) struct mount *mp; struct statfs *sbp; @@ -488,3 +496,12 @@ mfs_statfs(mp, sbp, p) sbp->f_type = MOUNT_MFS; return (error); } + +/* + * Memory based filesystem initialization. + */ +static int +mfs_init() +{ + return (0); +} diff --git a/sys/ufs/mfs/mfs_vnops.c b/sys/ufs/mfs/mfs_vnops.c index f780d2f..62f941c 100644 --- a/sys/ufs/mfs/mfs_vnops.c +++ b/sys/ufs/mfs/mfs_vnops.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)mfs_vnops.c 8.3 (Berkeley) 9/21/93 - * $Id: mfs_vnops.c,v 1.11 1995/10/31 10:45:48 peter Exp $ + * $Id: mfs_vnops.c,v 1.12 1995/11/09 08:14:29 bde Exp $ */ #include <sys/param.h> @@ -57,11 +57,20 @@ struct map mfsmap[MFS_MAPSIZE]; extern char mfsiobuf[]; #endif +static int mfs_badop __P((void)); +static int mfs_bmap __P((struct vop_bmap_args *)); +static int mfs_close __P((struct vop_close_args *)); +static int mfs_ioctl __P((struct vop_ioctl_args *)); +static int mfs_inactive __P((struct vop_inactive_args *)); /* XXX */ +static int mfs_open __P((struct vop_open_args *)); +static int mfs_print __P((struct vop_print_args *)); /* XXX */ +static int mfs_reclaim __P((struct vop_reclaim_args *)); /* XXX */ +static int mfs_strategy __P((struct vop_strategy_args *)); /* XXX */ /* * mfs vnode operations. */ vop_t **mfs_vnodeop_p; -struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { +static struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_default_desc, (vop_t *)vn_default_error }, { &vop_lookup_desc, (vop_t *)mfs_lookup }, /* lookup */ { &vop_create_desc, (vop_t *)mfs_create }, /* create */ @@ -105,7 +114,7 @@ struct vnodeopv_entry_desc mfs_vnodeop_entries[] = { { &vop_bwrite_desc, (vop_t *)mfs_bwrite }, /* bwrite */ { NULL, NULL } }; -struct vnodeopv_desc mfs_vnodeop_opv_desc = +static struct vnodeopv_desc mfs_vnodeop_opv_desc = { &mfs_vnodeop_p, mfs_vnodeop_entries }; VNODEOP_SET(mfs_vnodeop_opv_desc); @@ -118,7 +127,7 @@ VNODEOP_SET(mfs_vnodeop_opv_desc); * so we can tell when we are doing I/O to ourself. */ /* ARGSUSED */ -int +static int mfs_open(ap) struct vop_open_args /* { struct vnode *a_vp; @@ -139,7 +148,7 @@ mfs_open(ap) * Ioctl operation. */ /* ARGSUSED */ -int +static int mfs_ioctl(ap) struct vop_ioctl_args /* { struct vnode *a_vp; @@ -157,7 +166,7 @@ mfs_ioctl(ap) /* * Pass I/O requests to the memory filesystem process. */ -int +static int mfs_strategy(ap) struct vop_strategy_args /* { struct buf *a_bp; @@ -215,7 +224,7 @@ mfs_doio(bp, base) /* * This is a noop, simply returning what one has been given. */ -int +static int mfs_bmap(ap) struct vop_bmap_args /* { struct vnode *a_vp; @@ -239,7 +248,7 @@ mfs_bmap(ap) * Memory filesystem close routine */ /* ARGSUSED */ -int +static int mfs_close(ap) struct vop_close_args /* { struct vnode *a_vp; @@ -288,7 +297,7 @@ mfs_close(ap) * Memory filesystem inactive routine */ /* ARGSUSED */ -int +static int mfs_inactive(ap) struct vop_inactive_args /* { struct vnode *a_vp; @@ -305,7 +314,7 @@ mfs_inactive(ap) /* * Reclaim a memory filesystem devvp so that it can be reused. */ -int +static int mfs_reclaim(ap) struct vop_reclaim_args /* { struct vnode *a_vp; @@ -320,7 +329,7 @@ mfs_reclaim(ap) /* * Print out the contents of an mfsnode. */ -int +static int mfs_print(ap) struct vop_print_args /* { struct vnode *a_vp; @@ -336,7 +345,7 @@ mfs_print(ap) /* * Block device bad operation */ -int +static int mfs_badop() { @@ -344,11 +353,3 @@ mfs_badop() /* NOTREACHED */ } -/* - * Memory based filesystem initialization. - */ -int -mfs_init() -{ - return (0); -} |