Date: Tue, 4 Sep 2007 07:55:25 GMT From: Xin LI <delphij@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 126033 for review Message-ID: <200709040755.l847tPbn003371@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=126033 Change 126033 by delphij@delphij_odin on 2007/09/04 07:54:39 Use bde@'s proposed changes. Affected files ... .. //depot/projects/delphij_fork/sys/fs/msdosfs/msdosfs_vfsops.c#10 edit Differences ... ==== //depot/projects/delphij_fork/sys/fs/msdosfs/msdosfs_vfsops.c#10 (text+ko) ==== @@ -275,8 +275,8 @@ return (error); /* - * Now the volume is clean. We have to mark it so - * when the device is still r/w. + * Now the volume is clean. Mark it so while the + * device is still rw. */ error = markvoldirty(pmp, 0); if (error) { @@ -284,7 +284,7 @@ return (error); } - /* Downgrade the device from rw to ro. */ + /* Downgrade the device from rw to ro. */ DROP_GIANT(); g_topology_lock(); error = g_access(pmp->pm_cp, 0, -1, 0); @@ -299,9 +299,8 @@ * Backing out after an error was painful in the * above. Now we are committed to succeeding. */ - pmp->pm_fmod = 0; + pmp->pm_fmod = 0; pmp->pm_flags |= MSDOSFSMNT_RONLY; - MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; MNT_IUNLOCK(mp); @@ -329,22 +328,22 @@ PICKUP_GIANT(); if (error) return (error); - } - /* - * XXX: pm_fmod is only used to implement a panic - * if we forget to set it here. - */ - pmp->pm_fmod = 1; - pmp->pm_flags &= ~MSDOSFSMNT_RONLY; - MNT_ILOCK(mp); - mp->mnt_flag &= ~MNT_RDONLY; - MNT_IUNLOCK(mp); + /* + * XXX: pm_fmod is only used to implement a panic + * if we forget to set it here. + */ + pmp->pm_fmod = 1; + pmp->pm_flags &= ~MSDOSFSMNT_RONLY; + MNT_ILOCK(mp); + mp->mnt_flag &= ~MNT_RDONLY; + MNT_IUNLOCK(mp); - /* Now that the volume is modifiable, mark it dirty. */ - error = markvoldirty(pmp, 1); - if (error) - return (error); + /* Now that the volume is modifiable, mark it dirty. */ + error = markvoldirty(pmp, 1); + if (error) + return (error); + } } /* * Not an update, or updating the name: look up the name @@ -735,7 +734,7 @@ pmp->pm_flags |= MSDOSFSMNT_RONLY; else { if ((error = markvoldirty(pmp, 1)) != 0) { - (void)markvoldirty(pmp, 0); + (void)markvoldirty(pmp, 0); goto error_exit; } pmp->pm_fmod = 1; @@ -787,15 +786,13 @@ if (error) return error; pmp = VFSTOMSDOSFS(mp); - if ((pmp->pm_flags & MSDOSFSMNT_RONLY) == 0) { error = markvoldirty(pmp, 0); if (error) { (void)markvoldirty(pmp, 1); return (error); } - } - + } if (pmp->pm_flags & MSDOSFSMNT_KICONV && msdosfs_iconv) { if (pmp->pm_w2u) msdosfs_iconv->close(pmp->pm_w2u); @@ -806,6 +803,7 @@ if (pmp->pm_u2d) msdosfs_iconv->close(pmp->pm_u2d); } + #ifdef MSDOSFS_DEBUG { struct vnode *vp = pmp->pm_devvp; @@ -830,9 +828,8 @@ PICKUP_GIANT(); vrele(pmp->pm_devvp); free(pmp->pm_inusemap, M_MSDOSFSFAT); - if (pmp->pm_flags & MSDOSFS_LARGEFS) { + if (pmp->pm_flags & MSDOSFS_LARGEFS) msdosfs_fileno_free(mp); - } free(pmp, M_MSDOSFSMNT); mp->mnt_data = (qaddr_t)0; MNT_ILOCK(mp);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709040755.l847tPbn003371>