fs ops was Re: change log for rtems (2010-06-22)

Joel Sherrill joel.sherrill at OARcorp.com
Thu Jun 24 11:58:55 UTC 2010


On 06/24/2010 01:53 AM, Ralf Corsepius wrote:
> On 06/24/2010 08:28 AM, Chris Johns wrote:
>    
>> On 24/06/10 12:09 PM, Joel Sherrill wrote:
>>      
>>> On 06/23/2010 05:57 PM, Chris Johns wrote:
>>>        
>>>> On 24/06/10 1:05 AM, Sebastian Huber wrote:
>>>>          
>>>>> On 06/23/2010 04:57 PM, Joel Sherrill wrote:
>>>>>            
>>>>>> On 06/23/2010 07:23 AM, Sebastian Huber wrote:
>>>>>>              
>>> #define rtems_filesystem_default_read \
>>> (rtems_filesystem_read_t) rtems_filesystem_operations_stub
>>> #define rtems_filesystem_default_write \
>>> (rtems_filesystem_write_t) rtems_filesystem_operations_stub
>>>        
>>      
> I am opposed to using this paradigm. As Chris's reply implied, it means
> lying to the compiler.
> IMO, it will lead to unsafe and silently broken code.
>
>    
OK.  Our first approach was actually to add individual
stubs for each method with the appropriate type.  I just
wanted to mention this approach since it is clearly
lighter on code space.  I honestly didn't think you
all would like it. :)

The stubs will be in a directory by themselves under
libfs/src.

To summarize some thoughts..

+ Some stubs should return "not supported".  This will
   make the system calls return without special checks.
+ Others should do nothing and return OK.  If these
   can replace operations in existing filesystems,
   then do it.
+ Both of the above will allow conditional checks in
   system calls to be eliminated.

The following needs to be documented.

+ Some entries must exist and be functional if the
filesystem is functional:
   + mount and unmount
   + open and close?  (can't return ENOTSUP at least)
   + some of the evals
+ A set is required for readable file systems
+ A set is required for writeable file systems
+ Some are completely optional

An implementation thought...

+ We will add a routine that checks the fields in the filesystem
   handler structure and returns false if any are NULL.  This will
   replace the code checking for just mount/unmount.

+ Can this check above be marked as RTEMS_DEBUG?  This isn't something
   that should catch anyone at run-time in a "real system".

--joel



More information about the vc mailing list