summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-01-10 12:04:27 +0000
committerphk <phk@FreeBSD.org>2000-01-10 12:04:27 +0000
commitae0c1ec8f72abc7b43c1fed6860db12370093a0a (patch)
treed473773da273d9f8e9ef585dcf6dea59e03c2855
parent5a624ba37849e1a07c962f1ec21e8e3df37884af (diff)
downloadFreeBSD-src-ae0c1ec8f72abc7b43c1fed6860db12370093a0a.zip
FreeBSD-src-ae0c1ec8f72abc7b43c1fed6860db12370093a0a.tar.gz
Give vn_isdisk() a second argument where it can return a suitable errno.
Suggested by: bde
-rw-r--r--sys/contrib/softupdates/ffs_softdep.c7
-rw-r--r--sys/dev/ccd/ccd.c4
-rw-r--r--sys/dev/vinum/vinumio.c7
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c4
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c4
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c4
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c4
-rw-r--r--sys/fs/specfs/spec_vnops.c11
-rw-r--r--sys/geom/geom_ccd.c4
-rw-r--r--sys/gnu/ext2fs/ext2_vfsops.c4
-rw-r--r--sys/gnu/fs/ext2fs/ext2_vfsops.c4
-rw-r--r--sys/isofs/cd9660/cd9660_vfsops.c4
-rw-r--r--sys/kern/vfs_aio.c4
-rw-r--r--sys/kern/vfs_bio.c6
-rw-r--r--sys/kern/vfs_export.c24
-rw-r--r--sys/kern/vfs_subr.c24
-rw-r--r--sys/kern/vfs_vnops.c4
-rw-r--r--sys/miscfs/devfs/devfs_vnops.c2
-rw-r--r--sys/miscfs/specfs/spec_vnops.c11
-rw-r--r--sys/msdosfs/msdosfs_vfsops.c4
-rw-r--r--sys/ntfs/ntfs_vfsops.c4
-rw-r--r--sys/sys/vnode.h2
-rw-r--r--sys/ufs/ffs/ffs_softdep.c7
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
-rw-r--r--sys/ufs/ffs/ffs_vnops.c5
-rw-r--r--sys/vm/vm_swap.c3
26 files changed, 90 insertions, 79 deletions
diff --git a/sys/contrib/softupdates/ffs_softdep.c b/sys/contrib/softupdates/ffs_softdep.c
index 8f7e3f2..46495f3 100644
--- a/sys/contrib/softupdates/ffs_softdep.c
+++ b/sys/contrib/softupdates/ffs_softdep.c
@@ -3744,7 +3744,7 @@ softdep_fsync_mountdev(vp)
struct buf *bp, *nbp;
struct worklist *wk;
- if (!vn_isdisk(vp))
+ if (!vn_isdisk(vp, NULL))
panic("softdep_fsync_mountdev: vnode not a disk");
ACQUIRE_LOCK(&lk);
for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
@@ -3806,7 +3806,7 @@ softdep_sync_metadata(ap)
* Check whether this vnode is involved in a filesystem
* that is doing soft dependency processing.
*/
- if (!vn_isdisk(vp)) {
+ if (!vn_isdisk(vp, NULL)) {
if (!DOINGSOFTDEP(vp))
return (0);
} else
@@ -4031,7 +4031,8 @@ loop:
* way to accomplish this is to sync the entire filesystem (luckily
* this happens rarely).
*/
- if (vn_isdisk(vp) && vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) &&
+ if (vn_isdisk(vp, NULL) &&
+ vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) &&
(error = VFS_SYNC(vp->v_specmountpoint, MNT_WAIT, ap->a_cred,
ap->a_p)) != 0)
return (error);
diff --git a/sys/dev/ccd/ccd.c b/sys/dev/ccd/ccd.c
index 7109468..c2a960d 100644
--- a/sys/dev/ccd/ccd.c
+++ b/sys/dev/ccd/ccd.c
@@ -1603,10 +1603,8 @@ ccdlookup(path, p, vpp)
goto bad;
}
- if (!vn_isdisk(vp)) {
- error = ENOTBLK;
+ if (!vn_isdisk(vp, &error))
goto bad;
- }
#ifdef DEBUG
if (ccddebug & CCDB_VNODE)
diff --git a/sys/dev/vinum/vinumio.c b/sys/dev/vinum/vinumio.c
index 1dbc2cf..929ec01 100644
--- a/sys/dev/vinum/vinumio.c
+++ b/sys/dev/vinum/vinumio.c
@@ -77,16 +77,15 @@ open_drive(struct drive *drive, struct proc *p, int verbose)
drive->devicename,
drive->vp->v_usecount);
}
- if (!vn_isdisk(drive->vp)) { /* only consider disks */
- NDFREE(&nd, NDF_ONLY_PNBUF);
+ if (!vn_isdisk(drive->vp, &drive->lasterror)) { /* only consider disks */
+ NDFREE(&nd, NDF_ONLY_PNBUF);
VOP_UNLOCK(drive->vp, 0, drive->p);
close_drive(drive);
- drive->lasterror = ENOTBLK;
if (verbose)
log(LOG_WARNING,
"vinum open_drive %s: Not a block device\n",
drive->devicename);
- return ENOTBLK;
+ return drive->lasterror;
}
drive->vp->v_numoutput = 0;
VOP_UNLOCK(drive->vp, 0, drive->p);
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;
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c
index 7109468..c2a960d 100644
--- a/sys/geom/geom_ccd.c
+++ b/sys/geom/geom_ccd.c
@@ -1603,10 +1603,8 @@ ccdlookup(path, p, vpp)
goto bad;
}
- if (!vn_isdisk(vp)) {
- error = ENOTBLK;
+ if (!vn_isdisk(vp, &error))
goto bad;
- }
#ifdef DEBUG
if (ccddebug & CCDB_VNODE)
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c
index 1865dbb..ac30793 100644
--- a/sys/gnu/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/ext2fs/ext2_vfsops.c
@@ -268,9 +268,9 @@ ext2_mount(mp, path, data, ndp, p)
NDFREE(ndp, NDF_ONLY_PNBUF);
devvp = ndp->ni_vp;
- if (!vn_isdisk(devvp)) {
+ if (!vn_isdisk(devvp, &error)) {
vrele(devvp);
- return (ENOTBLK);
+ return (error);
}
/*
diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c
index 1865dbb..ac30793 100644
--- a/sys/gnu/fs/ext2fs/ext2_vfsops.c
+++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c
@@ -268,9 +268,9 @@ ext2_mount(mp, path, data, ndp, p)
NDFREE(ndp, NDF_ONLY_PNBUF);
devvp = ndp->ni_vp;
- if (!vn_isdisk(devvp)) {
+ if (!vn_isdisk(devvp, &error)) {
vrele(devvp);
- return (ENOTBLK);
+ return (error);
}
/*
diff --git a/sys/isofs/cd9660/cd9660_vfsops.c b/sys/isofs/cd9660/cd9660_vfsops.c
index 16d51e7..5a7e880 100644
--- a/sys/isofs/cd9660/cd9660_vfsops.c
+++ b/sys/isofs/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/kern/vfs_aio.c b/sys/kern/vfs_aio.c
index fd632a9..aba8a82 100644
--- a/sys/kern/vfs_aio.c
+++ b/sys/kern/vfs_aio.c
@@ -934,8 +934,8 @@ aio_qphysio(p, aiocbe)
vp = (struct vnode *)fp->f_data;
- if (!vn_isdisk(vp))
- return (-1);
+ if (!vn_isdisk(vp, &error))
+ return (error);
if (cb->aio_nbytes % vp->v_rdev->si_bsize_phys)
return (-1);
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index f12316b..2ef57c5 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1016,7 +1016,7 @@ brelse(struct buf * bp)
*/
if ((bp->b_flags & B_VMIO)
&& !(bp->b_vp->v_tag == VT_NFS &&
- !vn_isdisk(bp->b_vp) &&
+ !vn_isdisk(bp->b_vp, NULL) &&
(bp->b_flags & B_DELWRI) &&
(bp->b_xflags & BX_BKGRDINPROG))
) {
@@ -2230,7 +2230,7 @@ loop:
int bsize, maxsize, vmio;
off_t offset;
- if (vn_isdisk(vp))
+ if (vn_isdisk(vp, NULL))
bsize = DEV_BSIZE;
else if (vp->v_mountedhere)
bsize = vp->v_mountedhere->mnt_stat.f_iosize;
@@ -2817,7 +2817,7 @@ biodone(register struct buf * bp)
(int) m->pindex, (int)(foff >> 32),
(int) foff & 0xffffffff, resid, i);
#endif
- if (!vn_isdisk(vp))
+ if (!vn_isdisk(vp, NULL))
#if !defined(MAX_PERF)
printf(" iosize: %ld, lblkno: %d, flags: 0x%lx, npages: %d\n",
bp->b_vp->v_mount->mnt_stat.f_iosize,
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 4e6123e..97d6251 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -1012,7 +1012,7 @@ sched_sync(void)
* slot we are safe.
*/
if (TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
- !vn_isdisk(vp))
+ !vn_isdisk(vp, NULL))
panic("sched_sync: fsync failed vp %p tag %d", vp, vp->v_tag);
/*
* Put us back on the worklist. The worklist
@@ -2516,7 +2516,7 @@ vfs_object_create(vp, p, cred)
vm_object_t object;
int error = 0;
- if (!vn_isdisk(vp) && vn_canvmio(vp) == FALSE)
+ if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE)
return 0;
retry:
@@ -2875,15 +2875,27 @@ vn_todev(vp)
* Check if vnode represents a disk device
*/
int
-vn_isdisk(vp)
+vn_isdisk(vp, errp)
struct vnode *vp;
+ int *errp;
{
- if (vp->v_type != VBLK && vp->v_type != VCHR)
+ if (vp->v_type != VBLK && vp->v_type != VCHR) {
+ if (errp != NULL)
+ *errp = ENOTBLK;
return (0);
- if (!devsw(vp->v_rdev))
+ }
+ if (!devsw(vp->v_rdev)) {
+ if (errp != NULL)
+ *errp = ENXIO;
return (0);
- if (!(devsw(vp->v_rdev)->d_flags & D_DISK))
+ }
+ if (!(devsw(vp->v_rdev)->d_flags & D_DISK)) {
+ if (errp != NULL)
+ *errp = ENOTBLK;
return (0);
+ }
+ if (errp != NULL)
+ *errp = 0;
return (1);
}
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 4e6123e..97d6251 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1012,7 +1012,7 @@ sched_sync(void)
* slot we are safe.
*/
if (TAILQ_EMPTY(&vp->v_dirtyblkhd) &&
- !vn_isdisk(vp))
+ !vn_isdisk(vp, NULL))
panic("sched_sync: fsync failed vp %p tag %d", vp, vp->v_tag);
/*
* Put us back on the worklist. The worklist
@@ -2516,7 +2516,7 @@ vfs_object_create(vp, p, cred)
vm_object_t object;
int error = 0;
- if (!vn_isdisk(vp) && vn_canvmio(vp) == FALSE)
+ if (!vn_isdisk(vp, NULL) && vn_canvmio(vp) == FALSE)
return 0;
retry:
@@ -2875,15 +2875,27 @@ vn_todev(vp)
* Check if vnode represents a disk device
*/
int
-vn_isdisk(vp)
+vn_isdisk(vp, errp)
struct vnode *vp;
+ int *errp;
{
- if (vp->v_type != VBLK && vp->v_type != VCHR)
+ if (vp->v_type != VBLK && vp->v_type != VCHR) {
+ if (errp != NULL)
+ *errp = ENOTBLK;
return (0);
- if (!devsw(vp->v_rdev))
+ }
+ if (!devsw(vp->v_rdev)) {
+ if (errp != NULL)
+ *errp = ENXIO;
return (0);
- if (!(devsw(vp->v_rdev)->d_flags & D_DISK))
+ }
+ if (!(devsw(vp->v_rdev)->d_flags & D_DISK)) {
+ if (errp != NULL)
+ *errp = ENOTBLK;
return (0);
+ }
+ if (errp != NULL)
+ *errp = 0;
return (1);
}
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index edbf7b1..bb390ae 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -473,9 +473,7 @@ vn_stat(vp, sb, p)
if (vap->va_type == VREG) {
sb->st_blksize = vap->va_blocksize;
- } else if ((vp->v_type == VBLK || vp->v_type == VCHR) &&
- devsw(vp->v_rdev) && (devsw(vp->v_rdev)->d_flags & D_DISK)) {
- /* XXX use vn_isdisk() above once VCHR is also disk */
+ } else if (vn_isdisk(vp, NULL)) {
sb->st_blksize = vp->v_rdev->si_bsize_best;
if (sb->st_blksize < vp->v_rdev->si_bsize_phys)
sb->st_blksize = vp->v_rdev->si_bsize_phys;
diff --git a/sys/miscfs/devfs/devfs_vnops.c b/sys/miscfs/devfs/devfs_vnops.c
index 4d1c8bd..51315c7 100644
--- a/sys/miscfs/devfs/devfs_vnops.c
+++ b/sys/miscfs/devfs/devfs_vnops.c
@@ -1316,7 +1316,7 @@ devfs_open( struct vop_open_args *ap)
if ( (dsw == NULL) || (dsw->d_open == NULL))
return ENXIO;
if (ap->a_cred != FSCRED && (ap->a_mode & FWRITE) &&
- vn_isdisk(vp)) {
+ vn_isdisk(vp, NULL)) {
/*
* When running in very secure mode, do not allow
* opens for writing of any disk devices.
diff --git a/sys/miscfs/specfs/spec_vnops.c b/sys/miscfs/specfs/spec_vnops.c
index 4f8488e..9641897 100644
--- a/sys/miscfs/specfs/spec_vnops.c
+++ b/sys/miscfs/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;
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c
index 13272af..94578e8 100644
--- a/sys/msdosfs/msdosfs_vfsops.c
+++ b/sys/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/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index d4883be..089c6eb 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/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/sys/vnode.h b/sys/sys/vnode.h
index e37035a..376a21c 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -569,7 +569,7 @@ int vrecycle __P((struct vnode *vp, struct simplelock *inter_lkp,
struct proc *p));
int vn_close __P((struct vnode *vp,
int flags, struct ucred *cred, struct proc *p));
-int vn_isdisk __P((struct vnode *vp));
+int vn_isdisk __P((struct vnode *vp, int *errp));
int vn_lock __P((struct vnode *vp, int flags, struct proc *p));
#ifdef DEBUG_LOCKS
int debug_vn_lock __P((struct vnode *vp, int flags, struct proc *p,
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c
index 8f7e3f2..46495f3 100644
--- a/sys/ufs/ffs/ffs_softdep.c
+++ b/sys/ufs/ffs/ffs_softdep.c
@@ -3744,7 +3744,7 @@ softdep_fsync_mountdev(vp)
struct buf *bp, *nbp;
struct worklist *wk;
- if (!vn_isdisk(vp))
+ if (!vn_isdisk(vp, NULL))
panic("softdep_fsync_mountdev: vnode not a disk");
ACQUIRE_LOCK(&lk);
for (bp = TAILQ_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
@@ -3806,7 +3806,7 @@ softdep_sync_metadata(ap)
* Check whether this vnode is involved in a filesystem
* that is doing soft dependency processing.
*/
- if (!vn_isdisk(vp)) {
+ if (!vn_isdisk(vp, NULL)) {
if (!DOINGSOFTDEP(vp))
return (0);
} else
@@ -4031,7 +4031,8 @@ loop:
* way to accomplish this is to sync the entire filesystem (luckily
* this happens rarely).
*/
- if (vn_isdisk(vp) && vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) &&
+ if (vn_isdisk(vp, NULL) &&
+ vp->v_specmountpoint && !VOP_ISLOCKED(vp, NULL) &&
(error = VFS_SYNC(vp->v_specmountpoint, MNT_WAIT, ap->a_cred,
ap->a_p)) != 0)
return (error);
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 77e821f..511c827 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -280,10 +280,8 @@ ffs_mount( mp, path, data, ndp, p)
NDFREE(ndp, NDF_ONLY_PNBUF);
devvp = ndp->ni_vp;
- if (!vn_isdisk(devvp)) {
- err = ENOTBLK;
+ if (!vn_isdisk(devvp, &err))
goto error_2;
- }
/*
* If mount by non-root, then verify that user has necessary
@@ -442,7 +440,7 @@ ffs_reload(mp, cred, p)
* Only VMIO the backing device if the backing device is a real
* block device. See ffs_mountmfs() for more details.
*/
- if (devvp->v_tag != VT_MFS && vn_isdisk(devvp)) {
+ if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) {
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
vfs_object_create(devvp, p, p->p_ucred);
simple_lock(&devvp->v_interlock);
@@ -599,7 +597,7 @@ ffs_mountfs(devvp, mp, p, malloctype)
* Note that it is optional that the backing device be VMIOed. This
* increases the opportunity for metadata caching.
*/
- if (devvp->v_tag != VT_MFS && vn_isdisk(devvp)) {
+ if (devvp->v_tag != VT_MFS && vn_isdisk(devvp, NULL)) {
vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
vfs_object_create(devvp, p, p->p_ucred);
simple_lock(&devvp->v_interlock);
diff --git a/sys/ufs/ffs/ffs_vnops.c b/sys/ufs/ffs/ffs_vnops.c
index 6087d81..5a7ce0b 100644
--- a/sys/ufs/ffs/ffs_vnops.c
+++ b/sys/ufs/ffs/ffs_vnops.c
@@ -126,9 +126,8 @@ ffs_fsync(ap)
int s, error, wait, passes, skipmeta;
daddr_t lbn;
-
wait = (ap->a_waitfor == MNT_WAIT);
- if (vn_isdisk(vp)) {
+ if (vn_isdisk(vp, NULL)) {
lbn = INT_MAX;
if (vp->v_specmountpoint != NULL &&
(vp->v_specmountpoint->mnt_flag & MNT_SOFTDEP))
@@ -265,7 +264,7 @@ loop:
goto loop;
}
#ifdef DIAGNOSTIC
- if (!vn_isdisk(vp))
+ if (!vn_isdisk(vp, NULL))
vprint("ffs_fsync: dirty", vp);
#endif
}
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c
index 23bddad..9577c59 100644
--- a/sys/vm/vm_swap.c
+++ b/sys/vm/vm_swap.c
@@ -202,8 +202,7 @@ swapon(p, uap)
NDFREE(&nd, NDF_ONLY_PNBUF);
vp = nd.ni_vp;
- if (!vn_isdisk(vp))
- error = ENOTBLK;
+ vn_isdisk(vp, &error);
if (!error)
error = swaponvp(p, vp, vp->v_rdev, 0);
OpenPOWER on IntegriCloud