MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vn_isdisk_error

Function vn_isdisk_error

freebsd/kern/vfs_subr.c:5141–5162  ·  view source on GitHub ↗

* Check if vnode represents a disk device */

Source from the content-addressed store, hash-verified

5139 * Check if vnode represents a disk device
5140 */
5141bool
5142vn_isdisk_error(struct vnode *vp, int *errp)
5143{
5144 int error;
5145
5146 if (vp->v_type != VCHR) {
5147 error = ENOTBLK;
5148 goto out;
5149 }
5150 error = 0;
5151 dev_lock();
5152 if (vp->v_rdev == NULL)
5153 error = ENXIO;
5154 else if (vp->v_rdev->si_devsw == NULL)
5155 error = ENXIO;
5156 else if (!(vp->v_rdev->si_devsw->d_flags & D_DISK))
5157 error = ENOTBLK;
5158 dev_unlock();
5159out:
5160 *errp = error;
5161 return (error == 0);
5162}
5163
5164bool
5165vn_isdisk(struct vnode *vp)

Callers 2

vn_isdiskFunction · 0.85
sys_swaponFunction · 0.85

Calls 2

dev_lockFunction · 0.85
dev_unlockFunction · 0.85

Tested by

no test coverage detected