msdosfs_vfsops.c (93fe42b62f29a4eb4e01435e83e13f4a8b0e6a2e) msdosfs_vfsops.c (4eb3abf0a5bb26809d9c29c9213e5e1931e77270)
1/* $FreeBSD$ */
2/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
3
4/*-
5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).

--- 265 unchanged lines hidden (view full) ---

274 flags = WRITECLOSE;
275 if (mp->mnt_flag & MNT_FORCE)
276 flags |= FORCECLOSE;
277 error = vflush(mp, 0, flags, td);
278 if (error)
279 return (error);
280 DROP_GIANT();
281 g_topology_lock();
1/* $FreeBSD$ */
2/* $NetBSD: msdosfs_vfsops.c,v 1.51 1997/11/17 15:36:58 ws Exp $ */
3
4/*-
5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH.
7 * All rights reserved.
8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below).

--- 265 unchanged lines hidden (view full) ---

274 flags = WRITECLOSE;
275 if (mp->mnt_flag & MNT_FORCE)
276 flags |= FORCECLOSE;
277 error = vflush(mp, 0, flags, td);
278 if (error)
279 return (error);
280 DROP_GIANT();
281 g_topology_lock();
282 g_access(pmp->pm_cp, 0, -1, 0);
282 error = g_access(pmp->pm_cp, 0, -1, 0);
283 g_topology_unlock();
284 PICKUP_GIANT();
283 g_topology_unlock();
284 PICKUP_GIANT();
285 if (error)
286 return (error);
287
285 /* Now the volume is clean. Mark it. */
286 error = markvoldirty(pmp, 0);
287 if (error && (flags & FORCECLOSE) == 0)
288 return (error);
289 } else if ((pmp->pm_flags & MSDOSFSMNT_RONLY) &&
290 !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
291 /*
292 * If upgrade to read-write by non-root, then verify

--- 104 unchanged lines hidden (view full) ---

397 struct byte_bpb50 *b50;
398 struct byte_bpb710 *b710;
399 u_int8_t SecPerClust;
400 u_long clusters;
401 int ronly, error;
402 struct g_consumer *cp;
403 struct bufobj *bo;
404
288 /* Now the volume is clean. Mark it. */
289 error = markvoldirty(pmp, 0);
290 if (error && (flags & FORCECLOSE) == 0)
291 return (error);
292 } else if ((pmp->pm_flags & MSDOSFSMNT_RONLY) &&
293 !vfs_flagopt(mp->mnt_optnew, "ro", NULL, 0)) {
294 /*
295 * If upgrade to read-write by non-root, then verify

--- 104 unchanged lines hidden (view full) ---

400 struct byte_bpb50 *b50;
401 struct byte_bpb710 *b710;
402 u_int8_t SecPerClust;
403 u_long clusters;
404 int ronly, error;
405 struct g_consumer *cp;
406 struct bufobj *bo;
407
405 ronly = !vfs_getopt(mp->mnt_optnew, "ro", NULL, NULL);
408 ronly = (mp->mnt_flag & MNT_RDONLY) != 0;
406 /* XXX: use VOP_ACCESS to check FS perms */
407 DROP_GIANT();
408 g_topology_lock();
409 /* XXX: use VOP_ACCESS to check FS perms */
410 DROP_GIANT();
411 g_topology_lock();
409 error = g_vfs_open(devvp, &cp, "msdos", ronly ? 0 : 1);
412 error = g_vfs_open(devvp, &cp, "msdosfs", ronly ? 0 : 1);
410 g_topology_unlock();
411 PICKUP_GIANT();
412 VOP_UNLOCK(devvp, 0, td);
413 if (error)
414 return (error);
415
416 bo = &devvp->v_bufobj;
417 bp = NULL; /* both used in error_exit */

--- 23 unchanged lines hidden (view full) ---

441#endif
442
443 pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK | M_ZERO);
444 pmp->pm_mountp = mp;
445 pmp->pm_cp = cp;
446 pmp->pm_bo = bo;
447
448 /*
413 g_topology_unlock();
414 PICKUP_GIANT();
415 VOP_UNLOCK(devvp, 0, td);
416 if (error)
417 return (error);
418
419 bo = &devvp->v_bufobj;
420 bp = NULL; /* both used in error_exit */

--- 23 unchanged lines hidden (view full) ---

444#endif
445
446 pmp = malloc(sizeof *pmp, M_MSDOSFSMNT, M_WAITOK | M_ZERO);
447 pmp->pm_mountp = mp;
448 pmp->pm_cp = cp;
449 pmp->pm_bo = bo;
450
451 /*
452 * Initialize ownerships and permissions, since nothing else will
453 * initialize them iff we are mounting root.
454 */
455 pmp->pm_uid = UID_ROOT;
456 pmp->pm_gid = GID_WHEEL;
457 pmp->pm_mask = pmp->pm_dirmask = S_IXUSR | S_IXGRP | S_IXOTH |
458 S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR;
459
460 /*
449 * Experimental support for large MS-DOS filesystems.
450 * WARNING: This uses at least 32 bytes of kernel memory (which is not
451 * reclaimed until the FS is unmounted) for each file on disk to map
452 * between the 32-bit inode numbers used by VFS and the 64-bit
453 * pseudo-inode numbers used internally by msdosfs. This is only
454 * safe to use in certain controlled situations (e.g. read-only FS
455 * with less than 1 million files).
456 * Since the mappings do not persist across unmounts (or reboots), these

--- 485 unchanged lines hidden ---
461 * Experimental support for large MS-DOS filesystems.
462 * WARNING: This uses at least 32 bytes of kernel memory (which is not
463 * reclaimed until the FS is unmounted) for each file on disk to map
464 * between the 32-bit inode numbers used by VFS and the 64-bit
465 * pseudo-inode numbers used internally by msdosfs. This is only
466 * safe to use in certain controlled situations (e.g. read-only FS
467 * with less than 1 million files).
468 * Since the mappings do not persist across unmounts (or reboots), these

--- 485 unchanged lines hidden ---