<div>Hi Joel, Ray, and all,</div>
<div> </div>
<div>I know you are rather busy to reply all the mails, but if it does not bother too much, can I request for some comments on my previous investigation on FIFOFS (see attachment).<br><br>Thanks,</div>
<div>Wei Shen</div>
<div> </div>
<div>
<div><span class="gmail_quote">On 3/22/08, <b class="gmail_sendername">Wei Shen</b> <<a href="mailto:cquark@gmail.com">cquark@gmail.com</a>> wrote:</span></div>
<div><span class="gmail_quote"></span> </div>
<div><span class="gmail_quote"></span><span class="gmail_quote"><span class="gmail_quote"><span class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">O</blockquote></span>n 3/21/08, <b class="gmail_sendername">Joel Sherrill</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>> wrote:</span></span></div>

<div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>I am torn between a dedicated filesystem and adding a filesystem to the<br>IMFS.  The dedicated filesystem makes sense and is cleaner./  If you<br>
don't want this capability, don't mount it.<br><br>Make sure about the pipe() and mkfifo() calls.  Careful reading of the<br>opengroup standard may force a decision.  I hope we can get away with the dedicated filesystem.  It sounds cleaner and easier to drop out.</blockquote>

<div> </div>
<div>Today, I studied the RTEMS FS and IMFS implementation. Seems hard to implement FIFO as a virtual fs, for the lack of a complete VFS layer, especially a VFS inode abstraction in RTEMS.</div>
<div> </div>
<div>If we want to make FIFOFS entirely independent of the host FS (e.g. IMFS) which a fifo file resides, we would have to:</div>
<div>1) define a new data-structure for FIFO file-nodes, which repeats many identical fields (atime, uid, ...) with host FS structures (e.g. jnode in IMFS).</div>
<div>This is required because otherwise the file handers of FIFOFS can not understand the <span style="COLOR: #ee6600; BACKGROUND-COLOR: yellow">node</span>_access structure passed to them from the FS interface.</div>
<div> </div>
<div>2) reimplement a full set of FS handlers.</div>
<div>Since filenode structure is changed, no handler of the host FS can be used any more.</div>
<div> </div>
<div>3) hook the host fs (in many places) to add special handling for FIFO files.</div>
<div> </div>
<div>An OS with a VFS inode abstraction needs not to do all these, because FIFOFS can then share the common i<span style="COLOR: #ee6600; BACKGROUND-COLOR: yellow">node</span> structrure and many FS handlers (i.e. inode operations) with host FSes, and the VFS layer is respossible for maintaining i<span style="COLOR: #ee6600; BACKGROUND-COLOR: yellow">node</span> attributes. Usually, only needs to hook a few FS routines like mknode and open.</div>

<div> </div>
<div> </div>
<div>An alternative implementation is to design a FIFO interface to FS and implement part of file handlers demanded (open, write, rmnod, ...). FSes should provide a set of handlers (as IMFS currently done for device files) specific to FIFO files that invoke the FIFO interface and maintains filenode (e.g. jnode) states. Part of the FIFO handlers (that do not alter filenode states) can be directly plugged into the file handler table of the host FSes.</div>

<div> </div>
<div>By so, FIFO can still be encapsulated into a independent module, but only requires a little modification on FS code.<span></span> </div>
<div> </div>
<div>The open project page suggests: "For unnamed pipes, we could create a named FIFO using a temporary name. ... place them possibly in a special directory". I originally think it is unnecessary, however, also due to the lack of a VFS i<span style="COLOR: #ee6600; BACKGROUND-COLOR: yellow">node</span> structure, it seems to become a problem, for we have to create a jnode (in the case of IMFS) to preserve file states, and maybe the easiest way to acheive that is creating a IMFS file.</div>

<div> </div>
<div>Comments are always welcome.</div>
<div> </div>
<div>Thanks,</div>
<div>Wei Shen</div></div></div>