Source-Changes-HG archive

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

[src/trunk]: src/sys/netsmb unifdef -D__NetBSD__



details:   https://anonhg.NetBSD.org/src/rev/49af4cc25836
branches:  trunk
changeset: 759825:49af4cc25836
user:      pooka <pooka%NetBSD.org@localhost>
date:      Fri Dec 17 13:05:29 2010 +0000

description:
unifdef -D__NetBSD__

diffstat:

 sys/netsmb/iconv.h       |   50 +-----------------
 sys/netsmb/smb_conn.c    |  101 +------------------------------------
 sys/netsmb/smb_conn.h    |    7 +--
 sys/netsmb/smb_dev.c     |  128 +----------------------------------------------
 sys/netsmb/smb_iod.c     |    9 +--
 sys/netsmb/smb_rq.c      |    7 +-
 sys/netsmb/smb_subr.h    |    4 +-
 sys/netsmb/subr_mchain.c |    6 +-
 8 files changed, 13 insertions(+), 299 deletions(-)

diffs (truncated from 550 to 300 lines):

diff -r 32b05f9774eb -r 49af4cc25836 sys/netsmb/iconv.h
--- a/sys/netsmb/iconv.h        Fri Dec 17 12:14:03 2010 +0000
+++ b/sys/netsmb/iconv.h        Fri Dec 17 13:05:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: iconv.h,v 1.9 2008/06/24 10:37:19 gmcgarry Exp $       */
+/*     $NetBSD: iconv.h,v 1.10 2010/12/17 13:05:29 pooka Exp $ */
 
 /*
  * Copyright (c) 2000-2001, Boris Popov
@@ -82,49 +82,6 @@
 
 #else /* !_KERNEL */
 
-#ifndef __NetBSD__
-#include <sys/kobj.h>
-#include <sys/queue.h>                 /* can't avoid that */
-#include <sys/sysctl.h>                        /* can't avoid that */
-
-struct iconv_cspair;
-struct iconv_cspairdata;
-
-/*
- * iconv converter class definition
- */
-struct iconv_converter_class {
-       KOBJ_CLASS_FIELDS;
-       TAILQ_ENTRY(iconv_converter_class)      cc_link;
-};
-
-struct iconv_cspair {
-       int             cp_id;          /* unique id of charset pair */
-       int             cp_refcount;    /* number of references from other pairs */
-       const char *    cp_from;
-       const char *    cp_to;
-       void *          cp_data;
-       struct iconv_converter_class * cp_dcp;
-       struct iconv_cspair *cp_base;
-       TAILQ_ENTRY(iconv_cspair)       cp_link;
-};
-
-#define        KICONV_CONVERTER(name,size)                             \
-    static DEFINE_CLASS(iconv_ ## name, iconv_ ## name ## _methods, (size)); \
-    static moduledata_t iconv_ ## name ## _mod = {     \
-       "iconv_"#name, iconv_converter_handler,         \
-       (void*)&iconv_ ## name ## _class                \
-    };                                                 \
-    DECLARE_MODULE(iconv_ ## name, iconv_ ## name ## _mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
-
-#define        KICONV_CES(name,size)                           \
-    static DEFINE_CLASS(iconv_ces_ ## name, iconv_ces_ ## name ## _methods, (size)); \
-    static moduledata_t iconv_ces_ ## name ## _mod = { \
-       "iconv_ces_"#name, iconv_cesmod_handler,        \
-       (void*)&iconv_ces_ ## name ## _class            \
-    };                                                 \
-    DECLARE_MODULE(iconv_ces_ ## name, iconv_ces_ ## name ## _mod, SI_SUB_DRIVERS, SI_ORDER_ANY);
-#endif /* !NetBSD */
 
 #ifdef MALLOC_DECLARE
 MALLOC_DECLARE(M_ICONV);
@@ -144,11 +101,6 @@
  */
 int iconv_lookupcp(const char **, const char *);
 
-#ifndef __NetBSD__
-int iconv_converter_initstub(struct iconv_converter_class *);
-int iconv_converter_donestub(struct iconv_converter_class *);
-int iconv_converter_handler(module_t, int, void *);
-#endif /* !NetBSD */
 
 #ifdef ICONV_DEBUG
 #define ICDEBUG(x)     aprint_debug x
diff -r 32b05f9774eb -r 49af4cc25836 sys/netsmb/smb_conn.c
--- a/sys/netsmb/smb_conn.c     Fri Dec 17 12:14:03 2010 +0000
+++ b/sys/netsmb/smb_conn.c     Fri Dec 17 13:05:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smb_conn.c,v 1.26 2010/07/01 13:00:56 hannken Exp $    */
+/*     $NetBSD: smb_conn.c,v 1.27 2010/12/17 13:05:29 pooka Exp $      */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_conn.c,v 1.26 2010/07/01 13:00:56 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_conn.c,v 1.27 2010/12/17 13:05:29 pooka Exp $");
 
 /*
  * Connection engine.
@@ -88,9 +88,6 @@
 static struct smb_connobj smb_vclist;
 static int smb_vcnext = 1;     /* next unique id for VC */
 
-#ifndef __NetBSD__
-SYSCTL_NODE(_net, OID_AUTO, smb, CTLFLAG_RW, NULL, "SMB protocol");
-#endif
 
 MALLOC_DEFINE(M_SMBCONN, "SMB conn", "SMB connection");
 
@@ -103,12 +100,6 @@
 static smb_co_free_t smb_share_free;
 static smb_co_gone_t smb_share_gone;
 
-#ifndef __NetBSD__
-static int  smb_sysctl_treedump(SYSCTL_HANDLER_ARGS);
-
-SYSCTL_PROC(_net_smb, OID_AUTO, treedump, CTLFLAG_RD | CTLTYPE_OPAQUE,
-           NULL, 0, smb_sysctl_treedump, "S,treedump", "Requester tree");
-#endif
 
 int
 smb_sm_init(void)
@@ -708,25 +699,6 @@
        return smb_emptypass;
 }
 
-#ifndef __NetBSD__
-static int
-smb_vc_getinfo(struct smb_vc *vcp, struct smb_vc_info *vip)
-{
-       memset(vip, 0, sizeof(struct smb_vc_info));
-       vip->itype = SMB_INFO_VC;
-       vip->usecount = vcp->obj.co_usecount;
-       vip->uid = vcp->vc_uid;
-       vip->gid = vcp->vc_grp;
-       vip->mode = vcp->vc_mode;
-       vip->flags = vcp->obj.co_flags;
-       vip->sopt = vcp->vc_sopt;
-       vip->iodstate = vcp->vc_iod->iod_state;
-       memset(&vip->sopt.sv_skey, 0, sizeof(vip->sopt.sv_skey));
-       snprintf(vip->srvname, sizeof(vip->srvname), "%s", vcp->vc_srvname);
-       snprintf(vip->vcname, sizeof(vip->vcname), "%s", vcp->vc_username);
-       return 0;
-}
-#endif
 
 u_short
 smb_vc_nextmid(struct smb_vc *vcp)
@@ -905,73 +877,4 @@
        return smb_emptypass;
 }
 
