Remove unnecessary "#if __FreeBSD_version".
This commit is contained in:
parent
555767b49c
commit
52c8a1f983
@ -179,13 +179,9 @@ nsmb_dev_close(dev_t dev, int flag, int fmt, struct proc *p)
|
||||
smb_flushq(&sdp->sd_rqlist);
|
||||
smb_flushq(&sdp->sd_rplist);
|
||||
*/
|
||||
#if __FreeBSD_version > 400001
|
||||
dev->si_drv1 = NULL;
|
||||
free(sdp, M_NSMBDEV);
|
||||
destroy_dev(dev);
|
||||
#else
|
||||
sdp->sd_flags &= ~NSMBFL_OPEN;
|
||||
#endif
|
||||
splx(s);
|
||||
return 0;
|
||||
}
|
||||
@ -368,24 +364,16 @@ nsmb_dev_load(module_t mod, int cmd, void *arg)
|
||||
smb_sm_done();
|
||||
break;
|
||||
}
|
||||
#if __FreeBSD_version > 400001
|
||||
cdevsw_add(&nsmb_cdevsw);
|
||||
#endif
|
||||
#if __FreeBSD_version > 500000
|
||||
nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 0, 1000);
|
||||
#endif
|
||||
printf("netsmb_dev: loaded\n");
|
||||
break;
|
||||
case MOD_UNLOAD:
|
||||
smb_iod_done();
|
||||
error = smb_sm_done();
|
||||
error = 0;
|
||||
#if __FreeBSD_version > 500000
|
||||
EVENTHANDLER_DEREGISTER(dev_clone, nsmb_dev_tag);
|
||||
#endif
|
||||
#if __FreeBSD_version > 400001
|
||||
cdevsw_remove(&nsmb_cdevsw);
|
||||
#endif
|
||||
printf("netsmb_dev: unloaded\n");
|
||||
break;
|
||||
default:
|
||||
@ -395,12 +383,7 @@ nsmb_dev_load(module_t mod, int cmd, void *arg)
|
||||
return error;
|
||||
}
|
||||
|
||||
#if __FreeBSD_version > 400000
|
||||
DEV_MODULE (dev_netsmb, nsmb_dev_load, 0);
|
||||
#else
|
||||
CDEV_MODULE(dev_netsmb, NSMB_MAJOR, nsmb_cdevsw, nsmb_dev_load, 0);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Convert a file descriptor to appropriate smb_share pointer
|
||||
|
@ -70,13 +70,6 @@ smb_makescred(struct smb_cred *scred, struct proc *p, struct ucred *cred)
|
||||
int
|
||||
smb_proc_intr(struct proc *p)
|
||||
{
|
||||
#if __FreeBSD_version < 400009
|
||||
|
||||
if (p && p->p_siglist &&
|
||||
(((p->p_siglist & ~p->p_sigmask) & ~p->p_sigignore) & SMB_SIGMASK))
|
||||
return EINTR;
|
||||
return 0;
|
||||
#else
|
||||
sigset_t tmpset;
|
||||
|
||||
if (p == NULL)
|
||||
@ -87,7 +80,6 @@ smb_proc_intr(struct proc *p)
|
||||
if (SIGNOTEMPTY(p->p_siglist) && SMB_SIGMASK(tmpset))
|
||||
return EINTR;
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -42,15 +42,7 @@
|
||||
MALLOC_DECLARE(M_SMBTEMP);
|
||||
#endif
|
||||
|
||||
#if __FreeBSD_version > 500000
|
||||
#define FB_CURRENT
|
||||
#else
|
||||
# if __FreeBSD_version > 400000
|
||||
# define FB_RELENG4
|
||||
# else
|
||||
# error "Unsupported version of FreeBSD"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define SMBERROR(format, args...) printf("%s: "format, __FUNCTION__ ,## args)
|
||||
#define SMBPANIC(format, args...) printf("%s: "format, __FUNCTION__ ,## args)
|
||||
@ -73,41 +65,16 @@ void m_dumpm(struct mbuf *m);
|
||||
#define m_dumpm(m)
|
||||
#endif
|
||||
|
||||
#if __FreeBSD_version > 400009
|
||||
#define SMB_SIGMASK(set) \
|
||||
(SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \
|
||||
SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \
|
||||
SIGISMEMBER(set, SIGQUIT))
|
||||
|
||||
#define smb_suser(cred) suser_xxx(cred, NULL, 0)
|
||||
#else
|
||||
#define SMB_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \
|
||||
sigmask(SIGHUP)|sigmask(SIGQUIT))
|
||||
|
||||
#define smb_suser(cred) suser((cred), NULL)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compatibility wrappers for simple locks
|
||||
*/
|
||||
#if __FreeBSD_version < 500000
|
||||
|
||||
#include <sys/lock.h>
|
||||
|
||||
#define lockdestroy(lock)
|
||||
#define smb_slock simplelock
|
||||
#define smb_sl_init(mtx, desc) simple_lock_init(mtx)
|
||||
#define smb_sl_destroy(mtx)
|
||||
#define smb_sl_lock(mtx) simple_lock(mtx)
|
||||
#define smb_sl_unlock(mtx) simple_unlock(mtx)
|
||||
/*
|
||||
#define mtx lock
|
||||
#define mtx_init(mtx, desc, flags) lockinit(mtx, PWAIT, desc, 0, 0)
|
||||
#define mtx_lock(mtx) lockmgr(mtx, LK_EXCLUSIVE, NULL, curproc)
|
||||
#define mtx_unlock(mtx) lockmgr(mtx, LK_RELEASE, NULL, curproc)
|
||||
#define mtx_destroy(mtx)
|
||||
*/
|
||||
#else
|
||||
|
||||
#include <sys/mutex.h>
|
||||
|
||||
@ -117,7 +84,6 @@ void m_dumpm(struct mbuf *m);
|
||||
#define smb_sl_lock(mtx) mtx_lock(mtx)
|
||||
#define smb_sl_unlock(mtx) mtx_unlock(mtx)
|
||||
|
||||
#endif
|
||||
|
||||
#define SMB_STRFREE(p) do { if (p) smb_strfree(p); } while(0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user