aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_stats.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2004-06-17 17:16:53 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2004-06-17 17:16:53 +0000
commitf3732fd15b5a493a090a0453f937a78949c65f7d (patch)
treefe8b297144afd6d6f7db41275c72cb5eb663ec02 /sys/compat/linux/linux_stats.c
parentc0d431fe315475c5fe50084db455416148d57914 (diff)
downloadsrc-f3732fd15b5a493a090a0453f937a78949c65f7d.tar.gz
src-f3732fd15b5a493a090a0453f937a78949c65f7d.zip
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.
Notes
Notes: svn path=/head/; revision=130640
Diffstat (limited to 'sys/compat/linux/linux_stats.c')
-rw-r--r--sys/compat/linux/linux_stats.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/compat/linux/linux_stats.c b/sys/compat/linux/linux_stats.c
index 4a02042ddc5f..a9545fda7e6d 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;