ext2_vfsops.c (46635) | ext2_vfsops.c (46676) |
---|---|
1/* 2 * modified for EXT2FS support in Lites 1.1 3 * 4 * Aug 1995, Godmar Back (gback@cs.utah.edu) 5 * University of Utah, Department of Computer Science 6 */ 7/* 8 * Copyright (c) 1989, 1991, 1993, 1994 --- 122 unchanged lines hidden (view full) --- 131 if ((error = bdevvp(rootdev, &rootvp))) { 132 printf("ext2_mountroot: can't find rootvp"); 133 return (error); 134 } 135 mp = bsd_malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK); 136 bzero((char *)mp, (u_long)sizeof(struct mount)); 137 mp->mnt_op = &ext2fs_vfsops; 138 mp->mnt_flag = MNT_RDONLY; | 1/* 2 * modified for EXT2FS support in Lites 1.1 3 * 4 * Aug 1995, Godmar Back (gback@cs.utah.edu) 5 * University of Utah, Department of Computer Science 6 */ 7/* 8 * Copyright (c) 1989, 1991, 1993, 1994 --- 122 unchanged lines hidden (view full) --- 131 if ((error = bdevvp(rootdev, &rootvp))) { 132 printf("ext2_mountroot: can't find rootvp"); 133 return (error); 134 } 135 mp = bsd_malloc((u_long)sizeof(struct mount), M_MOUNT, M_WAITOK); 136 bzero((char *)mp, (u_long)sizeof(struct mount)); 137 mp->mnt_op = &ext2fs_vfsops; 138 mp->mnt_flag = MNT_RDONLY; |
139 if (bdevsw(major(rootdev))->d_flags & D_NOCLUSTERR) | 139 if (bdevsw(rootdev)->d_flags & D_NOCLUSTERR) |
140 mp->mnt_flag |= MNT_NOCLUSTERR; | 140 mp->mnt_flag |= MNT_NOCLUSTERR; |
141 if (bdevsw(major(rootdev))->d_flags & D_NOCLUSTERW) | 141 if (bdevsw(rootdev)->d_flags & D_NOCLUSTERW) |
142 mp->mnt_flag |= MNT_NOCLUSTERW; 143 if (error = ext2_mountfs(rootvp, mp, p)) { 144 bsd_free(mp, M_MOUNT); 145 return (error); 146 } 147 if (error = vfs_lock(mp)) { 148 (void)ext2_unmount(mp, 0, p); 149 bsd_free(mp, M_MOUNT); --- 46 unchanged lines hidden (view full) --- 196 * read/write; if there is no device name, that's all we do. 197 * Disallow clearing MNT_NOCLUSTERR and MNT_NOCLUSTERW flags, 198 * if block device requests. 199 */ 200 if (mp->mnt_flag & MNT_UPDATE) { 201 ump = VFSTOUFS(mp); 202 fs = ump->um_e2fs; 203 error = 0; | 142 mp->mnt_flag |= MNT_NOCLUSTERW; 143 if (error = ext2_mountfs(rootvp, mp, p)) { 144 bsd_free(mp, M_MOUNT); 145 return (error); 146 } 147 if (error = vfs_lock(mp)) { 148 (void)ext2_unmount(mp, 0, p); 149 bsd_free(mp, M_MOUNT); --- 46 unchanged lines hidden (view full) --- 196 * read/write; if there is no device name, that's all we do. 197 * Disallow clearing MNT_NOCLUSTERR and MNT_NOCLUSTERW flags, 198 * if block device requests. 199 */ 200 if (mp->mnt_flag & MNT_UPDATE) { 201 ump = VFSTOUFS(mp); 202 fs = ump->um_e2fs; 203 error = 0; |
204 if (bdevsw(major(ump->um_dev))->d_flags & D_NOCLUSTERR) | 204 if (bdevsw(ump->um_dev)->d_flags & D_NOCLUSTERR) |
205 mp->mnt_flag |= MNT_NOCLUSTERR; | 205 mp->mnt_flag |= MNT_NOCLUSTERR; |
206 if (bdevsw(major(ump->um_dev))->d_flags & D_NOCLUSTERW) | 206 if (bdevsw(ump->um_dev)->d_flags & D_NOCLUSTERW) |
207 mp->mnt_flag |= MNT_NOCLUSTERW; 208 if (fs->s_rd_only == 0 && (mp->mnt_flag & MNT_RDONLY)) { 209 flags = WRITECLOSE; 210 if (mp->mnt_flag & MNT_FORCE) 211 flags |= FORCECLOSE; 212 if (vfs_busy(mp, LK_NOWAIT, 0, p)) 213 return (EBUSY); 214 error = ext2_flushfiles(mp, flags, p); --- 57 unchanged lines hidden (view full) --- 272 return (error); 273 devvp = ndp->ni_vp; 274 275 if (devvp->v_type != VBLK) { 276 vrele(devvp); 277 return (ENOTBLK); 278 } 279 if (major(devvp->v_rdev) >= nblkdev || | 207 mp->mnt_flag |= MNT_NOCLUSTERW; 208 if (fs->s_rd_only == 0 && (mp->mnt_flag & MNT_RDONLY)) { 209 flags = WRITECLOSE; 210 if (mp->mnt_flag & MNT_FORCE) 211 flags |= FORCECLOSE; 212 if (vfs_busy(mp, LK_NOWAIT, 0, p)) 213 return (EBUSY); 214 error = ext2_flushfiles(mp, flags, p); --- 57 unchanged lines hidden (view full) --- 272 return (error); 273 devvp = ndp->ni_vp; 274 275 if (devvp->v_type != VBLK) { 276 vrele(devvp); 277 return (ENOTBLK); 278 } 279 if (major(devvp->v_rdev) >= nblkdev || |
280 bdevsw(major(devvp->v_rdev)) == NULL) { | 280 bdevsw(devvp->v_rdev) == NULL) { |
281 vrele(devvp); 282 return (ENXIO); 283 } 284 285 /* 286 * If mount by non-root, then verify that user has necessary 287 * permissions on the device. 288 */ --- 5 unchanged lines hidden (view full) --- 294 if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) { 295 vput(devvp); 296 return (error); 297 } 298 VOP_UNLOCK(devvp, 0, p); 299 } 300 301 if ((mp->mnt_flag & MNT_UPDATE) == 0) { | 281 vrele(devvp); 282 return (ENXIO); 283 } 284 285 /* 286 * If mount by non-root, then verify that user has necessary 287 * permissions on the device. 288 */ --- 5 unchanged lines hidden (view full) --- 294 if ((error = VOP_ACCESS(devvp, accessmode, p->p_ucred, p)) != 0) { 295 vput(devvp); 296 return (error); 297 } 298 VOP_UNLOCK(devvp, 0, p); 299 } 300 301 if ((mp->mnt_flag & MNT_UPDATE) == 0) { |
302 if (bdevsw(major(devvp->v_rdev))->d_flags & D_NOCLUSTERR) | 302 if (bdevsw(devvp->v_rdev)->d_flags & D_NOCLUSTERR) |
303 mp->mnt_flag |= MNT_NOCLUSTERR; | 303 mp->mnt_flag |= MNT_NOCLUSTERR; |
304 if (bdevsw(major(devvp->v_rdev))->d_flags & D_NOCLUSTERW) | 304 if (bdevsw(devvp->v_rdev)->d_flags & D_NOCLUSTERW) |
305 mp->mnt_flag |= MNT_NOCLUSTERW; 306 error = ext2_mountfs(devvp, mp, p); 307 } else { 308 if (devvp != ump->um_devvp) 309 error = EINVAL; /* needs translation */ 310 else 311 vrele(devvp); 312 } --- 879 unchanged lines hidden --- | 305 mp->mnt_flag |= MNT_NOCLUSTERW; 306 error = ext2_mountfs(devvp, mp, p); 307 } else { 308 if (devvp != ump->um_devvp) 309 error = EINVAL; /* needs translation */ 310 else 311 vrele(devvp); 312 } --- 879 unchanged lines hidden --- |