From da9a088d4676db35fa67b6b641ac38140e5d8e26 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Mon, 24 Feb 2003 09:30:42 +0000 Subject: [PATCH] SMBERROR() purge - replace with KASSERT()s, panic or remove altogether as appropriate --- sys/fs/smbfs/smbfs_io.c | 9 ++++----- sys/fs/smbfs/smbfs_smb.c | 17 +++++++++-------- sys/fs/smbfs/smbfs_vfsops.c | 5 +---- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/sys/fs/smbfs/smbfs_io.c b/sys/fs/smbfs/smbfs_io.c index d0d22008af38..1bb9372b5cc1 100644 --- a/sys/fs/smbfs/smbfs_io.c +++ b/sys/fs/smbfs/smbfs_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_io.c,v 1.7 2003/02/23 19:35:14 jdolecek Exp $ */ +/* $NetBSD: smbfs_io.c,v 1.8 2003/02/24 09:30:42 jdolecek Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -237,10 +237,9 @@ smbfs_writevnode(struct vnode *vp, struct uio *uiop, struct proc *p; int error = 0; - if (vp->v_type != VREG) { - SMBERROR("vn types other than VREG unsupported !\n"); - return EIO; - } + /* vn types other than VREG unsupported */ + KASSERT(vp->v_type == VREG); + SMBVDEBUG("ofs=%d,resid=%d\n",(int)uiop->uio_offset, uiop->uio_resid); if (uiop->uio_offset < 0) return EINVAL; diff --git a/sys/fs/smbfs/smbfs_smb.c b/sys/fs/smbfs/smbfs_smb.c index e468b00c15b2..1ddce0eb518d 100644 --- a/sys/fs/smbfs/smbfs_smb.c +++ b/sys/fs/smbfs/smbfs_smb.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_smb.c,v 1.8 2003/02/23 22:03:11 christos Exp $ */ +/* $NetBSD: smbfs_smb.c,v 1.9 2003/02/24 09:30:43 jdolecek Exp $ */ /* * Copyright (c) 2000-2001 Boris Popov @@ -283,7 +283,6 @@ smbfs_smb_setpattr(struct smbnode *np, u_int16_t attr, struct timespec *mtime, mb_put_uint8(mbp, 0); smb_rq_bend(rqp); error = smb_rq_simple(rqp); - SMBERROR("%d\n", error); if (error) break; } while(0); @@ -1113,9 +1112,11 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx, int limit) fxsz = 64; recsz = next ? next : fxsz + size; break; +#ifdef DIAGNOSTIC default: - SMBERROR("unexpected info level %d\n", ctx->f_infolevel); - return EINVAL; + panic("smbfs_findnextLM2: unexpected info level %d\n", + ctx->f_infolevel); +#endif } nmlen = min(size, SMB_MAXFNAMELEN); cp = ctx->f_name; @@ -1126,10 +1127,10 @@ smbfs_findnextLM2(struct smbfs_fctx *ctx, int limit) cnt = next - nmlen - fxsz; if (cnt > 0) md_get_mem(mbp, NULL, cnt, MB_MSYSTEM); - else if (cnt < 0) { - SMBERROR("out of sync\n"); - return EBADRPC; - } +#ifdef DIAGNOSTIC + else if (cnt < 0) + panic("smbfs_findnextLM2: out of sync"); +#endif } if (nmlen && cp[nmlen - 1] == 0) nmlen--; diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index b198d57688e2..69dfbde53242 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_vfsops.c,v 1.14 2003/02/23 22:31:17 jdolecek Exp $ */ +/* $NetBSD: smbfs_vfsops.c,v 1.15 2003/02/24 09:30:43 jdolecek Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -186,9 +186,6 @@ smbfs_mount(struct mount *mp, const char *path, void *data, VOP_UNLOCK(vp, 0); SMBVDEBUG("root.v_usecount = %d\n", vp->v_usecount); -#ifdef DIAGNOSTICS - SMBERROR("mp=%p\n", mp); -#endif return (0); bad: