summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_stats.c
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 /sys/compat/linux/linux_stats.c
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.
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 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;
OpenPOWER on IntegriCloud