-#ifndef __NetBSD__
-static int
-smb_share_getinfo(struct smb_share *ssp, struct smb_share_info *sip)
-{
-       memset(sip, 0, sizeof(struct smb_share_info));
-       sip->itype = SMB_INFO_SHARE;
-       sip->usecount = ssp->obj.co_usecount;
-       sip->tid  = ssp->ss_tid;
-       sip->type= ssp->ss_type;
-       sip->uid = ssp->ss_uid;
-       sip->gid = ssp->ss_grp;
-       sip->mode= ssp->ss_mode;
-       sip->flags = ssp->obj.co_flags;
-       snprintf(sip->sname, sizeof(sip->sname), "%s", ssp->ss_name);
-       return 0;
-}
-#endif
 
-#ifndef __NetBSD__
-/*
- * Dump an entire tree into sysctl call
- */
-static int
-smb_sysctl_treedump(SYSCTL_HANDLER_ARGS)
-{
-       struct smb_cred scred;
-       struct smb_vc *vcp;
-       struct smb_share *ssp;
-       struct smb_vc_info vci;
-       struct smb_share_info ssi;
-       int error, itype;
-
-       smb_makescred(&scred, td, td->td_proc->p_cred);
-       error = smb_sm_lockvclist(LK_SHARED);
-       if (error)
-               return error;
-       SMBCO_FOREACH((struct smb_connobj*)vcp, &smb_vclist) {
-               error = smb_vc_lock(vcp, LK_SHARED);
-               if (error)
-                       continue;
-               smb_vc_getinfo(vcp, &vci);
-               error = SYSCTL_OUT(req, &vci, sizeof(struct smb_vc_info));
-               if (error) {
-                       smb_vc_unlock(vcp, 0);
-                       break;
-               }
-               SMBCO_FOREACH((struct smb_connobj*)ssp, VCTOCP(vcp)) {
-                       error = smb_share_lock(ssp, LK_SHARED);
-                       if (error) {
-                               error = 0;
-                               continue;
-                       }
-                       smb_share_getinfo(ssp, &ssi);
-                       smb_share_unlock(ssp, 0);
-                       error = SYSCTL_OUT(req, &ssi, sizeof(struct smb_share_info));
-                       if (error)
-                               break;
-               }
-               smb_vc_unlock(vcp, 0);
-               if (error)
-                       break;
-       }
-       if (!error) {
-               itype = SMB_INFO_NONE;
-               error = SYSCTL_OUT(req, &itype, sizeof(itype));
-       }
-       smb_sm_unlockvclist();
-       return error;
-}
-#endif
diff -r 32b05f9774eb -r 49af4cc25836 sys/netsmb/smb_conn.h
--- a/sys/netsmb/smb_conn.h     Fri Dec 17 12:14:03 2010 +0000
+++ b/sys/netsmb/smb_conn.h     Fri Dec 17 13:05:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smb_conn.h,v 1.19 2009/03/18 15:14:32 cegger Exp $     */
+/*     $NetBSD: smb_conn.h,v 1.20 2010/12/17 13:05:29 pooka Exp $      */
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -445,12 +445,7 @@
        SIMPLEQ_HEAD(, smb_rq)
                                iod_rqlist;     /* list of outstanding requests */
        int                     iod_muxwant;
