Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/smbfs couple cosmetic changes:



details:   https://anonhg.NetBSD.org/src/rev/30c9a021066a
branches:  trunk
changeset: 543152:30c9a021066a
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Tue Feb 18 10:27:17 2003 +0000

description:
couple cosmetic changes:
* g/c superfluous printfs
* use vcp on one more place
* don't need to check result of allocation with M_WAITOK
* just exlicitly return (0) on the success path, rather than return (error)

diffstat:

 sys/fs/smbfs/smbfs_vfsops.c |  21 +++++++--------------
 1 files changed, 7 insertions(+), 14 deletions(-)

diffs (57 lines):

diff -r b1a91889f658 -r 30c9a021066a sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c       Tue Feb 18 10:24:58 2003 +0000
+++ b/sys/fs/smbfs/smbfs_vfsops.c       Tue Feb 18 10:27:17 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smbfs_vfsops.c,v 1.7 2003/02/16 19:35:16 jdolecek Exp $        */
+/*     $NetBSD: smbfs_vfsops.c,v 1.8 2003/02/18 10:27:17 jdolecek Exp $        */
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -128,10 +128,6 @@
        size_t size;
        int error;
 
-       if (data == NULL) {
-               printf("missing data argument\n");
-               return EINVAL;
-       }
        if (mp->mnt_flag & MNT_GETARGS) {
                smp = VFSTOSMBFS(mp);
                if (smp == NULL)
@@ -153,22 +149,19 @@
        }
        smb_makescred(&scred, p, p->p_ucred);
        error = smb_dev2share(args.dev, SMBM_EXEC, &scred, &ssp);
-       if (error) {
-               printf("invalid device handle %d (%d)\n", args.dev, error);
+       if (error)
                return error;
-       }
+       smb_share_unlock(ssp, 0);
        vcp = SSTOVC(ssp);
-       smb_share_unlock(ssp, 0);
-       mp->mnt_stat.f_iosize = SSTOVC(ssp)->vc_txmax;
+       mp->mnt_stat.f_iosize = vcp->vc_txmax;
 
         MALLOC(smp, struct smbmount *, sizeof(*smp), M_SMBFSDATA, M_WAITOK);
        memset(smp, 0, sizeof(*smp));
+        mp->mnt_data = smp;
 
-        mp->mnt_data = smp;
        smp->sm_hash = hashinit(desiredvnodes, HASH_LIST, 
                                M_SMBFSHASH, M_WAITOK, &smp->sm_hashlen);
-       if (smp->sm_hash == NULL)
-               goto bad;
+
        lockinit(&smp->sm_hashlock, PVFS, "smbfsh", 0, 0);
        smp->sm_share = ssp;
        smp->sm_root = NULL;
@@ -203,7 +196,7 @@
 #ifdef DIAGNOSTICS
        SMBERROR("mp=%p\n", mp);
 #endif
-       return error;
+       return (0);
 
 bad:
         if (smp) {



Home | Main Index | Thread Index | Old Index