diff options
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_conf.c | 76 | ||||
-rw-r--r-- | sys/kern/kern_descrip.c | 4 | ||||
-rw-r--r-- | sys/kern/kern_physio.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_bus.c | 12 | ||||
-rw-r--r-- | sys/kern/subr_devstat.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_log.c | 10 | ||||
-rw-r--r-- | sys/kern/tty.c | 22 | ||||
-rw-r--r-- | sys/kern/tty_conf.c | 2 | ||||
-rw-r--r-- | sys/kern/tty_cons.c | 18 | ||||
-rw-r--r-- | sys/kern/tty_pty.c | 32 | ||||
-rw-r--r-- | sys/kern/tty_tty.c | 6 | ||||
-rw-r--r-- | sys/kern/vfs_bio.c | 2 | ||||
-rw-r--r-- | sys/kern/vfs_mount.c | 16 | ||||
-rw-r--r-- | sys/kern/vfs_subr.c | 24 |
14 files changed, 114 insertions, 114 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index 18ede10..216a777 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -44,7 +44,7 @@ __FBSDID("$FreeBSD$"); #include <sys/tty.h> #include <machine/stdarg.h> -static MALLOC_DEFINE(M_DEVT, "dev_t", "dev_t storage"); +static MALLOC_DEFINE(M_DEVT, "struct cdev *", "struct cdev *storage"); /* Built at compile time from sys/conf/majors */ extern unsigned char reserved_majors[256]; @@ -56,7 +56,7 @@ extern unsigned char reserved_majors[256]; */ #define DEVT_HASH 83 -/* The number of dev_t's we can create before malloc(9) kick in. */ +/* The number of struct cdev *'s we can create before malloc(9) kick in. */ #define DEVT_STASH 50 static struct cdev devt_stash[DEVT_STASH]; @@ -69,13 +69,13 @@ static int free_devt; SYSCTL_INT(_debug, OID_AUTO, free_devt, CTLFLAG_RW, &free_devt, 0, ""); static struct mtx devmtx; -static void freedev(dev_t dev); +static void freedev(struct cdev *dev); static void devlock(void) { if (!mtx_initialized(&devmtx)) - mtx_init(&devmtx, "dev_t", NULL, MTX_DEF); + mtx_init(&devmtx, "struct cdev *", NULL, MTX_DEF); mtx_lock(&devmtx); } @@ -86,7 +86,7 @@ devunlock(void) } void -dev_ref(dev_t dev) +dev_ref(struct cdev *dev) { devlock(); dev->si_refcount++; @@ -94,7 +94,7 @@ dev_ref(dev_t dev) } void -dev_rel(dev_t dev) +dev_rel(struct cdev *dev) { devlock(); dev->si_refcount--; @@ -125,7 +125,7 @@ cdevsw_rel(struct cdevsw *csw) devunlock(); } -static dev_t makedev(int x, int y); +static struct cdev *makedev(int x, int y); int nullop(void) @@ -200,7 +200,7 @@ static struct cdevsw dead_cdevsw = { #define no_mmap (d_mmap_t *)enodev static int -no_kqfilter(dev_t dev __unused, struct knote *kn __unused) +no_kqfilter(struct cdev *dev __unused, struct knote *kn __unused) { return (1); @@ -214,7 +214,7 @@ no_strategy(struct bio *bp) } static int -no_poll(dev_t dev __unused, int events, struct thread *td __unused) +no_poll(struct cdev *dev __unused, int events, struct thread *td __unused) { /* * Return true for read/write. If the user asked for something @@ -233,7 +233,7 @@ no_poll(dev_t dev __unused, int events, struct thread *td __unused) #define no_dump (dumper_t *)enodev struct cdevsw * -devsw(dev_t dev) +devsw(struct cdev *dev) { if (dev->si_devsw != NULL) return (dev->si_devsw); @@ -241,11 +241,11 @@ devsw(dev_t dev) } /* - * dev_t and u_dev_t primitives + * struct cdev *and u_dev_t primitives */ int -major(dev_t x) +major(struct cdev *x) { if (x == NODEV) return NOUDEV; @@ -253,7 +253,7 @@ major(dev_t x) } int -minor(dev_t x) +minor(struct cdev *x) { if (x == NODEV) return NOUDEV; @@ -261,7 +261,7 @@ minor(dev_t x) } int -dev2unit(dev_t x) +dev2unit(struct cdev *x) { int i; @@ -279,7 +279,7 @@ unit2minor(int unit) return ((unit & 0xff) | ((unit << 8) & ~0xffff)); } -static dev_t +static struct cdev * allocdev(void) { static int stashed; @@ -303,7 +303,7 @@ allocdev(void) return (si); } -static dev_t +static struct cdev * makedev(int x, int y) { struct cdev *si; @@ -325,7 +325,7 @@ makedev(int x, int y) } static void -freedev(dev_t dev) +freedev(struct cdev *dev) { if (dev->si_flags & SI_STASHED) { @@ -338,14 +338,14 @@ freedev(dev_t dev) } udev_t -dev2udev(dev_t x) +dev2udev(struct cdev *x) { if (x == NODEV) return (NOUDEV); return (x->si_udev); } -dev_t +struct cdev * udev2dev(udev_t udev) { struct cdev *si; @@ -467,10 +467,10 @@ prep_cdevsw(struct cdevsw *devsw) devunlock(); } -dev_t +struct cdev * make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, const char *fmt, ...) { - dev_t dev; + struct cdev *dev; va_list ap; int i; @@ -515,9 +515,9 @@ make_dev(struct cdevsw *devsw, int minornr, uid_t uid, gid_t gid, int perms, con } int -dev_named(dev_t pdev, const char *name) +dev_named(struct cdev *pdev, const char *name) { - dev_t cdev; + struct cdev *cdev; if (strcmp(devtoname(pdev), name) == 0) return (1); @@ -528,7 +528,7 @@ dev_named(dev_t pdev, const char *name) } void -dev_depends(dev_t pdev, dev_t cdev) +dev_depends(struct cdev *pdev, struct cdev *cdev) { devlock(); @@ -538,10 +538,10 @@ dev_depends(dev_t pdev, dev_t cdev) devunlock(); } -dev_t -make_dev_alias(dev_t pdev, const char *fmt, ...) +struct cdev * +make_dev_alias(struct cdev *pdev, const char *fmt, ...) { - dev_t dev; + struct cdev *dev; va_list ap; int i; @@ -564,7 +564,7 @@ make_dev_alias(dev_t pdev, const char *fmt, ...) } static void -idestroy_dev(dev_t dev) +idestroy_dev(struct cdev *dev) { if (!(dev->si_flags & SI_NAMED)) { printf( "WARNING: Driver mistake: destroy_dev on %d/%d\n", @@ -597,7 +597,7 @@ idestroy_dev(dev_t dev) /* Remove from cdevsw list */ LIST_REMOVE(dev, si_list); - /* If cdevsw has no dev_t's, clean it */ + /* If cdevsw has no struct cdev *'s, clean it */ if (LIST_EMPTY(&dev->si_devsw->d_devs)) fini_cdevsw(dev->si_devsw); @@ -616,7 +616,7 @@ idestroy_dev(dev_t dev) } void -destroy_dev(dev_t dev) +destroy_dev(struct cdev *dev) { devlock(); @@ -625,7 +625,7 @@ destroy_dev(dev_t dev) } const char * -devtoname(dev_t dev) +devtoname(struct cdev *dev) { char *p; int mynor; @@ -681,7 +681,7 @@ dev_stdclone(char *name, char **namep, const char *stem, int *unit) * we do "on-demand" devices, using rman or other "private" methods * will be very tricky to lock down properly once we lock down this file. * - * Instead we give the drivers these routines which puts the dev_t's that + * Instead we give the drivers these routines which puts the struct cdev *'s that * are to be managed on their own list, and gives the driver the ability * to ask for the first free unit number or a given specified unit number. * @@ -703,10 +703,10 @@ clone_setup(struct clonedevs **cdp) } int -clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, dev_t *dp, u_int extra) +clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, struct cdev **dp, u_int extra) { struct clonedevs *cd; - dev_t dev, dl, de; + struct cdev *dev, *dl, *de; int unit, low, u; KASSERT(*cdp != NULL, @@ -766,12 +766,12 @@ clone_create(struct clonedevs **cdp, struct cdevsw *csw, int *up, dev_t *dp, u_i /* * Kill everything still on the list. The driver should already have - * disposed of any softc hung of the dev_t's at this time. + * disposed of any softc hung of the struct cdev *'s at this time. */ void clone_cleanup(struct clonedevs **cdp) { - dev_t dev, tdev; + struct cdev *dev, *tdev; struct clonedevs *cd; cd = *cdp; @@ -787,7 +787,7 @@ clone_cleanup(struct clonedevs **cdp) } /* - * Helper sysctl for devname(3). We're given a {u}dev_t and return + * Helper sysctl for devname(3). We're given a {u}struct cdev *and return * the name, if any, registered by the device driver. */ static int @@ -795,7 +795,7 @@ sysctl_devname(SYSCTL_HANDLER_ARGS) { int error; udev_t ud; - dev_t dev; + struct cdev *dev; error = SYSCTL_IN(req, &ud, sizeof (ud)); if (error) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 8e955ca..c61e0ed 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -2153,7 +2153,7 @@ done2: /* ARGSUSED */ static int fdopen(dev, mode, type, td) - dev_t dev; + struct cdev *dev; int mode, type; struct thread *td; { @@ -2393,7 +2393,7 @@ SYSCTL_INT(_kern, OID_AUTO, openfiles, CTLFLAG_RD, static void fildesc_drvinit(void *unused) { - dev_t dev; + struct cdev *dev; dev = make_dev(&fildesc_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666, "fd/0"); make_dev_alias(dev, "stdin"); diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index 83b7b82..c2c9b3f 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$"); #include <vm/vm_extern.h> int -physio(dev_t dev, struct uio *uio, int ioflag) +physio(struct cdev *dev, struct uio *uio, int ioflag) { int i; int error; diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index b0271f9..fd2e9d4 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -390,7 +390,7 @@ static struct dev_softc struct proc *async_proc; } devsoftc; -static dev_t devctl_dev; +static struct cdev *devctl_dev; static void devinit(void) @@ -403,7 +403,7 @@ devinit(void) } static int -devopen(dev_t dev, int oflags, int devtype, d_thread_t *td) +devopen(struct cdev *dev, int oflags, int devtype, d_thread_t *td) { if (devsoftc.inuse) return (EBUSY); @@ -415,7 +415,7 @@ devopen(dev_t dev, int oflags, int devtype, d_thread_t *td) } static int -devclose(dev_t dev, int fflag, int devtype, d_thread_t *td) +devclose(struct cdev *dev, int fflag, int devtype, d_thread_t *td) { devsoftc.inuse = 0; mtx_lock(&devsoftc.mtx); @@ -434,7 +434,7 @@ devclose(dev_t dev, int fflag, int devtype, d_thread_t *td) * programs are expected to cope. */ static int -devread(dev_t dev, struct uio *uio, int ioflag) +devread(struct cdev *dev, struct uio *uio, int ioflag) { struct dev_event_info *n1; int rv; @@ -464,7 +464,7 @@ devread(dev_t dev, struct uio *uio, int ioflag) } static int -devioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td) +devioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td) { switch (cmd) { @@ -494,7 +494,7 @@ devioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, d_thread_t *td) } static int -devpoll(dev_t dev, int events, d_thread_t *td) +devpoll(struct cdev *dev, int events, d_thread_t *td) { int revents = 0; diff --git a/sys/kern/subr_devstat.c b/sys/kern/subr_devstat.c index 04abe89..f7fda10 100644 --- a/sys/kern/subr_devstat.c +++ b/sys/kern/subr_devstat.c @@ -453,7 +453,7 @@ static TAILQ_HEAD(, statspage) pagelist = TAILQ_HEAD_INITIALIZER(pagelist); static MALLOC_DEFINE(M_DEVSTAT, "devstat", "Device statistics"); static int -devstat_mmap(dev_t dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) +devstat_mmap(struct cdev *dev, vm_offset_t offset, vm_paddr_t *paddr, int nprot) { struct statspage *spp; diff --git a/sys/kern/subr_log.c b/sys/kern/subr_log.c index a232335..bdb18fd 100644 --- a/sys/kern/subr_log.c +++ b/sys/kern/subr_log.c @@ -92,7 +92,7 @@ SYSCTL_INT(_kern, OID_AUTO, log_wakeups_per_second, CTLFLAG_RW, /*ARGSUSED*/ static int -logopen(dev_t dev, int flags, int mode, struct thread *td) +logopen(struct cdev *dev, int flags, int mode, struct thread *td) { if (log_open) return (EBUSY); @@ -110,7 +110,7 @@ logopen(dev_t dev, int flags, int mode, struct thread *td) /*ARGSUSED*/ static int -logclose(dev_t dev, int flag, int mode, struct thread *td) +logclose(struct cdev *dev, int flag, int mode, struct thread *td) { log_open = 0; @@ -122,7 +122,7 @@ logclose(dev_t dev, int flag, int mode, struct thread *td) /*ARGSUSED*/ static int -logread(dev_t dev, struct uio *uio, int flag) +logread(struct cdev *dev, struct uio *uio, int flag) { char buf[128]; struct msgbuf *mbp = msgbufp; @@ -157,7 +157,7 @@ logread(dev_t dev, struct uio *uio, int flag) /*ARGSUSED*/ static int -logpoll(dev_t dev, int events, struct thread *td) +logpoll(struct cdev *dev, int events, struct thread *td) { int s; int revents = 0; @@ -203,7 +203,7 @@ logtimeout(void *arg) /*ARGSUSED*/ static int -logioctl(dev_t dev, u_long com, caddr_t data, int flag, struct thread *td) +logioctl(struct cdev *dev, u_long com, caddr_t data, int flag, struct thread *td) { switch (com) { diff --git a/sys/kern/tty.c b/sys/kern/tty.c index aeecbb8..6c5f4d5 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -227,7 +227,7 @@ SYSCTL_INT(_kern, OID_AUTO, drainwait, CTLFLAG_RW, &drainwait, * Initial open of tty, or (re)entry to standard tty line discipline. */ int -ttyopen(dev_t device, struct tty *tp) +ttyopen(struct cdev *device, struct tty *tp) { int s; @@ -1015,7 +1015,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag) } case TIOCSETD: { /* set line discipline */ int t = *(int *)data; - dev_t device = tp->t_dev; + struct cdev *device = tp->t_dev; if ((u_int)t >= nlinesw) return (ENXIO); @@ -1140,7 +1140,7 @@ ttioctl(struct tty *tp, u_long cmd, void *data, int flag) } int -ttypoll(dev_t dev, int events, struct thread *td) +ttypoll(struct cdev *dev, int events, struct thread *td) { int s; int revents = 0; @@ -1180,7 +1180,7 @@ static struct filterops ttywrite_filtops = { 1, NULL, filt_ttywdetach, filt_ttywrite }; int -ttykqfilter(dev_t dev, struct knote *kn) +ttykqfilter(struct cdev *dev, struct knote *kn) { struct tty *tp; struct klist *klist; @@ -1216,7 +1216,7 @@ ttykqfilter(dev_t dev, struct knote *kn) static void filt_ttyrdetach(struct knote *kn) { - struct tty *tp = ((dev_t)kn->kn_hook)->si_tty; + struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; int s = spltty(); SLIST_REMOVE(&tp->t_rsel.si_note, kn, knote, kn_selnext); @@ -1226,7 +1226,7 @@ filt_ttyrdetach(struct knote *kn) static int filt_ttyread(struct knote *kn, long hint) { - struct tty *tp = ((dev_t)kn->kn_hook)->si_tty; + struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; kn->kn_data = ttnread(tp); if (ISSET(tp->t_state, TS_ZOMBIE)) { @@ -1239,7 +1239,7 @@ filt_ttyread(struct knote *kn, long hint) static void filt_ttywdetach(struct knote *kn) { - struct tty *tp = ((dev_t)kn->kn_hook)->si_tty; + struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; int s = spltty(); SLIST_REMOVE(&tp->t_wsel.si_note, kn, knote, kn_selnext); @@ -1249,7 +1249,7 @@ filt_ttywdetach(struct knote *kn) static int filt_ttywrite(struct knote *kn, long hint) { - struct tty *tp = ((dev_t)kn->kn_hook)->si_tty; + struct tty *tp = ((struct cdev *)kn->kn_hook)->si_tty; kn->kn_data = tp->t_outq.c_cc; if (ISSET(tp->t_state, TS_ZOMBIE)) @@ -2789,7 +2789,7 @@ nottystop(struct tty *tp, int rw) } int -ttyread(dev_t dev, struct uio *uio, int flag) +ttyread(struct cdev *dev, struct uio *uio, int flag) { struct tty *tp; @@ -2804,7 +2804,7 @@ ttyread(dev_t dev, struct uio *uio, int flag) } int -ttywrite(dev_t dev, struct uio *uio, int flag) +ttywrite(struct cdev *dev, struct uio *uio, int flag) { struct tty *tp; @@ -2819,7 +2819,7 @@ ttywrite(dev_t dev, struct uio *uio, int flag) } int -ttyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) +ttyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { struct tty *tp; int error; diff --git a/sys/kern/tty_conf.c b/sys/kern/tty_conf.c index 827fe42..488e383 100644 --- a/sys/kern/tty_conf.c +++ b/sys/kern/tty_conf.c @@ -156,7 +156,7 @@ ldisc_deregister(int discipline) */ static int -l_noopen(dev_t dev, struct tty *tp) +l_noopen(struct cdev *dev, struct tty *tp) { return (ENODEV); diff --git a/sys/kern/tty_cons.c b/sys/kern/tty_cons.c index 2c38d56..a9bea7c 100644 --- a/sys/kern/tty_cons.c +++ b/sys/kern/tty_cons.c @@ -105,7 +105,7 @@ static STAILQ_HEAD(, cn_device) cn_devlist = static udev_t cn_udev_t; SYSCTL_OPAQUE(_machdep, CPU_CONSDEV, consdev, CTLFLAG_RD, - &cn_udev_t, sizeof cn_udev_t, "T,dev_t", ""); + &cn_udev_t, sizeof cn_udev_t, "T,struct cdev *", ""); int cons_avail_mask = 0; /* Bit mask. Each registered low level console * which is currently unavailable for inpit @@ -388,7 +388,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen) char path[CNDEVPATHMAX]; struct nameidata nd; struct vnode *vp; - dev_t dev; + struct cdev *dev; int error; if ((vp = cnd->cnd_vp) != NULL) { @@ -414,7 +414,7 @@ cn_devopen(struct cn_device *cnd, struct thread *td, int forceopen) } static int -cnopen(dev_t dev, int flag, int mode, struct thread *td) +cnopen(struct cdev *dev, int flag, int mode, struct thread *td) { struct cn_device *cnd; @@ -428,7 +428,7 @@ cnopen(dev_t dev, int flag, int mode, struct thread *td) } static int -cnclose(dev_t dev, int flag, int mode, struct thread *td) +cnclose(struct cdev *dev, int flag, int mode, struct thread *td) { struct cn_device *cnd; struct vnode *vp; @@ -444,7 +444,7 @@ cnclose(dev_t dev, int flag, int mode, struct thread *td) } static int -cnread(dev_t dev, struct uio *uio, int flag) +cnread(struct cdev *dev, struct uio *uio, int flag) { struct cn_device *cnd; @@ -456,7 +456,7 @@ cnread(dev_t dev, struct uio *uio, int flag) } static int -cnwrite(dev_t dev, struct uio *uio, int flag) +cnwrite(struct cdev *dev, struct uio *uio, int flag) { struct cn_device *cnd; @@ -477,7 +477,7 @@ done: } static int -cnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) +cnioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { struct cn_device *cnd; int error; @@ -507,7 +507,7 @@ cnioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) * poll/kqfilter do not appear to be correct */ static int -cnpoll(dev_t dev, int events, struct thread *td) +cnpoll(struct cdev *dev, int events, struct thread *td) { struct cn_device *cnd; @@ -521,7 +521,7 @@ cnpoll(dev_t dev, int events, struct thread *td) } static int -cnkqfilter(dev_t dev, struct knote *kn) +cnkqfilter(struct cdev *dev, struct knote *kn) { struct cn_device *cnd; diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 96ccbf4..b4082a3 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_PTY, "ptys", "pty data structures"); static void ptsstart(struct tty *tp); static void ptsstop(struct tty *tp, int rw); static void ptcwakeup(struct tty *tp, int flag); -static dev_t ptyinit(dev_t cdev); +static struct cdev *ptyinit(struct cdev *cdev); static d_open_t ptsopen; static d_close_t ptsclose; @@ -109,7 +109,7 @@ struct ptsc { u_char pt_send; u_char pt_ucntl; struct tty *pt_tty; - dev_t devs, devc; + struct cdev *devs, *devc; struct prison *pt_prison; }; @@ -133,10 +133,10 @@ static char *names = "pqrsPQRS"; * XXX: define and add mapping of upper minor bits to allow more * than 256 ptys. */ -static dev_t -ptyinit(dev_t devc) +static struct cdev * +ptyinit(struct cdev *devc) { - dev_t devs; + struct cdev *devs; struct ptsc *pt; int n; @@ -161,7 +161,7 @@ ptyinit(dev_t devc) /*ARGSUSED*/ static int -ptsopen(dev_t dev, int flag, int devtype, struct thread *td) +ptsopen(struct cdev *dev, int flag, int devtype, struct thread *td) { struct tty *tp; int error; @@ -199,7 +199,7 @@ ptsopen(dev_t dev, int flag, int devtype, struct thread *td) } static int -ptsclose(dev_t dev, int flag, int mode, struct thread *td) +ptsclose(struct cdev *dev, int flag, int mode, struct thread *td) { struct tty *tp; int err; @@ -211,7 +211,7 @@ ptsclose(dev_t dev, int flag, int mode, struct thread *td) } static int -ptsread(dev_t dev, struct uio *uio, int flag) +ptsread(struct cdev *dev, struct uio *uio, int flag) { struct thread *td = curthread; struct proc *p = td->td_proc; @@ -274,7 +274,7 @@ again: * indirectly, when tty driver calls ptsstart. */ static int -ptswrite(dev_t dev, struct uio *uio, int flag) +ptswrite(struct cdev *dev, struct uio *uio, int flag) { struct tty *tp; @@ -318,7 +318,7 @@ ptcwakeup(struct tty *tp, int flag) } static int -ptcopen(dev_t dev, int flag, int devtype, struct thread *td) +ptcopen(struct cdev *dev, int flag, int devtype, struct thread *td) { struct tty *tp; struct ptsc *pt; @@ -344,7 +344,7 @@ ptcopen(dev_t dev, int flag, int devtype, struct thread *td) } static int -ptcclose(dev_t dev, int flags, int fmt, struct thread *td) +ptcclose(struct cdev *dev, int flags, int fmt, struct thread *td) { struct tty *tp; @@ -370,7 +370,7 @@ ptcclose(dev_t dev, int flags, int fmt, struct thread *td) } static int -ptcread(dev_t dev, struct uio *uio, int flag) +ptcread(struct cdev *dev, struct uio *uio, int flag) { struct tty *tp = dev->si_tty; struct ptsc *pt = dev->si_drv1; @@ -450,7 +450,7 @@ ptsstop(struct tty *tp, int flush) } static int -ptcpoll(dev_t dev, int events, struct thread *td) +ptcpoll(struct cdev *dev, int events, struct thread *td) { struct tty *tp = dev->si_tty; struct ptsc *pt = dev->si_drv1; @@ -498,7 +498,7 @@ ptcpoll(dev_t dev, int events, struct thread *td) } static int -ptcwrite(dev_t dev, struct uio *uio, int flag) +ptcwrite(struct cdev *dev, struct uio *uio, int flag) { struct tty *tp = dev->si_tty; u_char *cp = 0; @@ -606,7 +606,7 @@ block: /*ARGSUSED*/ static int -ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) +ptyioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { struct tty *tp = dev->si_tty; struct ptsc *pt = dev->si_drv1; @@ -773,7 +773,7 @@ ptyioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct thread *td) } static void -pty_clone(void *arg, char *name, int namelen, dev_t *dev) +pty_clone(void *arg, char *name, int namelen, struct cdev **dev) { int u; diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index 96fa84b..85b0eac 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -45,17 +45,17 @@ static struct cdevsw ctty_cdevsw = { .d_flags = D_TTY | D_NEEDGIANT, }; -static dev_t ctty; +static struct cdev *ctty; static int -cttyopen(dev_t dev, int flag, int mode, struct thread *td) +cttyopen(struct cdev *dev, int flag, int mode, struct thread *td) { return (ENXIO); } static void -ctty_clone(void *arg, char *name, int namelen, dev_t *dev) +ctty_clone(void *arg, char *name, int namelen, struct cdev **dev) { if (*dev != NODEV) diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 30daba7..19b6726 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3083,7 +3083,7 @@ dev_strategy(struct buf *bp) bp->b_io.bio_caller2 = bp; csw = devsw(bp->b_io.bio_dev); KASSERT(bp->b_io.bio_dev->si_refcount > 0, - ("dev_strategy on un-referenced dev_t (%s)", + ("dev_strategy on un-referenced struct cdev *(%s)", devtoname(bp->b_io.bio_dev))); cdevsw_ref(csw); (*devsw(bp->b_io.bio_dev)->d_strategy)(&bp->b_io); diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c index 229309d..8eaa6e9 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); -dev_t rootdev = NODEV; +struct cdev *rootdev = NODEV; /* * Has to be dynamic as the value of rootdev can change; however, it can't @@ -1445,13 +1445,13 @@ gets(char *cp) } /* - * Convert a given name to the dev_t of the disk-like device + * Convert a given name to the struct cdev *of the disk-like device * it refers to. */ -dev_t +struct cdev * getdiskbyname(char *name) { char *cp; - dev_t dev; + struct cdev *dev; cp = name; if (!bcmp(cp, "/dev/", 5)) @@ -1469,7 +1469,7 @@ getdiskbyname(char *name) { static int setrootbyname(char *name) { - dev_t diskdev; + struct cdev *diskdev; diskdev = getdiskbyname(name); if (diskdev != NODEV) { @@ -1480,11 +1480,11 @@ setrootbyname(char *name) return (1); } -/* Show the dev_t for a disk specified by name */ +/* Show the struct cdev *for a disk specified by name */ #ifdef DDB DB_SHOW_COMMAND(disk, db_getdiskbyname) { - dev_t dev; + struct cdev *dev; if (modif[0] == '\0') { db_error("usage: show disk/devicename"); @@ -1492,7 +1492,7 @@ DB_SHOW_COMMAND(disk, db_getdiskbyname) } dev = getdiskbyname(modif); if (dev != NODEV) - db_printf("dev_t = %p\n", dev); + 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 2caad25..0346fa2 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_NETADDR, "Export Host", "Export host address structure"); -static void addalias(struct vnode *vp, dev_t nvp_rdev); +static void addalias(struct vnode *vp, struct cdev *nvp_rdev); static void insmntque(struct vnode *vp, struct mount *mp); static void vclean(struct vnode *vp, int flags, struct thread *td); static void vlruvp(struct vnode *vp); @@ -1737,7 +1737,7 @@ reassignbuf(bp, newvp) */ int bdevvp(dev, vpp) - dev_t dev; + struct cdev *dev; struct vnode **vpp; { register struct vnode *vp; @@ -1776,7 +1776,7 @@ v_incr_usecount(struct vnode *vp, int delta) } /* - * Add vnode to the alias list hung off the dev_t. + * Add vnode to the alias list hung off the struct cdev *. * * The reason for this gunk is that multiple vnodes can reference * the same physical device, so checking vp->v_usecount to see @@ -1790,7 +1790,7 @@ addaliasu(nvp, nvp_rdev) { struct vnode *ovp; vop_t **ops; - dev_t dev; + struct cdev *dev; if (nvp->v_type == VBLK) return (nvp); @@ -1836,11 +1836,11 @@ addaliasu(nvp, nvp_rdev) } /* This is a local helper function that do the same as addaliasu, but for a - * dev_t instead of an udev_t. */ + * struct cdev *instead of an udev_t. */ static void addalias(nvp, dev) struct vnode *nvp; - dev_t dev; + struct cdev *dev; { KASSERT(nvp->v_type == VCHR, ("addalias on non-special vnode")); @@ -2440,7 +2440,7 @@ vop_revoke(ap) } */ *ap; { struct vnode *vp, *vq; - dev_t dev; + struct cdev *dev; KASSERT((ap->a_flags & REVOKEALL) != 0, ("vop_revoke")); vp = ap->a_vp; @@ -2622,7 +2622,7 @@ vgonel(vp, td) */ int vfinddev(dev, vpp) - dev_t dev; + struct cdev *dev; struct vnode **vpp; { struct vnode *vp; @@ -2653,11 +2653,11 @@ vcount(vp) } /* - * Same as above, but using the dev_t as argument + * Same as above, but using the struct cdev *as argument */ int count_dev(dev) - dev_t dev; + struct cdev *dev; { int count; @@ -3399,9 +3399,9 @@ sync_reclaim(ap) } /* - * extract the dev_t from a VCHR + * extract the struct cdev *from a VCHR */ -dev_t +struct cdev * vn_todev(vp) struct vnode *vp; { |