-#ifdef __NetBSD__
        struct lwp *            iod_l;
-#else
-       struct proc *           iod_p;
-       struct thread *         iod_td;
-#endif
        struct smb_cred         iod_scred;
        struct smb_slock        iod_evlock;     /* iod_evlist */
        SIMPLEQ_HEAD(,smbiod_event) iod_evlist;
diff -r 32b05f9774eb -r 49af4cc25836 sys/netsmb/smb_dev.c
--- a/sys/netsmb/smb_dev.c      Fri Dec 17 12:14:03 2010 +0000
+++ b/sys/netsmb/smb_dev.c      Fri Dec 17 13:05:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: smb_dev.c,v 1.36 2010/12/15 12:58:13 ahoka Exp $       */
+/*     $NetBSD: smb_dev.c,v 1.37 2010/12/17 13:05:29 pooka Exp $       */
 
 /*
  * Copyright (c) 2000-2001 Boris Popov
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.36 2010/12/15 12:58:13 ahoka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smb_dev.c,v 1.37 2010/12/17 13:05:29 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -67,31 +67,10 @@
 #include <netsmb/smb_dev.h>
 #include <netsmb/smb_rq.h>
 
-#ifdef __NetBSD__
 static struct smb_dev **smb_devtbl; /* indexed by minor */
 #define SMB_GETDEV(dev) (smb_devtbl[minor(dev)])
 #define NSMB_DEFNUM    4
 
-#else /* !NetBSD */
-
-#define SMB_GETDEV(dev)                ((struct smb_dev*)(dev)->si_drv1)
-
-static d_open_t         nsmb_dev_open;
-static d_close_t nsmb_dev_close;
-static d_read_t         nsmb_dev_read;
-static d_write_t nsmb_dev_write;
-static d_ioctl_t nsmb_dev_ioctl;
-static d_poll_t         nsmb_dev_poll;
-
-MODULE_DEPEND(netsmb, libiconv, 1, 1, 1);
-MODULE_VERSION(netsmb, NSMB_VERSION);
-
-static int smb_version = NSMB_VERSION;
-
-
-SYSCTL_DECL(_net_smb);
-SYSCTL_INT(_net_smb, OID_AUTO, version, CTLFLAG_RD, &smb_version, 0, "");
-#endif /* NetBSD */
 
 static MALLOC_DEFINE(M_NSMBDEV, "NETSMBDEV", "NET/SMB device");
 
@@ -100,7 +79,6 @@
 int smb_dev_queue(struct smb_dev *ndp, struct smb_rq *rqp, int prio);
 */
 
-#ifdef __NetBSD__
 dev_type_open(nsmb_dev_open);
 dev_type_close(nsmb_dev_close);
 dev_type_ioctl(nsmb_dev_ioctl);
@@ -109,40 +87,7 @@
        nsmb_dev_open, nsmb_dev_close, noread, nowrite,
        nsmb_dev_ioctl, nostop, notty, nopoll, nommap, nokqfilter, D_OTHER,
 };
-#else
-static struct cdevsw nsmb_cdevsw = {
-       /* open */      nsmb_dev_open,
-       /* close */     nsmb_dev_close,



Home | Main Index | Thread Index | Old Index