git: b09b03a19d26 - main - smbfs: ansify
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 07 Feb 2023 23:35:28 UTC
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=b09b03a19d26e63046f3413cc8be2e4ece08daff commit b09b03a19d26e63046f3413cc8be2e4ece08daff Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2023-02-07 23:35:11 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2023-02-07 23:35:11 +0000 smbfs: ansify Reported by: clang 15 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sys/fs/smbfs/smbfs_io.c | 17 +--- sys/fs/smbfs/smbfs_node.c | 10 +-- sys/fs/smbfs/smbfs_vfsops.c | 7 +- sys/fs/smbfs/smbfs_vnops.c | 184 ++++++-------------------------------------- 4 files changed, 30 insertions(+), 188 deletions(-) diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index f92fe50ccd99..0927ec420cf5 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -413,13 +413,7 @@ smbfs_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td * Wish wish .... get rid from multiple IO routines */ int -smbfs_getpages(ap) - struct vop_getpages_args /* { - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_reqpage; - } */ *ap; +smbfs_getpages(struct vop_getpages_args *ap) { #ifdef SMBFS_RWGENERIC return vop_stdgetpages(ap); @@ -544,14 +538,7 @@ out: * not necessary to open vnode. */ int -smbfs_putpages(ap) - struct vop_putpages_args /* { - struct vnode *a_vp; - vm_page_t *a_m; - int a_count; - int a_sync; - int *a_rtvals; - } */ *ap; +smbfs_putpages(struct vop_putpages_args *ap) { int error; struct vnode *vp = ap->a_vp; diff --git a/sys/fs/smbfs/smbfs_node.c b/sys/fs/smbfs/smbfs_node.c index ef47aa4cd623..bc690af5dbf1 100644 --- a/sys/fs/smbfs/smbfs_node.c +++ b/sys/fs/smbfs/smbfs_node.c @@ -257,10 +257,7 @@ smbfs_nget(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, * Free smbnode, and give vnode back to system */ int -smbfs_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; +smbfs_reclaim(struct vop_reclaim_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *dvp; @@ -296,10 +293,7 @@ smbfs_reclaim(ap) } int -smbfs_inactive(ap) - struct vop_inactive_args /* { - struct vnode *a_vp; - } */ *ap; +smbfs_inactive(struct vop_inactive_args *ap) { struct thread *td = curthread; struct ucred *cred = td->td_ucred; diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index 9d6fa9274e36..d37633b550dd 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -349,12 +349,7 @@ out: */ /* ARGSUSED */ static int -smbfs_quotactl(mp, cmd, uid, arg, mp_busy) - struct mount *mp; - int cmd; - uid_t uid; - void *arg; - bool *mp_busy; +smbfs_quotactl(struct mount *mp, int cmd, uid_t uid, void *arg, bool *mp_busy) { SMBVDEBUG("return EOPNOTSUPP\n"); return EOPNOTSUPP; diff --git a/sys/fs/smbfs/smbfs_vnops.c b/sys/fs/smbfs/smbfs_vnops.c index 1b1bb35e9749..58369b5b2676 100644 --- a/sys/fs/smbfs/smbfs_vnops.c +++ b/sys/fs/smbfs/smbfs_vnops.c @@ -116,13 +116,7 @@ struct vop_vector smbfs_vnodeops = { VFS_VOP_VECTOR_REGISTER(smbfs_vnodeops); static int -smbfs_access(ap) - struct vop_access_args /* { - struct vnode *a_vp; - accmode_t a_accmode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +smbfs_access(struct vop_access_args *ap) { struct vnode *vp = ap->a_vp; accmode_t accmode = ap->a_accmode; @@ -145,13 +139,7 @@ smbfs_access(ap) /* ARGSUSED */ static int -smbfs_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +smbfs_open(struct vop_open_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -220,14 +208,7 @@ smbfs_open(ap) } static int -smbfs_close(ap) - struct vop_close_args /* { - struct vnodeop_desc *a_desc; - struct vnode *a_vp; - int a_fflag; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +smbfs_close(struct vop_close_args *ap) { struct vnode *vp = ap->a_vp; struct thread *td = ap->a_td; @@ -249,12 +230,7 @@ smbfs_close(ap) * smbfs_getattr call from vfs. */ static int -smbfs_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +smbfs_getattr(struct vop_getattr_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -287,12 +263,7 @@ smbfs_getattr(ap) } static int -smbfs_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +smbfs_setattr(struct vop_setattr_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -489,13 +460,7 @@ out: * smbfs_read call. */ static int -smbfs_read(ap) - struct vop_read_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +smbfs_read(struct vop_read_args *ap) { struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; @@ -507,13 +472,7 @@ smbfs_read(ap) } static int -smbfs_write(ap) - struct vop_write_args /* { - struct vnode *a_vp; - struct uio *a_uio; - int a_ioflag; - struct ucred *a_cred; - } */ *ap; +smbfs_write(struct vop_write_args *ap) { struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; @@ -531,13 +490,7 @@ smbfs_write(ap) * the pathname buffer pointed at by cnp->cn_pnbuf, always on error. */ static int -smbfs_create(ap) - struct vop_create_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +smbfs_create(struct vop_create_args *ap) { struct vnode *dvp = ap->a_dvp; struct vattr *vap = ap->a_vap; @@ -579,13 +532,7 @@ out: } static int -smbfs_remove(ap) - struct vop_remove_args /* { - struct vnodeop_desc *a_desc; - struct vnode * a_dvp; - struct vnode * a_vp; - struct componentname * a_cnp; - } */ *ap; +smbfs_remove(struct vop_remove_args *ap) { struct vnode *vp = ap->a_vp; /* struct vnode *dvp = ap->a_dvp;*/ @@ -610,15 +557,7 @@ smbfs_remove(ap) * smbfs_file rename call */ static int -smbfs_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; +smbfs_rename(struct vop_rename_args *ap) { struct vnode *fvp = ap->a_fvp; struct vnode *tvp = ap->a_tvp; @@ -714,12 +653,7 @@ out: * somtime it will come true... */ static int -smbfs_link(ap) - struct vop_link_args /* { - struct vnode *a_tdvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +smbfs_link(struct vop_link_args *ap) { return EOPNOTSUPP; } @@ -729,34 +663,19 @@ smbfs_link(ap) * Sometime it will be functional... */ static int -smbfs_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; +smbfs_symlink(struct vop_symlink_args *ap) { return EOPNOTSUPP; } static int -smbfs_mknod(ap) - struct vop_mknod_args /* { - } */ *ap; +smbfs_mknod(struct vop_mknod_args *ap) { return EOPNOTSUPP; } static int -smbfs_mkdir(ap) - struct vop_mkdir_args /* { - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - struct vattr *a_vap; - } */ *ap; +smbfs_mkdir(struct vop_mkdir_args *ap) { struct vnode *dvp = ap->a_dvp; /* struct vattr *vap = ap->a_vap;*/ @@ -772,7 +691,7 @@ smbfs_mkdir(ap) if ((error = VOP_GETATTR(dvp, &vattr, cnp->cn_cred))) { return error; - } + } if ((name[0] == '.') && ((len == 1) || ((len == 2) && (name[1] == '.')))) return EEXIST; scred = smbfs_malloc_scred(); @@ -796,12 +715,7 @@ out: * smbfs_remove directory call */ static int -smbfs_rmdir(ap) - struct vop_rmdir_args /* { - struct vnode *a_dvp; - struct vnode *a_vp; - struct componentname *a_cnp; - } */ *ap; +smbfs_rmdir(struct vop_rmdir_args *ap) { struct vnode *vp = ap->a_vp; struct vnode *dvp = ap->a_dvp; @@ -832,15 +746,7 @@ smbfs_rmdir(ap) * smbfs_readdir call */ static int -smbfs_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - uint64_t *a_cookies; - int a_ncookies; - } */ *ap; +smbfs_readdir(struct vop_readdir_args *ap) { struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; @@ -860,24 +766,14 @@ smbfs_readdir(ap) /* ARGSUSED */ static int -smbfs_fsync(ap) - struct vop_fsync_args /* { - struct vnodeop_desc *a_desc; - struct vnode * a_vp; - struct ucred * a_cred; - int a_waitfor; - struct thread * a_td; - } */ *ap; +smbfs_fsync(struct vop_fsync_args *ap) { /* return (smb_flush(ap->a_vp, ap->a_cred, ap->a_waitfor, ap->a_td, 1));*/ return (0); } -static -int smbfs_print (ap) - struct vop_print_args /* { - struct vnode *a_vp; - } */ *ap; +static +int smbfs_print(struct vop_print_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -892,12 +788,7 @@ int smbfs_print (ap) } static int -smbfs_pathconf (ap) - struct vop_pathconf_args /* { - struct vnode *vp; - int name; - register_t *retval; - } */ *ap; +smbfs_pathconf(struct vop_pathconf_args *ap) { struct smbmount *smp = VFSTOSMBFS(VTOVFS(ap->a_vp)); struct smb_vc *vcp = SSTOVC(smp->sm_share); @@ -928,10 +819,7 @@ smbfs_pathconf (ap) } static int -smbfs_strategy (ap) - struct vop_strategy_args /* { - struct buf *a_bp - } */ *ap; +smbfs_strategy(struct vop_strategy_args *ap) { struct buf *bp=ap->a_bp; struct ucred *cr; @@ -953,15 +841,7 @@ smbfs_strategy (ap) } int -smbfs_ioctl(ap) - struct vop_ioctl_args /* { - struct vnode *a_vp; - u_long a_command; - caddr_t a_data; - int fflag; - struct ucred *cred; - struct thread *td; - } */ *ap; +smbfs_ioctl(struct vop_ioctl_args *ap) { return ENOTTY; } @@ -1000,7 +880,6 @@ smbfs_getextattr(struct vop_getextattr_args *ap) buf[i] = (attr & 1) ? smbfs_atl[i] : '-'; buf[i] = 0; error = uiomove(buf, i, uio); - } else error = EINVAL; return error; @@ -1012,14 +891,7 @@ smbfs_getextattr(struct vop_getextattr_args *ap) * a callback mechanism because it will help to improve a level of consistency. */ int -smbfs_advlock(ap) - struct vop_advlock_args /* { - struct vnode *a_vp; - caddr_t a_id; - int a_op; - struct flock *a_fl; - int a_flags; - } */ *ap; +smbfs_advlock(struct vop_advlock_args *ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); @@ -1168,13 +1040,7 @@ smbfs_pathcheck(struct smbmount *smp, const char *name, int nmlen, int nameiop) * Things go even weird without fixed inode numbers... */ int -smbfs_lookup(ap) - struct vop_lookup_args /* { - struct vnodeop_desc *a_desc; - struct vnode *a_dvp; - struct vnode **a_vpp; - struct componentname *a_cnp; - } */ *ap; +smbfs_lookup(struct vop_lookup_args *ap) { struct componentname *cnp = ap->a_cnp; struct thread *td = curthread;