<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Batang;
panose-1:2 3 6 0 0 1 1 1 1 1;}
@font-face
{font-family:"\@Batang";
panose-1:2 3 6 0 0 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
h1
{margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
text-indent:-.25in;
page-break-after:avoid;
mso-list:l0 level1 lfo8;
font-size:12.0pt;
font-family:"Times New Roman";
text-decoration:underline;}
h2
{margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:1.0in;
margin-bottom:.0001pt;
text-indent:-.25in;
page-break-after:avoid;
mso-list:l0 level2 lfo8;
font-size:12.0pt;
font-family:"Times New Roman";}
h3
{margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:1.5in;
margin-bottom:.0001pt;
text-indent:-9.0pt;
mso-list:l0 level3 lfo8;
font-size:12.0pt;
font-family:"Times New Roman";
font-weight:normal;}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p.MsoAutoSig, li.MsoAutoSig, div.MsoAutoSig
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
p.Code, li.Code, div.Code
{margin-top:0in;
margin-right:0in;
margin-bottom:0in;
margin-left:.5in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.Appendix1, li.Appendix1, div.Appendix1
{margin:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:12.0pt;
font-family:"Times New Roman";
font-weight:bold;
text-decoration:underline;}
p.Appendix2, li.Appendix2, div.Appendix2
{margin:0in;
margin-bottom:.0001pt;
page-break-after:avoid;
font-size:12.0pt;
font-family:"Times New Roman";
font-weight:bold;}
p.Appendix3, li.Appendix3, div.Appendix3
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle21
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
/* List Definitions */
@list l0
{mso-list-id:944188057;
mso-list-template-ids:-42284356;}
@list l0:level1
{mso-level-style-link:"Heading 1";
mso-level-tab-stop:.25in;
mso-level-number-position:left;
margin-left:0in;
text-indent:0in;
mso-ansi-font-weight:bold;
mso-ansi-font-style:normal;
text-decoration:none;
text-underline:none;}
@list l0:level2
{mso-level-style-link:"Heading 2";
mso-level-legal-format:yes;
mso-level-text:"%1\.%2\.";
mso-level-tab-stop:.5in;
mso-level-number-position:left;
margin-left:.5in;
text-indent:-.5in;
font-family:"Times New Roman";
font-variant:normal !important;
mso-hide:none;
text-transform:none;
position:relative;
top:0pt;
mso-text-raise:0pt;
letter-spacing:0pt;
mso-font-kerning:0pt;
text-effect:none;
text-shadow:none;
text-effect:none;
text-effect:none;
font-emphasize:none;
mso-ansi-font-weight:normal;
mso-bidi-font-weight:normal;
mso-ansi-font-style:normal;
mso-bidi-font-style:normal;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;
vertical-align:baseline;}
@list l0:level3
{mso-level-style-link:"Heading 3";
mso-level-text:"%1\.%2\.%3\.";
mso-level-tab-stop:.5in;
mso-level-number-position:left;
margin-left:.5in;
text-indent:-.5in;
font-family:"Times New Roman";
font-variant:normal !important;
mso-hide:none;
text-transform:none;
position:relative;
top:0pt;
mso-text-raise:0pt;
letter-spacing:0pt;
mso-font-kerning:0pt;
text-effect:none;
text-shadow:none;
text-effect:none;
text-effect:none;
font-emphasize:none;
mso-ansi-font-weight:normal;
mso-bidi-font-weight:normal;
mso-ansi-font-style:normal;
mso-bidi-font-style:normal;
text-decoration:none;
text-underline:none;
text-decoration:none;
text-line-through:none;
vertical-align:baseline;}
@list l0:level4
{mso-level-text:"%1\.%2\.%3\.%4\.";
mso-level-tab-stop:1.45in;
mso-level-number-position:left;
margin-left:1.45in;
text-indent:-.75in;}
@list l0:level5
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.";
mso-level-tab-stop:1.55in;
mso-level-number-position:left;
margin-left:1.55in;
text-indent:-.55in;}
@list l0:level6
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.";
mso-level-tab-stop:1.9in;
mso-level-number-position:left;
margin-left:1.9in;
text-indent:-.65in;}
@list l0:level7
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.";
mso-level-tab-stop:2.25in;
mso-level-number-position:left;
margin-left:2.25in;
text-indent:-.75in;}
@list l0:level8
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.";
mso-level-tab-stop:2.6in;
mso-level-number-position:left;
margin-left:2.6in;
text-indent:-.85in;}
@list l0:level9
{mso-level-text:"%1\.%2\.%3\.%4\.%5\.%6\.%7\.%8\.%9\.";
mso-level-tab-stop:3.0in;
mso-level-number-position:left;
margin-left:3.0in;
text-indent:-1.0in;}
ol
{margin-bottom:0in;}
ul
{margin-bottom:0in;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I have implemented a dos file system (msdos_*) on a flash
device.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Because it is possible for the user to power down the system
unexpectedly, I want to sync the file system to the flash device after a 3
second idle time. How do I externally force a sync on msdos from another
thread?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>A related problem is that I use FTP (ftpd.c) to externally
read/write files on the msdos formatted flash. I have the idle timeout
set to 3 minutes for the FTP connection. After 3 minutes, ftpd issues a
chdir("/") which eventually calls msdos_free_node_info() that calls
fat_file_close() and may try to write out data to the flash. This is a
problem because if the power is turned off at that time the flash is corrupted.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>So whatever method I use to sync msdos needs to update and
write out the fat so that the subsequent msdos_free_node_info() does nothing.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Thanks for any advice.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=MsoAutoSig><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Cliff<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>