diff options
author | phk <phk@FreeBSD.org> | 1999-11-09 14:15:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-09 14:15:33 +0000 |
commit | 8c9bc6b1465e40acc6ad183f2048b478838442e7 (patch) | |
tree | 9ecaa92a6de6fdd1aeb455d59ce671785a1d0801 /sys/gnu | |
parent | 90188d1d4bda4b0a373a1823aa4a02e3f86da9c6 (diff) | |
download | FreeBSD-src-8c9bc6b1465e40acc6ad183f2048b478838442e7.zip FreeBSD-src-8c9bc6b1465e40acc6ad183f2048b478838442e7.tar.gz |
Next step in the device cleanup process.
Correctly lock vnodes when calling VOP_OPEN() from filesystem mount code.
Unify spec_open() for bdev and cdev cases.
Remove the disabled bdev specific read/write code.
Diffstat (limited to 'sys/gnu')
-rw-r--r-- | sys/gnu/ext2fs/ext2_vfsops.c | 5 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_vfsops.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index 6f2e487..daa7e05 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -607,7 +607,10 @@ ext2_mountfs(devvp, mp, p) #endif ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) != 0) + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); + VOP_UNLOCK(devvp, 0, p); + if (error) return (error); if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0) size = DEV_BSIZE; diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index 6f2e487..daa7e05 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -607,7 +607,10 @@ ext2_mountfs(devvp, mp, p) #endif ronly = (mp->mnt_flag & MNT_RDONLY) != 0; - if ((error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p)) != 0) + vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p); + error = VOP_OPEN(devvp, ronly ? FREAD : FREAD|FWRITE, FSCRED, p); + VOP_UNLOCK(devvp, 0, p); + if (error) return (error); if (VOP_IOCTL(devvp, DIOCGPART, (caddr_t)&dpart, FREAD, NOCRED, p) != 0) size = DEV_BSIZE; |