[Bug 1521] New: Change mount to be like the Linux mount.

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Wed May 19 08:00:24 UTC 2010


https://www.rtems.org/bugzilla/show_bug.cgi?id=1521

           Summary: Change mount to be like the Linux mount.
           Product: RTEMS
           Version: 4.10
          Platform: All
        OS/Version: RTEMS
            Status: NEW
          Severity: normal
          Priority: P3
         Component: filesystem
        AssignedTo: chrisj at rtems.org
        ReportedBy: chrisj at rtems.org


The mount function is not covered by any standard and varies between different
operating systems. This PR is to discuss changing the current mount command to
the Linux one. This was raised in PR 1517. The new mount command is:

int mount(const char    *source, 
          const char    *target,
          const char    *filesystemtype,
          unsigned long mountflags,
          const void    *data);

This interface does not return the mount table entry. This was only ever used
in the base file system initialisation to set the root file system and that
code can be moved to the mount function. If the mount point or target is NULL
the mount table chain must be empty and therefore rtems_filesystem_root can be
set.

The source can be a device path, an NFS mount path or what-ever. The target is
an existing directory that can be used as a mount point.

This interface adds a data pointer that can contain file system specific
configuration information. This allows a better user way to allow specific file
system configuration on a per file system instance basis.

The filesystemtype is a string label for the file system. Implementing this
requires a table of present file system be created. In RTEMS this is normally a
static table and a run-time list. The static table is implemented using
confdefs.h. A user requests the file systems they wish to have in the target
just like they set the number of semaphores or message queues. The benefit is
the removal of ops table handlers being global and being passed around the
code.

Implementing this change raises some issues. There is a number of "mount me"
type helper functions. These are very close to each other. They all create the
mount point and the NFS helper does some extra processing. I wish to remove all
these helpers and to have initialisation become part of the normal file system
initialisation. This reduces the exported interface of a file system to the
single initialise call. I how-ever suspect this will break some applications
that rely on the helpers to create the mount points. If this is an issue a user
who is effected can provide a generic helper function for libmisc. The benefit
is to remove the common code from RTEMS, to limit the file system interface,
and to remove the need for special initialisations in-order to use a file
system.

The specific initialisations seem to be mostly in the networked file systems.
For example rpcInitialize and nfsInit need to be called before mounting an NFS
file system. These interfaces can stay so specific non-default initialisation
can occur but they can also be called the NFSFS initialise.

NFS also has the host processing split between the helper function and the
initialise function. The helper function performs a non-thread safe
host-by-name look-up. I suggest we move this code into the initialise. It does
make mounting not thread safe while the host look up call is not thread safe,
how-ever it was never safe when in the helper function. The network call is not
not safe and should be fixed.

Comments ?

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list