summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-06-17 17:16:53 +0000
committerphk <phk@FreeBSD.org>2004-06-17 17:16:53 +0000
commit40dd98a3bd2049465e7644b361b60da41a46efa0 (patch)
treefe8b297144afd6d6f7db41275c72cb5eb663ec02
parent9acfe1e733142ca875624a3acbf96c4ff27b36a4 (diff)
downloadFreeBSD-src-40dd98a3bd2049465e7644b361b60da41a46efa0.zip
FreeBSD-src-40dd98a3bd2049465e7644b361b60da41a46efa0.tar.gz
Second half of the dev_t cleanup.
The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
-rw-r--r--lib/libkvm/kvm_proc.c2
-rw-r--r--sys/cam/scsi/scsi_target.c2
-rw-r--r--sys/coda/coda.h2
-rw-r--r--sys/coda/coda_fbsd.c2
-rw-r--r--sys/coda/coda_venus.c2
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c4
-rw-r--r--sys/compat/linux/linux_stats.c8
-rw-r--r--sys/compat/svr4/svr4_socket.c2
-rw-r--r--sys/compat/svr4/svr4_socket.h4
-rw-r--r--sys/compat/svr4/svr4_stream.c2
-rw-r--r--sys/compat/svr4/svr4_types.h4
-rw-r--r--sys/dev/cp/if_cp.c4
-rw-r--r--sys/dev/ctau/if_ct.c4
-rw-r--r--sys/dev/cx/if_cx.c4
-rw-r--r--sys/dev/cy/cy.c2
-rw-r--r--sys/dev/dcons/dcons.c2
-rw-r--r--sys/dev/digi/digi.c2
-rw-r--r--sys/dev/firewire/fwdev.c2
-rw-r--r--sys/dev/led/led.c4
-rw-r--r--sys/dev/nmdm/nmdm.c2
-rw-r--r--sys/dev/snp/snp.c14
-rw-r--r--sys/dev/sound/pcm/dsp.c2
-rw-r--r--sys/dev/sound/pcm/mixer.c2
-rw-r--r--sys/dev/syscons/syscons.c2
-rw-r--r--sys/dev/vinum/vinum.c2
-rw-r--r--sys/dev/vinum/vinumconfig.c4
-rw-r--r--sys/dev/vinum/vinumio.c2
-rw-r--r--sys/fs/cd9660/cd9660_node.h2
-rw-r--r--sys/fs/cd9660/cd9660_rrip.c4
-rw-r--r--sys/fs/coda/coda.h2
-rw-r--r--sys/fs/coda/coda_fbsd.c2
-rw-r--r--sys/fs/coda/coda_venus.c2
-rw-r--r--sys/fs/devfs/devfs_vnops.c8
-rw-r--r--sys/fs/specfs/spec_vnops.c2
-rw-r--r--sys/geom/geom_dev.c2
-rw-r--r--sys/isofs/cd9660/cd9660_node.h2
-rw-r--r--sys/isofs/cd9660/cd9660_rrip.c4
-rw-r--r--sys/kern/kern_acct.c2
-rw-r--r--sys/kern/kern_conf.c62
-rw-r--r--sys/kern/kern_proc.c4
-rw-r--r--sys/kern/kern_shutdown.c2
-rw-r--r--sys/kern/tty_cons.c6
-rw-r--r--sys/kern/tty_pty.c4
-rw-r--r--sys/kern/tty_tty.c2
-rw-r--r--sys/kern/uipc_usrreq.c2
-rw-r--r--sys/kern/vfs_bio.c8
-rw-r--r--sys/kern/vfs_mount.c12
-rw-r--r--sys/kern/vfs_subr.c16
-rw-r--r--sys/net/bpf.c2
-rw-r--r--sys/net/if_tap.c2
-rw-r--r--sys/net/if_tun.c2
-rw-r--r--sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c28
-rw-r--r--sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c14
-rw-r--r--sys/netsmb/smb_dev.c4
-rw-r--r--sys/nfs4client/nfs4_vn_subs.c2
-rw-r--r--sys/nfsclient/nfs_subs.c2
-rw-r--r--sys/nfsserver/nfs_serv.c2
-rw-r--r--sys/sys/_types.h5
-rw-r--r--sys/sys/acct.h2
-rw-r--r--sys/sys/conf.h2
-rw-r--r--sys/sys/param.h9
-rw-r--r--sys/sys/snoop.h4
-rw-r--r--sys/sys/stat.h10
-rw-r--r--sys/sys/systm.h9
-rw-r--r--sys/sys/tty.h4
-rw-r--r--sys/sys/types.h6
-rw-r--r--sys/sys/user.h2
-rw-r--r--sys/sys/vnode.h12
-rw-r--r--sys/vm/swap_pager.c12
-rw-r--r--sys/vm/vm_param.h2
-rw-r--r--usr.bin/fstat/fstat.c12
-rw-r--r--usr.bin/fstat/fstat.h2
-rw-r--r--usr.bin/pkill/pkill.c2
73 files changed, 186 insertions, 205 deletions
diff --git a/lib/libkvm/kvm_proc.c b/lib/libkvm/kvm_proc.c
index 1fc196c..5f846f6 100644
--- a/lib/libkvm/kvm_proc.c
+++ b/lib/libkvm/kvm_proc.c
@@ -251,7 +251,7 @@ kvm_proclist(kd, what, arg, p, bp, maxcnt)
"can't read tty at %x", sess.s_ttyp);
return (-1);
}
- kp->ki_tdev = tty.t_dev;
+ kp->ki_tdev = tty.t_dev; /* XXX: wrong */
if (tty.t_pgrp != NULL) {
if (KREAD(kd, (u_long)tty.t_pgrp, &pgrp)) {
_kvm_err(kd, kd->program,
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index f3739ea..198a70d 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -1035,7 +1035,7 @@ targclone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name, NULL, "targ", &u) != 1)
return;
diff --git a/sys/coda/coda.h b/sys/coda/coda.h
index 90e7e2a..5fb352e 100644
--- a/sys/coda/coda.h
+++ b/sys/coda/coda.h
@@ -87,7 +87,7 @@ typedef unsigned long long u_quad_t;
typedef unsigned long long u_quad_t;
#endif
#else
-#define cdev_t udev_t
+#define cdev_t dev_t
#endif
#ifdef __CYGWIN32__
diff --git a/sys/coda/coda_fbsd.c b/sys/coda/coda_fbsd.c
index 0ce6e46..89d4de0 100644
--- a/sys/coda/coda_fbsd.c
+++ b/sys/coda/coda_fbsd.c
@@ -186,7 +186,7 @@ static void coda_fbsd_clone(arg, name, namelen, dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name,NULL,"cfs",&u) != 1)
return;
diff --git a/sys/coda/coda_venus.c b/sys/coda/coda_venus.c
index f0bc3c2..7e4d321 100644
--- a/sys/coda/coda_venus.c
+++ b/sys/coda/coda_venus.c
@@ -212,7 +212,7 @@ venus_open(void *mdp, CodaFid *fid, int flag,
error = coda_call(mdp, Isize, &Osize, (char *)inp);
if (!error) {
- *dev = udev2dev(outp->dev);
+ *dev = findcdev(outp->dev);
*inode = outp->inode;
}
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index 999af87..6ff5910 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -1083,13 +1083,13 @@ freebsd32_sendfile(struct thread *td, struct freebsd32_sendfile_args *uap)
}
struct stat32 {
- udev_t st_dev;
+ dev_t st_dev;
ino_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
- udev_t st_rdev;
+ dev_t st_rdev;
struct timespec32 st_atimespec;
struct timespec32 st_mtimespec;
struct timespec32 st_ctimespec;
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 4a02042..a9545fd 100644
--- a/sys/compat/linux/linux_stats.c
+++ b/sys/compat/linux/linux_stats.c
@@ -76,7 +76,7 @@ newstat_copyout(struct stat *buf, void *ubuf)
* in FreeBSD but block devices under Linux.
*/
if (S_ISCHR(tbuf.st_mode) &&
- (dev = udev2dev(buf->st_rdev)) != NODEV) {
+ (dev = findcdev(buf->st_rdev)) != NULL) {
cdevsw = devsw(dev);
if (cdevsw != NULL && (cdevsw->d_flags & D_DISK)) {
tbuf.st_mode &= ~S_IFMT;
@@ -365,8 +365,8 @@ linux_ustat(struct thread *td, struct linux_ustat_args *args)
* struct cdev *returned from previous syscalls. Just return a bzeroed
* ustat in that case.
*/
- dev = udev2dev(makeudev(args->dev >> 8, args->dev & 0xFF));
- if (dev != NODEV && vfinddev(dev, &vp)) {
+ dev = findcdev(makedev(args->dev >> 8, args->dev & 0xFF));
+ if (dev != NULL && vfinddev(dev, &vp)) {
if (vp->v_mount == NULL)
return (EINVAL);
#ifdef MAC
@@ -414,7 +414,7 @@ stat64_copyout(struct stat *buf, void *ubuf)
* in FreeBSD but block devices under Linux.
*/
if (S_ISCHR(lbuf.st_mode) &&
- (dev = udev2dev(buf->st_rdev)) != NODEV) {
+ (dev = findcdev(buf->st_rdev)) != NULL) {
cdevsw = devsw(dev);
if (cdevsw != NULL && (cdevsw->d_flags & D_DISK)) {
lbuf.st_mode &= ~S_IFMT;
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index 95014e0..65126d7 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -67,7 +67,7 @@ struct sockaddr_un *
svr4_find_socket(td, fp, dev, ino)
struct thread *td;
struct file *fp;
- udev_t dev;
+ dev_t dev;
ino_t ino;
{
struct svr4_sockcache_entry *e;
diff --git a/sys/compat/svr4/svr4_socket.h b/sys/compat/svr4/svr4_socket.h
index b4b38f9..1df1e43 100644
--- a/sys/compat/svr4/svr4_socket.h
+++ b/sys/compat/svr4/svr4_socket.h
@@ -49,7 +49,7 @@ struct svr4_sockaddr_in {
};
struct sockaddr_un *svr4_find_socket(struct thread *, struct file *,
- udev_t, ino_t);
+ dev_t, ino_t);
void svr4_delete_socket(struct proc *, struct file *);
int svr4_add_socket(struct thread *, const char *, struct stat *);
@@ -57,7 +57,7 @@ struct svr4_sockcache_entry {
struct proc *p; /* Process for the socket */
void *cookie; /* Internal cookie used for matching */
struct sockaddr_un sock;/* Pathname for the socket */
- udev_t dev; /* Device where the socket lives on */
+ dev_t dev; /* Device where the socket lives on */
ino_t ino; /* Inode where the socket lives on */
TAILQ_ENTRY(svr4_sockcache_entry) entries;
};
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index db7eabc..853a272 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -1873,7 +1873,7 @@ svr4_do_putmsg(td, uap, fp)
}
else {
/* Maybe we've been given a device/inode pair */
- udev_t *dev = SVR4_ADDROF(&sc);
+ dev_t *dev = SVR4_ADDROF(&sc);
ino_t *ino = (ino_t *) &dev[1];
skp = svr4_find_socket(td, fp, *dev, *ino);
if (skp == NULL) {
diff --git a/sys/compat/svr4/svr4_types.h b/sys/compat/svr4/svr4_types.h
index 3421647..410746b 100644
--- a/sys/compat/svr4/svr4_types.h
+++ b/sys/compat/svr4/svr4_types.h
@@ -68,14 +68,14 @@ typedef struct timespec svr4_timestruc_t;
#define svr4_omakedev(x,y) ((svr4_o_dev_t)((((x) << 8) & 0x7f00) | \
(((y) << 0) & 0x00ff)))
-#define svr4_to_bsd_odev_t(d) makeudev(svr4_omajor(d), svr4_ominor(d))
+#define svr4_to_bsd_odev_t(d) makedev(svr4_omajor(d), svr4_ominor(d))
#define bsd_to_svr4_odev_t(d) svr4_omakedev(umajor(d), uminor(d))
#define svr4_major(x) ((int32_t)((((x) & 0xfffc0000) >> 18)))
#define svr4_minor(x) ((int32_t)((((x) & 0x0003ffff) >> 0)))
#define svr4_makedev(x,y) ((svr4_dev_t)((((x) << 18) & 0xfffc0000) | \
(((y) << 0) & 0x0003ffff)))
-#define svr4_to_bsd_dev_t(d) makeudev(svr4_major(d), svr4_minor(d))
+#define svr4_to_bsd_dev_t(d) makedev(svr4_major(d), svr4_minor(d))
#define bsd_to_svr4_dev_t(d) svr4_makedev(umajor(d), uminor(d))
#endif /* !_SVR4_TYPES_H_ */
diff --git a/sys/dev/cp/if_cp.c b/sys/dev/cp/if_cp.c
index 04427c3..13b3019 100644
--- a/sys/dev/cp/if_cp.c
+++ b/sys/dev/cp/if_cp.c
@@ -2657,13 +2657,13 @@ static int cp_modevent (module_t mod, int type, void *unused)
struct cdevsw *cdsw;
#if __FreeBSD_version >= 502103
- dev = udev2dev (makeudev(CDEV_MAJOR, 0));
+ dev = findcdev (makedev(CDEV_MAJOR, 0));
#else
dev = makedev (CDEV_MAJOR, 0);
#endif
switch (type) {
case MOD_LOAD:
- if (dev != NODEV &&
+ if (dev != NULL &&
(cdsw = devsw (dev)) &&
cdsw->d_maj == CDEV_MAJOR) {
printf ("Tau-PCI driver is already in system\n");
diff --git a/sys/dev/ctau/if_ct.c b/sys/dev/ctau/if_ct.c
index a7462ab..de07c71 100644
--- a/sys/dev/ctau/if_ct.c
+++ b/sys/dev/ctau/if_ct.c
@@ -2629,13 +2629,13 @@ static int ct_modevent (module_t mod, int type, void *unused)
struct cdevsw *cdsw;
#if __FreeBSD_version >= 502103
- dev = udev2dev (makeudev(CDEV_MAJOR, 0));
+ dev = findcdev (makedev(CDEV_MAJOR, 0));
#else
dev = makedev (CDEV_MAJOR, 0);
#endif
switch (type) {
case MOD_LOAD:
- if (dev != NODEV &&
+ if (dev != NULL &&
(cdsw = devsw (dev)) &&
cdsw->d_maj == CDEV_MAJOR) {
printf ("Tau-ISA driver is already in system\n");
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 45c7f9e..b6b55c7 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -3177,13 +3177,13 @@ static int cx_modevent (module_t mod, int type, void *unused)
struct cdevsw *cdsw;
#if __FreeBSD_version >= 502103
- dev = udev2dev (makeudev(CDEV_MAJOR, 0));
+ dev = findcdev (makedev(CDEV_MAJOR, 0));
#else
dev = makedev (CDEV_MAJOR, 0);
#endif
switch (type) {
case MOD_LOAD:
- if (dev != NODEV &&
+ if (dev != NULL &&
(cdsw = devsw (dev)) &&
cdsw->d_maj == CDEV_MAJOR) {
printf ("Sigma driver is already in system\n");
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index 7808ecb..53e038d 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -162,7 +162,7 @@ __FBSDID("$FreeBSD$");
#define MINOR_MAGIC_MASK (CALLOUT_MASK | CONTROL_MASK)
/*
* Not all of the magic is parametrized in the following macros. 16 and
- * 0xff are related to the bitfields in a udev_t. CY_MAX_PORTS must be
+ * 0xff are related to the bitfields in a dev_t. CY_MAX_PORTS must be
* ((0xff & ~MINOR_MAGIC_MASK) + 1) for things to work.
*/
#define MINOR_TO_UNIT(mynor) (((mynor) >> 16) * CY_MAX_PORTS \
diff --git a/sys/dev/dcons/dcons.c b/sys/dev/dcons/dcons.c
index 5bdbbfb..c1b320d 100644
--- a/sys/dev/dcons/dcons.c
+++ b/sys/dev/dcons/dcons.c
@@ -598,7 +598,7 @@ dcons_modevent(module_t mode, int type, void *data)
#if CONS_NODEV
gdb_arg = NULL;
#else
- gdbdev = NODEV;
+ gdbdev = NULL;
#endif
#endif
#if __FreeBSD_version >= 500000
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index c330290..2d9184c 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -1017,7 +1017,7 @@ digi_loadmoduledata(struct digi_softc *sc)
modfile = malloc(modlen + 6, M_TEMP, M_WAITOK);
snprintf(modfile, modlen + 6, "digi_%s", sc->module);
if ((res = linker_reference_module(modfile, NULL, &lf)) != 0) {
- if (res == ENOENT && rootdev == NODEV)
+ if (res == ENOENT && rootdev == NULL)
printf("%s: Failed to autoload module: No filesystem\n",
modfile);
else
diff --git a/sys/dev/firewire/fwdev.c b/sys/dev/firewire/fwdev.c
index 5d10415..cffb636 100644
--- a/sys/dev/firewire/fwdev.c
+++ b/sys/dev/firewire/fwdev.c
@@ -848,7 +848,7 @@ fwdev_clone(void *arg, char *name, int namelen, struct cdev **dev)
int devflag[NDEVTYPE] = {0, FWMEM_FLAG};
int i, unit = 0, sub = 0;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
for (i = 0; i < NDEVTYPE; i++)
diff --git a/sys/dev/led/led.c b/sys/dev/led/led.c
index 4c19e27..df9f27e 100644
--- a/sys/dev/led/led.c
+++ b/sys/dev/led/led.c
@@ -234,13 +234,13 @@ led_create(led_t *func, void *priv, char const *name)
sb = sbuf_new(NULL, NULL, SPECNAMELEN, SBUF_FIXEDLEN);
if (sb == NULL)
- return (NODEV);
+ return (NULL);
sbuf_cpy(sb, "led/");
sbuf_cat(sb, name);
sbuf_finish(sb);
if (sbuf_overflowed(sb)) {
sbuf_delete(sb);
- return (NODEV);
+ return (NULL);
}
sc = malloc(sizeof *sc, M_LED, M_WAITOK | M_ZERO);
diff --git a/sys/dev/nmdm/nmdm.c b/sys/dev/nmdm/nmdm.c
index 683d06b..e27347b 100644
--- a/sys/dev/nmdm/nmdm.c
+++ b/sys/dev/nmdm/nmdm.c
@@ -100,7 +100,7 @@ nmdm_clone(void *arg, char *name, int nameen, struct cdev **dev)
char *p;
struct cdev *d1, *d2;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (strcmp(name, "nmdm") == 0) {
p = NULL;
diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c
index 752dc42..6544810 100644
--- a/sys/dev/snp/snp.c
+++ b/sys/dev/snp/snp.c
@@ -406,7 +406,7 @@ snpopen(dev, flag, mode, td)
* snp_tty == NULL is for inactive snoop devices.
*/
snp->snp_tty = NULL;
- snp->snp_target = NODEV;
+ snp->snp_target = NULL;
LIST_INSERT_HEAD(&snp_sclist, snp, snp_list);
return (0);
@@ -439,7 +439,7 @@ snp_detach(snp)
printf("snp%d: bad attached tty data\n", snp->snp_unit);
snp->snp_tty = NULL;
- snp->snp_target = NODEV;
+ snp->snp_target = NULL;
detach_notty:
selwakeuppri(&snp->snp_sel, PZERO + 1);
@@ -500,8 +500,8 @@ snpioctl(dev, cmd, data, flags, td)
snp = dev->si_drv1;
switch (cmd) {
case SNPSTTY:
- tdev = udev2dev(*((udev_t *)data));
- if (tdev == NODEV)
+ tdev = findcdev(*((dev_t *)data));
+ if (tdev == NULL)
return (snp_down(snp));
tp = snpdevtotty(tdev);
@@ -512,7 +512,7 @@ snpioctl(dev, cmd, data, flags, td)
s = spltty();
- if (snp->snp_target == NODEV) {
+ if (snp->snp_target == NULL) {
tpo = snp->snp_tty;
if (tpo)
tpo->t_state &= ~TS_SNOOP;
@@ -540,7 +540,7 @@ snpioctl(dev, cmd, data, flags, td)
* SNPGTTY happy, else we can't know what is device
* major/minor for tty.
*/
- *((udev_t *)data) = dev2udev(snp->snp_target);
+ *((dev_t *)data) = dev2udev(snp->snp_target);
break;
case FIONBIO:
@@ -609,7 +609,7 @@ snp_clone(arg, name, namelen, dev)
{
int u, i;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name, NULL, "snp", &u) != 1)
return;
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 9200941..29fe27f 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -1123,7 +1123,7 @@ dsp_clone(void *arg, char *name, int namelen, struct cdev **dev)
int devtypes[3] = {SND_DEV_DSP, SND_DEV_DSP16, SND_DEV_AUDIO};
char *devnames[3] = {"dsp", "dspW", "audio"};
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (pcm_devclass == NULL)
return;
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 47812fe..135a628 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -483,7 +483,7 @@ mixer_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
struct snddev_info *sd;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (strcmp(name, "mixer") == 0) {
sd = devclass_get_softc(pcm_devclass, snd_unit);
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c
index 12f0739..6c1a549 100644
--- a/sys/dev/syscons/syscons.c
+++ b/sys/dev/syscons/syscons.c
@@ -2622,7 +2622,7 @@ sc_change_cursor_shape(scr_stat *scp, int flags, int base, int height)
}
for (i = sc->first_vty; i < sc->first_vty + sc->vtys; ++i) {
- if ((dev = SC_DEV(sc, i)) == NODEV)
+ if ((dev = SC_DEV(sc, i)) == NULL)
continue;
if ((scp = sc_get_stat(dev)) == NULL)
continue;
diff --git a/sys/dev/vinum/vinum.c b/sys/dev/vinum/vinum.c
index 3306c96..062176b 100644
--- a/sys/dev/vinum/vinum.c
+++ b/sys/dev/vinum/vinum.c
@@ -522,7 +522,7 @@ vinum_clone(void *arg, char *name, int namelen, struct cdev ** dev)
struct volume *vol;
int i;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (strncmp(name, "vinum/", sizeof("vinum/") - 1) != 0)
return;
diff --git a/sys/dev/vinum/vinumconfig.c b/sys/dev/vinum/vinumconfig.c
index 8c7e038..989af88 100644
--- a/sys/dev/vinum/vinumconfig.c
+++ b/sys/dev/vinum/vinumconfig.c
@@ -476,7 +476,7 @@ get_empty_drive(void)
bzero(drive, sizeof(struct drive));
drive->driveno = driveno; /* put number in structure */
drive->flags |= VF_NEWBORN; /* newly born drive */
- drive->dev = NODEV;
+ drive->dev = NULL;
strcpy(drive->devicename, "unknown"); /* and make the name ``unknown'' */
return driveno; /* return the index */
}
@@ -595,7 +595,7 @@ free_drive(struct drive *drive)
close_locked_drive(drive); /* close it */
if (drive->freelist)
Free(drive->freelist);
- if (drive->dev != NODEV)
+ if (drive->dev != NULL)
dev_rel(drive->dev);
bzero(drive, sizeof(struct drive)); /* this also sets drive_unallocated */
unlockdrive(drive);
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index e77291e..7edde1d 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -56,7 +56,7 @@ open_drive(struct drive *drive, struct thread *td, int verbose)
return EBUSY; /* don't do it again */
drive->dev = getdiskbyname(drive->devicename);
- if (drive->dev == NODEV) /* didn't find anything */
+ if (drive->dev == NULL) /* didn't find anything */
return ENOENT;
dev_ref(drive->dev);
diff --git a/sys/fs/cd9660/cd9660_node.h b/sys/fs/cd9660/cd9660_node.h
index a5b228c..fb74f39 100644
--- a/sys/fs/cd9660/cd9660_node.h
+++ b/sys/fs/cd9660/cd9660_node.h
@@ -52,7 +52,7 @@ typedef struct {
uid_t iso_uid; /* owner user id */
gid_t iso_gid; /* owner group id */
short iso_links; /* links of file */
- udev_t iso_rdev; /* Major/Minor number for special */
+ dev_t iso_rdev; /* Major/Minor number for special */
} ISO_RRIP_INODE;
diff --git a/sys/fs/cd9660/cd9660_rrip.c b/sys/fs/cd9660/cd9660_rrip.c
index 48eac6d..f20b4db 100644
--- a/sys/fs/cd9660/cd9660_rrip.c
+++ b/sys/fs/cd9660/cd9660_rrip.c
@@ -413,9 +413,9 @@ cd9660_rrip_device(p,ana)
low = isonum_733(p->dev_t_low);
if (high == 0)
- ana->inop->inode.iso_rdev = makeudev(umajor(low), uminor(low));
+ ana->inop->inode.iso_rdev = makedev(umajor(low), uminor(low));
else
- ana->inop->inode.iso_rdev = makeudev(high, uminor(low));
+ ana->inop->inode.iso_rdev = makedev(high, uminor(low));
ana->fields &= ~ISO_SUSP_DEVICE;
return ISO_SUSP_DEVICE;
}
diff --git a/sys/fs/coda/coda.h b/sys/fs/coda/coda.h
index 90e7e2a..5fb352e 100644
--- a/sys/fs/coda/coda.h
+++ b/sys/fs/coda/coda.h
@@ -87,7 +87,7 @@ typedef unsigned long long u_quad_t;
typedef unsigned long long u_quad_t;
#endif
#else
-#define cdev_t udev_t
+#define cdev_t dev_t
#endif
#ifdef __CYGWIN32__
diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c
index 0ce6e46..89d4de0 100644
--- a/sys/fs/coda/coda_fbsd.c
+++ b/sys/fs/coda/coda_fbsd.c
@@ -186,7 +186,7 @@ static void coda_fbsd_clone(arg, name, namelen, dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name,NULL,"cfs",&u) != 1)
return;
diff --git a/sys/fs/coda/coda_venus.c b/sys/fs/coda/coda_venus.c
index f0bc3c2..7e4d321 100644
--- a/sys/fs/coda/coda_venus.c
+++ b/sys/fs/coda/coda_venus.c
@@ -212,7 +212,7 @@ venus_open(void *mdp, CodaFid *fid, int flag,
error = coda_call(mdp, Isize, &Osize, (char *)inp);
if (!error) {
- *dev = udev2dev(outp->dev);
+ *dev = findcdev(outp->dev);
*inode = outp->inode;
}
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index cbc836a..2d7468a 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -140,7 +140,7 @@ loop:
if (dev == NULL)
return (ENOENT);
} else {
- dev = NODEV;
+ dev = NULL;
}
error = getnewvnode("devfs", mp, devfs_vnodeop_p, &vp);
if (error != 0) {
@@ -382,9 +382,9 @@ devfs_lookupx(ap)
if (pname == NULL)
goto notfound;
- cdev = NODEV;
+ cdev = NULL;
EVENTHANDLER_INVOKE(dev_clone, pname, strlen(pname), &cdev);
- if (cdev == NODEV)
+ if (cdev == NULL)
goto notfound;
devfs_populate(dmp);
@@ -660,7 +660,7 @@ devfs_reclaim(ap)
if (de != NULL)
de->de_vnode = NULL;
vp->v_data = NULL;
- if (vp->v_rdev != NODEV && vp->v_rdev != NULL) {
+ if (vp->v_rdev != NULL && vp->v_rdev != NULL) {
i = vcount(vp);
if ((vp->v_rdev->si_flags & SI_CHEAPCLONE) && i == 0 &&
(vp->v_rdev->si_flags & SI_NAMED))
diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c
index 7d12a58..ec58af6 100644
--- a/sys/fs/specfs/spec_vnops.c
+++ b/sys/fs/specfs/spec_vnops.c
@@ -144,7 +144,7 @@ spec_open(ap)
if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_NODEV))
return (ENXIO);
- if (dev == NODEV)
+ if (dev == NULL)
return (ENXIO);
dsw = devsw(dev);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 54f585e..5c16763 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -103,7 +103,7 @@ g_dev_clone(void *arg __unused, char *name, int namelen __unused, struct cdev **
{
struct g_geom *gp;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
g_waitidle();
diff --git a/sys/isofs/cd9660/cd9660_node.h b/sys/isofs/cd9660/cd9660_node.h
index a5b228c..fb74f39 100644
--- a/sys/isofs/cd9660/cd9660_node.h
+++ b/sys/isofs/cd9660/cd9660_node.h
@@ -52,7 +52,7 @@ typedef struct {
uid_t iso_uid; /* owner user id */
gid_t iso_gid; /* owner group id */
short iso_links; /* links of file */
- udev_t iso_rdev; /* Major/Minor number for special */
+ dev_t iso_rdev; /* Major/Minor number for special */
} ISO_RRIP_INODE;
diff --git a/sys/isofs/cd9660/cd9660_rrip.c b/sys/isofs/cd9660/cd9660_rrip.c
index 48eac6d..f20b4db 100644
--- a/sys/isofs/cd9660/cd9660_rrip.c
+++ b/sys/isofs/cd9660/cd9660_rrip.c
@@ -413,9 +413,9 @@ cd9660_rrip_device(p,ana)
low = isonum_733(p->dev_t_low);
if (high == 0)
- ana->inop->inode.iso_rdev = makeudev(umajor(low), uminor(low));
+ ana->inop->inode.iso_rdev = makedev(umajor(low), uminor(low));
else
- ana->inop->inode.iso_rdev = makeudev(high, uminor(low));
+ ana->inop->inode.iso_rdev = makedev(high, uminor(low));
ana->fields &= ~ISO_SUSP_DEVICE;
return ISO_SUSP_DEVICE;
}
diff --git a/sys/kern/kern_acct.c b/sys/kern/kern_acct.c
index 63d7891..5dca0f6 100644
--- a/sys/kern/kern_acct.c
+++ b/sys/kern/kern_acct.c
@@ -285,7 +285,7 @@ acct_process(td)
if ((p->p_flag & P_CONTROLT) && p->p_pgrp->pg_session->s_ttyp)
acct.ac_tty = dev2udev(p->p_pgrp->pg_session->s_ttyp->t_dev);
else
- acct.ac_tty = NOUDEV;
+ acct.ac_tty = NODEV;
SESS_UNLOCK(p->p_session);
/* (8) The boolean flags that tell how the process terminated, etc. */
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 216a777..b417b73 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -51,7 +51,7 @@ extern unsigned char reserved_majors[256];
/*
* This is the number of hash-buckets. Experiements with 'real-life'
- * udev_t's show that a prime halfway between two powers of two works
+ * dev_t's show that a prime halfway between two powers of two works
* best.
*/
#define DEVT_HASH 83
@@ -70,6 +70,8 @@ SYSCTL_INT(_debug, OID_AUTO, free_devt, CTLFLAG_RW, &free_devt, 0, "");
static struct mtx devmtx;
static void freedev(struct cdev *dev);
+static struct cdev *newdev(int x, int y);
+
static void
devlock(void)
@@ -125,8 +127,6 @@ cdevsw_rel(struct cdevsw *csw)
devunlock();
}
-static struct cdev *makedev(int x, int y);
-
int
nullop(void)
{
@@ -247,16 +247,16 @@ devsw(struct cdev *dev)
int
major(struct cdev *x)
{
- if (x == NODEV)
- return NOUDEV;
+ if (x == NULL)
+ return NODEV;
return((x->si_udev >> 8) & 0xff);
}
int
minor(struct cdev *x)
{
- if (x == NODEV)
- return NOUDEV;
+ if (x == NULL)
+ return NODEV;
return(x->si_udev & 0xffff00ff);
}
@@ -265,8 +265,8 @@ dev2unit(struct cdev *x)
{
int i;
- if (x == NODEV)
- return NOUDEV;
+ if (x == NULL)
+ return NODEV;
i = minor(x);
return ((i & 0xff) | (i >> 8));
}
@@ -304,14 +304,14 @@ allocdev(void)
}
static struct cdev *
-makedev(int x, int y)
+newdev(int x, int y)
{
struct cdev *si;
- udev_t udev;
+ dev_t udev;
int hash;
- if (x == umajor(NOUDEV) && y == uminor(NOUDEV))
- panic("makedev of NOUDEV");
+ if (x == umajor(NODEV) && y == uminor(NODEV))
+ panic("newdev of NODEV");
udev = (x << 8) | y;
hash = udev % DEVT_HASH;
LIST_FOREACH(si, &dev_hash[hash], si_hash) {
@@ -337,48 +337,42 @@ freedev(struct cdev *dev)
}
}
-udev_t
+dev_t
dev2udev(struct cdev *x)
{
- if (x == NODEV)
- return (NOUDEV);
+ if (x == NULL)
+ return (NODEV);
return (x->si_udev);
}
struct cdev *
-udev2dev(udev_t udev)
+findcdev(dev_t udev)
{
struct cdev *si;
int hash;
- if (udev == NOUDEV)
- return (NODEV);
+ if (udev == NODEV)
+ return (NULL);
hash = udev % DEVT_HASH;
LIST_FOREACH(si, &dev_hash[hash], si_hash) {
if (si->si_udev == udev)
return (si);
}
- return (NODEV);
+ return (NULL);
}
int
-uminor(udev_t dev)
+uminor(dev_t dev)
{
return (dev & 0xffff00ff);
}
int
-umajor(udev_t dev)
+umajor(dev_t dev)
{
return ((dev & 0xff00) >> 8);
}
-udev_t
-makeudev(int x, int y)
-{
- return ((x << 8) | y);
-}
-
static void
find_major(struct cdevsw *devsw)
{
@@ -479,7 +473,7 @@ make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, con
if (!(devsw->d_flags & D_INIT))
prep_cdevsw(devsw);
- dev = makedev(devsw->d_maj, minornr);
+ dev = newdev(devsw->d_maj, minornr);
if (dev->si_flags & SI_CHEAPCLONE &&
dev->si_flags & SI_NAMED &&
dev->si_devsw == devsw) {
@@ -750,7 +744,7 @@ clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **
}
if (unit == -1)
unit = low & CLONE_UNITMASK;
- dev = makedev(csw->d_maj, unit2minor(unit | extra));
+ dev = newdev(csw->d_maj, unit2minor(unit | extra));
KASSERT(!(dev->si_flags & SI_CLONELIST),
("Dev %p should not be on clonelist", dev));
if (dl != NULL)
@@ -794,16 +788,16 @@ static int
sysctl_devname(SYSCTL_HANDLER_ARGS)
{
int error;
- udev_t ud;
+ dev_t ud;
struct cdev *dev;
error = SYSCTL_IN(req, &ud, sizeof (ud));
if (error)
return (error);
- if (ud == NOUDEV)
+ if (ud == NODEV)
return(EINVAL);
- dev = udev2dev(ud);
- if (dev == NODEV)
+ dev = findcdev(ud);
+ if (dev == NULL)
error = ENOENT;
else
error = SYSCTL_OUT(req, dev->si_name, strlen(dev->si_name) + 1);
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index daf51b0..c757124 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -800,7 +800,7 @@ fill_kinfo_thread(struct thread *td, struct kinfo_proc *kp)
if (tp->t_session)
kp->ki_tsid = tp->t_session->s_sid;
} else
- kp->ki_tdev = NOUDEV;
+ kp->ki_tdev = NODEV;
if (p->p_comm[0] != '\0') {
strlcpy(kp->ki_comm, p->p_comm, sizeof(kp->ki_comm));
strlcpy(kp->ki_ocomm, p->p_comm, sizeof(kp->ki_ocomm));
@@ -1012,7 +1012,7 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS)
SESS_LOCK(p->p_session);
if (p->p_session->s_ttyp == NULL ||
dev2udev(p->p_session->s_ttyp->t_dev) !=
- (udev_t)name[0]) {
+ (dev_t)name[0]) {
SESS_UNLOCK(p->p_session);
PROC_UNLOCK(p);
continue;
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index 49c6a41..491bc9e 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -324,7 +324,7 @@ boot(int howto)
for (bp = &buf[nbuf]; --bp >= buf; ) {
if (((bp->b_flags&B_INVAL) == 0 && BUF_REFCNT(bp)) ||
((bp->b_flags & (B_DELWRI|B_INVAL)) == B_DELWRI)) {
- if (bp->b_dev == NODEV) {
+ if (bp->b_dev == NULL) {
TAILQ_REMOVE(&mountlist,
bp->b_vp->v_mount, mnt_list);
continue;
diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c
index a9bea7c..e44ea5f 100644
--- a/sys/kern/tty_cons.c
+++ b/sys/kern/tty_cons.c
@@ -103,7 +103,7 @@ static STAILQ_HEAD(, cn_device) cn_devlist =
(cnd == NULL || cnd->cnd_vp == NULL || \
(cnd->cnd_vp->v_type == VBAD && !cn_devopen(cnd, td, 1)))
-static udev_t cn_udev_t;
+static dev_t cn_udev_t;
SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD,
&cn_udev_t, sizeof cn_udev_t, "T,struct cdev *", "");
@@ -371,9 +371,9 @@ sysctl_kern_consmute(SYSCTL_HANDLER_ARGS)
if (error != 0 || req->newptr == NULL)
return (error);
if (ocn_mute && !cn_mute && cn_is_open)
- error = cnopen(NODEV, openflag, 0, curthread);
+ error = cnopen(NULL, openflag, 0, curthread);
else if (!ocn_mute && cn_mute && cn_is_open) {
- error = cnclose(NODEV, openflag, 0, curthread);
+ error = cnclose(NULL, openflag, 0, curthread);
cn_is_open = 1; /* XXX hack */
}
return (error);
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index b4082a3..1e5d202 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -143,7 +143,7 @@ ptyinit(struct cdev *devc)
n = minor(devc);
/* For now we only map the lower 8 bits of the minor */
if (n & ~0xff)
- return (NODEV);
+ return (NULL);
devc->si_flags &= ~SI_CHEAPCLONE;
@@ -777,7 +777,7 @@ pty_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (bcmp(name, "pty", 3) != 0)
return;
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c
index 85b0eac..e467dd3 100644
--- a/sys/kern/tty_tty.c
+++ b/sys/kern/tty_tty.c
@@ -58,7 +58,7 @@ static void
ctty_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (strcmp(name, "tty"))
return;
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 18a4274..16d80b4 100644
--- a/sys/kern/uipc_usrreq.c
+++ b/sys/kern/uipc_usrreq.c
@@ -447,7 +447,7 @@ uipc_sense(struct socket *so, struct stat *sb)
so2 = unp->unp_conn->unp_socket;
sb->st_blksize += so2->so_rcv.sb_cc;
}
- sb->st_dev = NOUDEV;
+ sb->st_dev = NODEV;
if (unp->unp_ino == 0)
unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino;
sb->st_ino = unp->unp_ino;
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 19b6726..1bfb331 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -517,7 +517,7 @@ bufinit(void)
bp = &buf[i];
bzero(bp, sizeof *bp);
bp->b_flags = B_INVAL; /* we're just an empty header */
- bp->b_dev = NODEV;
+ bp->b_dev = NULL;
bp->b_rcred = NOCRED;
bp->b_wcred = NOCRED;
bp->b_qindex = QUEUE_EMPTY;
@@ -1413,7 +1413,7 @@ brelse(struct buf * bp)
bp->b_qindex = QUEUE_EMPTY;
}
TAILQ_INSERT_HEAD(&bufqueues[bp->b_qindex], bp, b_freelist);
- bp->b_dev = NODEV;
+ bp->b_dev = NULL;
/* buffers with junk contents */
} else if (bp->b_flags & (B_INVAL | B_NOCACHE | B_RELBUF) ||
(bp->b_ioflags & BIO_ERROR)) {
@@ -1423,7 +1423,7 @@ brelse(struct buf * bp)
panic("losing buffer 2");
bp->b_qindex = QUEUE_CLEAN;
TAILQ_INSERT_HEAD(&bufqueues[QUEUE_CLEAN], bp, b_freelist);
- bp->b_dev = NODEV;
+ bp->b_dev = NULL;
/* remaining buffers */
} else {
if (bp->b_flags & B_DELWRI)
@@ -1917,7 +1917,7 @@ restart:
bp->b_ioflags = 0;
bp->b_xflags = 0;
bp->b_vflags = 0;
- bp->b_dev = NODEV;
+ bp->b_dev = NULL;
bp->b_vp = NULL;
bp->b_blkno = bp->b_lblkno = 0;
bp->b_offset = NOOFFSET;
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 8eaa6e9..82086ad 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -147,7 +147,7 @@ static char *cdrom_rootdevnames[] = {
/* legacy find-root code */
char *rootdevnames[2] = {NULL, NULL};
static int setrootbyname(char *name);
-struct cdev *rootdev = NODEV;
+struct cdev *rootdev = NULL;
/*
* Has to be dynamic as the value of rootdev can change; however, it can't
@@ -162,7 +162,7 @@ sysctl_rootdev(SYSCTL_HANDLER_ARGS)
/* _RD prevents this from happening. */
KASSERT(req->newptr == NULL, ("Attempt to change root device name"));
- if (rootdev != NODEV)
+ if (rootdev != NULL)
error = sysctl_handle_string(oidp, rootdev->si_name, 0, req);
else
error = sysctl_handle_string(oidp, "", 0, req);
@@ -1339,7 +1339,7 @@ vfs_mountroot_try(char *mountfrom)
printf("setrootbyname failed\n");
/* If the root device is a type "memory disk", mount RW */
- if (rootdev != NODEV && devsw(rootdev) != NULL) {
+ if (rootdev != NULL && devsw(rootdev) != NULL) {
devname = devtoname(rootdev);
if (devname[0] == 'm' && devname[1] == 'd')
mp->mnt_flag &= ~MNT_RDONLY;
@@ -1457,7 +1457,7 @@ getdiskbyname(char *name) {
if (!bcmp(cp, "/dev/", 5))
cp += 5;
- dev = NODEV;
+ dev = NULL;
EVENTHANDLER_INVOKE(dev_clone, cp, strlen(cp), &dev);
return (dev);
}
@@ -1472,7 +1472,7 @@ setrootbyname(char *name)
struct cdev *diskdev;
diskdev = getdiskbyname(name);
- if (diskdev != NODEV) {
+ if (diskdev != NULL) {
rootdev = diskdev;
return (0);
}
@@ -1491,7 +1491,7 @@ DB_SHOW_COMMAND(disk, db_getdiskbyname)
return;
}
dev = getdiskbyname(modif);
- if (dev != NODEV)
+ if (dev != NULL)
db_printf("struct cdev *= %p\n", dev);
else
db_printf("No disk device matched.\n");
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 0346fa2..96fdaab 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -367,7 +367,7 @@ vfs_getnewfsid(mp)
tfsid.val[1] = mtype;
mtype = (mtype & 0xFF) << 24;
for (;;) {
- tfsid.val[0] = makeudev(255,
+ tfsid.val[0] = makedev(255,
mtype | ((mntid_base & 0xFF00) << 8) | (mntid_base & 0xFF));
mntid_base++;
if (vfs_getvfs(&tfsid) == NULL)
@@ -1744,7 +1744,7 @@ bdevvp(dev, vpp)
struct vnode *nvp;
int error;
- if (dev == NODEV) {
+ if (dev == NULL) {
*vpp = NULLVP;
return (ENXIO);
}
@@ -1786,7 +1786,7 @@ v_incr_usecount(struct vnode *vp, int delta)
struct vnode *
addaliasu(nvp, nvp_rdev)
struct vnode *nvp;
- udev_t nvp_rdev;
+ dev_t nvp_rdev;
{
struct vnode *ovp;
vop_t **ops;
@@ -1796,8 +1796,8 @@ addaliasu(nvp, nvp_rdev)
return (nvp);
if (nvp->v_type != VCHR)
panic("addaliasu on non-special vnode");
- dev = udev2dev(nvp_rdev);
- if (dev == NODEV)
+ dev = findcdev(nvp_rdev);
+ if (dev == NULL)
return (nvp);
/*
* Check to see if we have a bdevvp vnode with no associated
@@ -1836,7 +1836,7 @@ addaliasu(nvp, nvp_rdev)
}
/* This is a local helper function that do the same as addaliasu, but for a
- * struct cdev *instead of an udev_t. */
+ * struct cdev *instead of an dev_t. */
static void
addalias(nvp, dev)
struct vnode *nvp;
@@ -2581,7 +2581,7 @@ vgonel(vp, td)
* if it is on one.
*/
VI_LOCK(vp);
- if (vp->v_type == VCHR && vp->v_rdev != NODEV) {
+ if (vp->v_type == VCHR && vp->v_rdev != NULL) {
mtx_lock(&spechash_mtx);
SLIST_REMOVE(&vp->v_rdev->si_hlist, vp, vnode, v_specnext);
vp->v_rdev->si_usecount -= vp->v_usecount;
@@ -3407,7 +3407,7 @@ vn_todev(vp)
{
if (vp->v_type != VCHR)
- return (NODEV);
+ return (NULL);
return (vp->v_rdev);
}
diff --git a/sys/net/bpf.c b/sys/net/bpf.c
index 4b3cf45..189b72fe 100644
--- a/sys/net/bpf.c
+++ b/sys/net/bpf.c
@@ -1578,7 +1578,7 @@ bpf_clone(arg, name, namelen, dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name, NULL, "bpf", &u) != 1)
return;
diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c
index 7f2f856..7eb4ac0 100644
--- a/sys/net/if_tap.c
+++ b/sys/net/if_tap.c
@@ -228,7 +228,7 @@ tapclone(arg, name, namelen, dev)
int i, unit;
char *device_name = name;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
device_name = TAP;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 975b1c0..b5b3298 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -138,7 +138,7 @@ tunclone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u, i;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (strcmp(name, TUNNAME) == 0) {
diff --git a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
index c28e772..1068dad 100644
--- a/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
+++ b/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c
@@ -408,7 +408,7 @@ USB_ATTACH(ubt)
sc->sc_hook = NULL;
/* Device part */
- sc->sc_ctrl_dev = sc->sc_intr_dev = sc->sc_bulk_dev = NODEV;
+ sc->sc_ctrl_dev = sc->sc_intr_dev = sc->sc_bulk_dev = NULL;
sc->sc_refcnt = sc->sc_dying = 0;
/*
@@ -1903,8 +1903,8 @@ ng_ubt_newhook(node_p node, hook_p hook, char const *name)
ubt_softc_p sc = (ubt_softc_p) NG_NODE_PRIVATE(node);
/* Refuse to create new hook if device interface is active */
- if (sc->sc_ctrl_dev != NODEV || sc->sc_intr_dev != NODEV ||
- sc->sc_bulk_dev != NODEV)
+ if (sc->sc_ctrl_dev != NULL || sc->sc_intr_dev != NULL ||
+ sc->sc_bulk_dev != NULL)
return (EBUSY);
if (strcmp(name, NG_UBT_HOOK) != 0)
@@ -1929,8 +1929,8 @@ ng_ubt_connect(hook_p hook)
usbd_status status;
/* Refuse to connect hook if device interface is active */
- if (sc->sc_ctrl_dev != NODEV || sc->sc_intr_dev != NODEV ||
- sc->sc_bulk_dev != NODEV)
+ if (sc->sc_ctrl_dev != NULL || sc->sc_intr_dev != NULL ||
+ sc->sc_bulk_dev != NULL)
return (EBUSY);
NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
@@ -2658,14 +2658,14 @@ ubt_create_device_nodes(ubt_softc_p sc)
"%s: %s - hook != NULL!\n", __func__, USBDEVNAME(sc->sc_dev)));
/* Control device */
- if (sc->sc_ctrl_dev == NODEV)
+ if (sc->sc_ctrl_dev == NULL)
sc->sc_ctrl_dev = make_dev(&ubt_cdevsw,
UBT_MINOR(USBDEVUNIT(sc->sc_dev), 0),
UID_ROOT, GID_OPERATOR, 0644,
"%s", USBDEVNAME(sc->sc_dev));
/* Interrupt device */
- if (sc->sc_intr_dev == NODEV && sc->sc_intr_ep != -1) {
+ if (sc->sc_intr_dev == NULL && sc->sc_intr_ep != -1) {
ep = UE_GET_ADDR(sc->sc_intr_ep);
sc->sc_intr_dev = make_dev(&ubt_cdevsw,
UBT_MINOR(USBDEVUNIT(sc->sc_dev), ep),
@@ -2679,7 +2679,7 @@ ubt_create_device_nodes(ubt_softc_p sc)
* XXX note that address of the in and out endpoint should be the same
*/
- if (sc->sc_bulk_dev == NODEV &&
+ if (sc->sc_bulk_dev == NULL &&
sc->sc_bulk_in_ep != -1 && sc->sc_bulk_out_ep != -1 &&
UE_GET_ADDR(sc->sc_bulk_in_ep) == UE_GET_ADDR(sc->sc_bulk_out_ep)) {
ep = UE_GET_ADDR(sc->sc_bulk_in_ep);
@@ -2712,19 +2712,19 @@ ubt_destroy_device_nodes(ubt_softc_p sc)
sc->sc_refcnt = 0;
/* Destroy device nodes */
- if (sc->sc_bulk_dev != NODEV) {
+ if (sc->sc_bulk_dev != NULL) {
destroy_dev(sc->sc_bulk_dev);
- sc->sc_bulk_dev = NODEV;
+ sc->sc_bulk_dev = NULL;
}
- if (sc->sc_intr_dev != NODEV) {
+ if (sc->sc_intr_dev != NULL) {
destroy_dev(sc->sc_intr_dev);
- sc->sc_intr_dev = NODEV;
+ sc->sc_intr_dev = NULL;
}
- if (sc->sc_ctrl_dev != NODEV) {
+ if (sc->sc_ctrl_dev != NULL) {
destroy_dev(sc->sc_ctrl_dev);
- sc->sc_ctrl_dev = NODEV;
+ sc->sc_ctrl_dev = NULL;
}
} /* ubt_destroy_device_nodes */
diff --git a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
index f957cf5..53f367e 100644
--- a/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
+++ b/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c
@@ -149,7 +149,7 @@ USB_ATTACH(ubtbcmfw)
USB_ATTACH_SETUP;
printf("%s: %s\n", USBDEVNAME(sc->sc_dev), devinfo);
- sc->sc_ctrl_dev = sc->sc_intr_in_dev = sc->sc_bulk_out_dev = NODEV;
+ sc->sc_ctrl_dev = sc->sc_intr_in_dev = sc->sc_bulk_out_dev = NULL;
sc->sc_intr_in_pipe = sc->sc_bulk_out_pipe = NULL;
sc->sc_flags = sc->sc_refcnt = sc->sc_dying = 0;
@@ -229,19 +229,19 @@ USB_DETACH(ubtbcmfw)
}
/* Destroy device nodes */
- if (sc->sc_bulk_out_dev != NODEV) {
+ if (sc->sc_bulk_out_dev != NULL) {
destroy_dev(sc->sc_bulk_out_dev);
- sc->sc_bulk_out_dev = NODEV;
+ sc->sc_bulk_out_dev = NULL;
}
- if (sc->sc_intr_in_dev != NODEV) {
+ if (sc->sc_intr_in_dev != NULL) {
destroy_dev(sc->sc_intr_in_dev);
- sc->sc_intr_in_dev = NODEV;
+ sc->sc_intr_in_dev = NULL;
}
- if (sc->sc_ctrl_dev != NODEV) {
+ if (sc->sc_ctrl_dev != NULL) {
destroy_dev(sc->sc_ctrl_dev);
- sc->sc_ctrl_dev = NODEV;
+ sc->sc_ctrl_dev = NULL;
}
/* Close pipes */
diff --git a/sys/netsmb/smb_dev.c b/sys/netsmb/smb_dev.c
index 78a6068..a69d0f0 100644
--- a/sys/netsmb/smb_dev.c
+++ b/sys/netsmb/smb_dev.c
@@ -103,7 +103,7 @@ nsmb_dev_clone(void *arg, char *name, int namelen, struct cdev **dev)
{
int u;
- if (*dev != NODEV)
+ if (*dev != NULL)
return;
if (dev_stdclone(name, NULL, NSMB_NAME, &u) != 1)
return;
@@ -397,7 +397,7 @@ smb_dev2share(int fd, int mode, struct smb_cred *scred,
return EBADF;
}
dev = vn_todev(vp);
- if (dev == NODEV) {
+ if (dev == NULL) {
fdrop(fp, curthread);
return EBADF;
}
diff --git a/sys/nfs4client/nfs4_vn_subs.c b/sys/nfs4client/nfs4_vn_subs.c
index 28eb52d..cded7f5 100644
--- a/sys/nfs4client/nfs4_vn_subs.c
+++ b/sys/nfs4client/nfs4_vn_subs.c
@@ -83,7 +83,7 @@ nfs4_vnop_loadattrcache(struct vnode *vp, struct nfsv4_fattr *fap,
vtyp = nv3tov_type[fap->fa4_type & 0x7];
vmode = (fap->fa4_valid & FA4V_MODE) ? fap->fa4_mode : 0777;
rdev = (fap->fa4_valid & FA4V_RDEV) ?
- makeudev(fap->fa4_rdev_major, fap->fa4_rdev_minor) : 0;
+ makedev(fap->fa4_rdev_major, fap->fa4_rdev_minor) : 0;
if (fap->fa4_valid & FA4V_MTIME)
mtime = fap->fa4_mtime;
else
diff --git a/sys/nfsclient/nfs_subs.c b/sys/nfsclient/nfs_subs.c
index 6a3fea3..af8f3c3 100644
--- a/sys/nfsclient/nfs_subs.c
+++ b/sys/nfsclient/nfs_subs.c
@@ -495,7 +495,7 @@ nfs_loadattrcache(struct vnode **vpp, struct mbuf **mdp, caddr_t *dposp,
if (v3) {
vtyp = nfsv3tov_type(fp->fa_type);
vmode = fxdr_unsigned(u_short, fp->fa_mode);
- rdev = makeudev(fxdr_unsigned(int, fp->fa3_rdev.specdata1),
+ rdev = makedev(fxdr_unsigned(int, fp->fa3_rdev.specdata1),
fxdr_unsigned(int, fp->fa3_rdev.specdata2));
fxdr_nfsv3time(&fp->fa3_mtime, &mtime);
} else {
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index e578401..a861c39 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -2060,7 +2060,7 @@ nfsrv_mknod(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
tl = nfsm_dissect(u_int32_t *, 2 * NFSX_UNSIGNED);
major = fxdr_unsigned(u_int32_t, *tl++);
minor = fxdr_unsigned(u_int32_t, *tl);
- vap->va_rdev = makeudev(major, minor);
+ vap->va_rdev = makedev(major, minor);
}
/*
diff --git a/sys/sys/_types.h b/sys/sys/_types.h
index 478fd41..0b3467d 100644
--- a/sys/sys/_types.h
+++ b/sys/sys/_types.h
@@ -53,7 +53,6 @@ typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */
typedef __int32_t __timer_t; /* timer_gettime()... */
-typedef __uint32_t __udev_t; /* device number */
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t; /* microseconds (unsigned) */
@@ -80,9 +79,7 @@ typedef __ct_rune_t __rune_t; /* rune_t (see above) */
typedef __ct_rune_t __wchar_t; /* wchar_t (see above) */
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
-#ifndef _KERNEL
-typedef __udev_t __dev_t; /* device number */
-#endif
+typedef __uint32_t __dev_t; /* device number */
typedef __uint32_t __fixpt_t; /* fixed point number */
diff --git a/sys/sys/acct.h b/sys/sys/acct.h
index ecd6a5d..167a90c 100644
--- a/sys/sys/acct.h
+++ b/sys/sys/acct.h
@@ -56,7 +56,7 @@ struct acct {
gid_t ac_gid; /* group id */
u_int16_t ac_mem; /* average memory usage */
comp_t ac_io; /* count of IO blocks */
- __udev_t ac_tty; /* controlling tty */
+ __dev_t ac_tty; /* controlling tty */
#define AFORK 0x01 /* forked but not exec'ed */
/* ASU is no longer supported */
diff --git a/sys/sys/conf.h b/sys/sys/conf.h
index d97db93..e90713d 100644
--- a/sys/sys/conf.h
+++ b/sys/sys/conf.h
@@ -64,7 +64,7 @@ struct cdev {
struct timespec si_atime;
struct timespec si_ctime;
struct timespec si_mtime;
- udev_t si_udev;
+ dev_t si_udev;
int si_refcount;
LIST_ENTRY(cdev) si_list;
LIST_ENTRY(cdev) si_clone;
diff --git a/sys/sys/param.h b/sys/sys/param.h
index 67a8e98..08fe7e8 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -55,7 +55,7 @@
* scheme is: <major><two digit minor><0 if release branch, otherwise 1>xx
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 502116 /* Master, propagated to newvers */
+#define __FreeBSD_version 502117 /* Master, propagated to newvers */
#ifndef LOCORE
#include <sys/types.h>
@@ -185,13 +185,8 @@
#define NBPW sizeof(int) /* number of bytes per word (integer) */
#define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
-#ifdef _KERNEL
-#define NOUDEV (udev_t)(-1) /* non-existent device */
-#define NOMAJ 256 /* non-existent device */
-#define NODEV NULL /* non-existent device */
-#else
+
#define NODEV (dev_t)(-1) /* non-existent device */
-#endif
#define CBLOCK 128 /* Clist block size, must be a power of 2. */
#define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
diff --git a/sys/sys/snoop.h b/sys/sys/snoop.h
index 026dd7a..992be9b 100644
--- a/sys/sys/snoop.h
+++ b/sys/sys/snoop.h
@@ -30,8 +30,8 @@
* detached from its current tty.
*/
-#define SNPSTTY _IOW('T', 90, udev_t)
-#define SNPGTTY _IOR('T', 89, udev_t)
+#define SNPSTTY _IOW('T', 90, dev_t)
+#define SNPGTTY _IOR('T', 89, dev_t)
/*
* These values would be returned by FIONREAD ioctl
diff --git a/sys/sys/stat.h b/sys/sys/stat.h
index 0f7f4a3..0f7e349 100644
--- a/sys/sys/stat.h
+++ b/sys/sys/stat.h
@@ -44,9 +44,7 @@
/* XXX missing blkcnt_t, blksize_t. */
#ifndef _DEV_T_DECLARED
-#ifndef _KERNEL
typedef __dev_t dev_t;
-#endif
#define _DEV_T_DECLARED
#endif
@@ -123,13 +121,13 @@ struct ostat {
#endif /* __BSD_VISIBLE */
struct stat {
- __udev_t st_dev; /* inode's device */
+ __dev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */
nlink_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
- __udev_t st_rdev; /* device type */
+ __dev_t st_rdev; /* device type */
#if __BSD_VISIBLE
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
@@ -170,13 +168,13 @@ struct stat {
#if __BSD_VISIBLE
struct nstat {
- __udev_t st_dev; /* inode's device */
+ __dev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
__uint32_t st_mode; /* inode protection mode */
__uint32_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
- __udev_t st_rdev; /* device type */
+ __dev_t st_rdev; /* device type */
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last file status change */
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 1a06d82..a1f67bb 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -316,11 +316,10 @@ void wakeup_one(void *chan) __nonnull(1);
int major(struct cdev *x);
int minor(struct cdev *x);
-udev_t dev2udev(struct cdev *x);
-struct cdev *udev2dev(udev_t x);
-int uminor(udev_t dev);
-int umajor(udev_t dev);
-udev_t makeudev(int x, int y);
+dev_t dev2udev(struct cdev *x);
+struct cdev *findcdev(dev_t x);
+int uminor(dev_t dev);
+int umajor(dev_t dev);
/* XXX: Should be void nanodelay(u_int nsec); */
void DELAY(int usec);
diff --git a/sys/sys/tty.h b/sys/sys/tty.h
index 1b8958b..a51a6e4 100644
--- a/sys/sys/tty.h
+++ b/sys/sys/tty.h
@@ -82,7 +82,7 @@ struct tty {
int t_line; /* Interface to device drivers. */
union {
struct cdev *t_kdev; /* Device. */
- udev_t t_udev; /* Userland (sysctl) instance. */
+ dev_t t_udev; /* Userland (sysctl) instance. */
void *t_devp; /* Keep user/kernel size in sync. */
} ttyu;
int t_state; /* Device and driver (TS*) state. */
@@ -141,7 +141,7 @@ struct xtty {
long xt_cancc; /* Canonical queue statistics. */
long xt_outcc; /* Output queue statistics. */
int xt_line; /* Interface to device drivers. */
- udev_t xt_dev; /* Userland (sysctl) instance. */
+ dev_t xt_dev; /* Userland (sysctl) instance. */
int xt_state; /* Device and driver (TS*) state. */
int xt_flags; /* Tty flags. */
int xt_timeout; /* Timeout for ttywait(). */
diff --git a/sys/sys/types.h b/sys/sys/types.h
index 87d03d9..6de77ac 100644
--- a/sys/sys/types.h
+++ b/sys/sys/types.h
@@ -131,9 +131,7 @@ typedef __critical_t critical_t; /* Critical section value */
typedef __int64_t daddr_t; /* disk address */
#ifndef _DEV_T_DECLARED
-#ifndef _KERNEL
typedef __dev_t dev_t; /* device number or struct cdev */
-#endif
#define _DEV_T_DECLARED
#endif
@@ -235,7 +233,6 @@ typedef __timer_t timer_t;
#endif
typedef __u_register_t u_register_t;
-typedef __udev_t udev_t; /* device number */
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t; /* user id */
@@ -292,9 +289,10 @@ typedef struct vm_page *vm_page_t;
*/
#define major(x) ((int)(((u_int)(x) >> 8)&0xff)) /* major number */
#define minor(x) ((int)((x)&0xffff00ff)) /* minor number */
-#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
#endif /* !_KERNEL */
+#define makedev(x,y) ((dev_t)(((x) << 8) | (y))) /* create dev_t */
+
/*
* These declarations belong elsewhere, but are repeated here and in
* <stdio.h> to give broken programs a better chance of working with
diff --git a/sys/sys/user.h b/sys/sys/user.h
index 0c1d005..c6fc22d 100644
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -108,7 +108,7 @@ struct kinfo_proc {
pid_t ki_sid; /* Process session ID */
pid_t ki_tsid; /* Terminal session ID */
short ki_jobc; /* job control counter */
- udev_t ki_tdev; /* controlling tty dev */
+ dev_t ki_tdev; /* controlling tty dev */
sigset_t ki_siglist; /* Signals arrived but not delivered */
sigset_t ki_sigmask; /* Current signal mask */
sigset_t ki_sigignore; /* Signals being ignored */
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 10df935..3fc66c4e 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -153,7 +153,7 @@ struct vnode {
const char *filename; /* Source file doing locking */
int line; /* Line number doing locking */
#endif
- udev_t v_cachedfs; /* cached fs id */
+ dev_t v_cachedfs; /* cached fs id */
ino_t v_cachedid; /* cached file id */
};
#define v_mountedhere v_un.vu_mountedhere
@@ -179,9 +179,9 @@ struct xvnode {
union {
void *xvu_socket; /* socket, if VSOCK */
void *xvu_fifo; /* fifo, if VFIFO */
- udev_t xvu_rdev; /* maj/min, if VBLK/VCHR */
+ dev_t xvu_rdev; /* maj/min, if VBLK/VCHR */
struct {
- udev_t xvu_dev; /* device, if VDIR/VREG/VLNK */
+ dev_t xvu_dev; /* device, if VDIR/VREG/VLNK */
ino_t xvu_ino; /* id, if VDIR/VREG/VLNK */
} xv_uns;
} xv_un;
@@ -247,7 +247,7 @@ struct vattr {
short va_nlink; /* number of references to file */
uid_t va_uid; /* owner user id */
gid_t va_gid; /* owner group id */
- udev_t va_fsid; /* filesystem id */
+ dev_t va_fsid; /* filesystem id */
long va_fileid; /* file id */
u_quad_t va_size; /* file size in bytes */
long va_blocksize; /* blocksize preferred for i/o */
@@ -257,7 +257,7 @@ struct vattr {
struct timespec va_birthtime; /* time file created */
u_long va_gen; /* generation number of file */
u_long va_flags; /* flags defined for file */
- udev_t va_rdev; /* device the special file represents */
+ dev_t va_rdev; /* device the special file represents */
u_quad_t va_bytes; /* bytes of disk space held by file */
u_quad_t va_filerev; /* file modification number */
u_int va_vaflags; /* operations flags, see below */
@@ -593,7 +593,7 @@ extern int (*lease_check_hook)(struct vop_lease_args *);
extern int (*softdep_fsync_hook)(struct vnode *);
extern int (*softdep_process_worklist_hook)(struct mount *);
-struct vnode *addaliasu(struct vnode *vp, udev_t nvp_rdev);
+struct vnode *addaliasu(struct vnode *vp, dev_t nvp_rdev);
int bdevvp(struct cdev *dev, struct vnode **vpp);
/* cache_* may belong in namei.h. */
void cache_enter(struct vnode *dvp, struct vnode *vp,
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
index 586ec82..66483e6 100644
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -154,7 +154,7 @@ struct swdevt {
int sw_flags;
int sw_nblks;
int sw_used;
- udev_t sw_udev;
+ dev_t sw_dev;
struct vnode *sw_vp;
void *sw_id;
swblk_t sw_first;
@@ -2079,7 +2079,7 @@ done2:
}
static void
-swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strategy, sw_close_t *close, udev_t udev)
+swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strategy, sw_close_t *close, dev_t dev)
{
struct swdevt *sp, *tsp;
swblk_t dvbase;
@@ -2107,7 +2107,7 @@ swaponsomething(struct vnode *vp, void *id, u_long nblks, sw_strategy_t *strateg
sp = malloc(sizeof *sp, M_VMPGDATA, M_WAITOK | M_ZERO);
sp->sw_vp = vp;
sp->sw_id = id;
- sp->sw_udev = udev;
+ sp->sw_dev = dev;
sp->sw_flags = 0;
sp->sw_nblks = nblks;
sp->sw_used = 0;
@@ -2293,7 +2293,7 @@ sysctl_vm_swap_info(SYSCTL_HANDLER_ARGS)
if (n == *name) {
mtx_unlock(&sw_dev_mtx);
xs.xsw_version = XSWDEV_VERSION;
- xs.xsw_dev = sp->sw_udev;
+ xs.xsw_dev = sp->sw_dev;
xs.xsw_flags = sp->sw_flags;
xs.xsw_nblks = sp->sw_nblks;
xs.xsw_used = sp->sw_used;
@@ -2533,7 +2533,7 @@ swapdev_strategy(struct buf *bp, struct swdevt *sp)
int s;
struct vnode *vp, *vp2;
- bp->b_dev = NODEV;
+ bp->b_dev = NULL;
bp->b_blkno = ctodb(bp->b_blkno - sp->sw_first);
vp2 = sp->sw_id;
@@ -2598,6 +2598,6 @@ swaponvp(struct thread *td, struct vnode *vp, u_long nblks)
return (error);
swaponsomething(vp, vp, nblks, swapdev_strategy, swapdev_close,
- NOUDEV);
+ NODEV);
return (0);
}
diff --git a/sys/vm/vm_param.h b/sys/vm/vm_param.h
index 46827ce..dab1245 100644
--- a/sys/vm/vm_param.h
+++ b/sys/vm/vm_param.h
@@ -107,7 +107,7 @@
#define XSWDEV_VERSION 1
struct xswdev {
u_int xsw_version;
- udev_t xsw_dev;
+ dev_t xsw_dev;
int xsw_flags;
int xsw_nblks;
int xsw_used;
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 1578dd3..b329ec8 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -585,8 +585,8 @@ ufs_filestat(vp, fsp)
return 0;
}
/*
- * The st_dev from stat(2) is a udev_t. These kernel structures
- * contain dev_t structures. We need to convert to udev to make
+ * The st_dev from stat(2) is a dev_t. These kernel structures
+ * contain cdev pointers. We need to convert to dev_t to make
* comparisons
*/
fsp->fsid = dev2udev(inode.i_dev);
@@ -875,10 +875,10 @@ bad:
/*
- * Read the cdev structure in the kernel (as pointed to by a dev_t)
- * in order to work out the associated udev_t
+ * Read the cdev structure in the kernel in order to work out the
+ * associated dev_t
*/
-udev_t
+dev_t
dev2udev(dev)
struct cdev *dev;
{
@@ -887,7 +887,7 @@ dev2udev(dev)
if (KVM_READ(dev, &si, sizeof si)) {
return si.si_udev;
} else {
- dprintf(stderr, "can't convert dev_t %x to a udev_t\n", dev);
+ dprintf(stderr, "can't convert cdev *%x to a dev_t\n", dev);
return -1;
}
}
diff --git a/usr.bin/fstat/fstat.h b/usr.bin/fstat/fstat.h
index 9cfbd62..cf4e15a 100644
--- a/usr.bin/fstat/fstat.h
+++ b/usr.bin/fstat/fstat.h
@@ -64,7 +64,7 @@ extern kvm_t *kd;
extern int vflg;
extern int Pid;
-udev_t dev2udev(struct cdev *dev);
+dev_t dev2udev(struct cdev *dev);
/* Additional filesystem types */
int isofs_filestat(struct vnode *vp, struct filestat *fsp);
diff --git a/usr.bin/pkill/pkill.c b/usr.bin/pkill/pkill.c
index 565dc3c..fa17d6e 100644
--- a/usr.bin/pkill/pkill.c
+++ b/usr.bin/pkill/pkill.c
@@ -383,7 +383,7 @@ main(int argc, char **argv)
if (li->li_number == -1 &&
(kp->ki_flag & P_CONTROLT) == 0)
break;
- if (kp->ki_tdev == (udev_t)li->li_number)
+ if (kp->ki_tdev == (dev_t)li->li_number)
break;
}
if (SLIST_FIRST(&tdevlist) != NULL && li == NULL) {
OpenPOWER on IntegriCloud