diff options
author | phk <phk@FreeBSD.org> | 2000-01-10 12:04:27 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-01-10 12:04:27 +0000 |
commit | ae0c1ec8f72abc7b43c1fed6860db12370093a0a (patch) | |
tree | d473773da273d9f8e9ef585dcf6dea59e03c2855 /sys/fs | |
parent | 5a624ba37849e1a07c962f1ec21e8e3df37884af (diff) | |
download | FreeBSD-src-ae0c1ec8f72abc7b43c1fed6860db12370093a0a.zip FreeBSD-src-ae0c1ec8f72abc7b43c1fed6860db12370093a0a.tar.gz |
Give vn_isdisk() a second argument where it can return a suitable errno.
Suggested by: bde
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/ntfs/ntfs_vfsops.c | 4 | ||||
-rw-r--r-- | sys/fs/specfs/spec_vnops.c | 11 |
5 files changed, 12 insertions, 15 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 16d51e7..5a7e880 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -220,9 +220,9 @@ cd9660_mount(mp, path, data, ndp, p) vrele(devvp); return (ENXIO); } - if (!vn_isdisk(devvp)) { + if (!vn_isdisk(devvp, &error)) { vrele(devvp); - return (ENOTBLK); + return (error); } /* diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 1a7f85c..efbd013 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -238,10 +238,8 @@ hpfs_mount ( devvp = ndp->ni_vp; #if defined(__FreeBSD__) - if (!vn_isdisk(devvp)) { - err = ENOTBLK; + if (!vn_isdisk(devvp, &err)) goto error_2; - } #else /* defined(__NetBSD__) */ if (devvp->v_type != VBLK) { err = ENOTBLK; diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index 13272af..94578e8 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -291,9 +291,9 @@ msdosfs_mount(mp, path, data, ndp, p) devvp = ndp->ni_vp; NDFREE(ndp, NDF_ONLY_PNBUF); - if (!vn_isdisk(devvp)) { + if (!vn_isdisk(devvp, &error)) { vrele(devvp); - return (ENOTBLK); + return (error); } /* * If mount by non-root, then verify that user has necessary diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index d4883be..089c6eb 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -321,10 +321,8 @@ ntfs_mount ( devvp = ndp->ni_vp; #if defined(__FreeBSD__) - if (!vn_isdisk(devvp)) { - err = ENOTBLK; + if (!vn_isdisk(devvp, &err)) goto error_2; - } #else if (devvp->v_type != VBLK) { err = ENOTBLK; diff --git a/sys/fs/specfs/spec_vnops.c b/sys/fs/specfs/spec_vnops.c index 4f8488e..9641897 100644 --- a/sys/fs/specfs/spec_vnops.c +++ b/sys/fs/specfs/spec_vnops.c @@ -159,7 +159,8 @@ spec_open(ap) * XXX: take this into account, and consequently they need to * XXX: live in the diskslicing code. Some checks do. */ - if (vn_isdisk(vp) && ap->a_cred != FSCRED && (ap->a_mode & FWRITE)) { + if (vn_isdisk(vp, NULL) && ap->a_cred != FSCRED && + (ap->a_mode & FWRITE)) { /* * Never allow opens for write if the device is mounted R/W */ @@ -204,7 +205,7 @@ spec_open(ap) } } - if (vn_isdisk(vp)) { + if (vn_isdisk(vp, NULL)) { if (!dev->si_bsize_phys) dev->si_bsize_phys = DEV_BSIZE; } @@ -337,7 +338,7 @@ spec_fsync(ap) struct buf *nbp; int s; - if (!vn_isdisk(vp)) + if (!vn_isdisk(vp, NULL)) return (0); /* @@ -415,7 +416,7 @@ spec_strategy(ap) * and write counts for disks that have associated filesystems. */ vp = ap->a_vp; - if (vn_isdisk(vp) && (mp = vp->v_specmountpoint) != NULL) { + if (vn_isdisk(vp, NULL) && (mp = vp->v_specmountpoint) != NULL) { if ((bp->b_flags & B_READ) == 0) { if (bp->b_lock.lk_lockholder == LK_KERNPROC) mp->mnt_stat.f_asyncwrites++; @@ -640,7 +641,7 @@ spec_getpages(ap) * block device is mounted. However, we can use v_rdev. */ - if (vn_isdisk(vp)) + if (vn_isdisk(vp, NULL)) blksiz = vp->v_rdev->si_bsize_phys; else blksiz = DEV_BSIZE; |