diff options
author | phk <phk@FreeBSD.org> | 2004-02-21 21:32:15 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-02-21 21:32:15 +0000 |
commit | 39fb4aef3d058a6d6726a689f365d2c8a3333178 (patch) | |
tree | 3b153134583d6d3d0d078ae9b3fb771be33195be /sys/compat | |
parent | ad925439e08646e188eb1c0e0be355f0685c8739 (diff) | |
download | FreeBSD-src-39fb4aef3d058a6d6726a689f365d2c8a3333178.zip FreeBSD-src-39fb4aef3d058a6d6726a689f365d2c8a3333178.tar.gz |
Device megapatch 5/6:
Remove the unused second argument from udev2dev().
Convert all remaining users of makedev() to use udev2dev(). The
semantic difference is that udev2dev() will only locate a pre-existing
dev_t, it will not line makedev() create a new one.
Apart from the tiny well controlled windown in D_PSEUDO drivers,
there should no longer be any "anonymous" dev_t's in the system
now, only dev_t's created with make_dev() and make_dev_alias()
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_stats.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c index ec6e067..9d61de2 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, 0)) != NODEV) { + (dev = udev2dev(buf->st_rdev)) != NODEV) { 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) * dev_t returned from previous syscalls. Just return a bzeroed * ustat in that case. */ - dev = makedev(args->dev >> 8, args->dev & 0xFF); - if (vfinddev(dev, VCHR, &vp)) { + dev = udev2dev(makeudev(args->dev >> 8, args->dev & 0xFF)); + if (dev != NODEV && vfinddev(dev, VCHR, &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, 0)) != NODEV) { + (dev = udev2dev(buf->st_rdev)) != NODEV) { cdevsw = devsw(dev); if (cdevsw != NULL && (cdevsw->d_flags & D_DISK)) { lbuf.st_mode &= ~S_IFMT; |