PERFORCE change 126033 for review
Xin LI
delphij at FreeBSD.org
Tue Sep 4 00:55:26 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126033
Change 126033 by delphij at 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);
More information about the p4-projects
mailing list