Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 different ways of identifying file systems #719

Open
jphickey opened this issue Dec 29, 2020 · 0 comments
Open

4 different ways of identifying file systems #719

jphickey opened this issue Dec 29, 2020 · 0 comments

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Unlike other OSAL resources, the File System related calls (OS_mount/unmount/mkfs/rmfs/initfs etc) identify the target by string rather than as a numeric ID.

Aside from being inconsistent, this is also ambiguous and confusing because the are actually 4 different possible strings use here:

  1. Device name (e.g. "/ramdev0")
  2. Volume name (e.g. "RAM")
  3. System Mount point (e.g. "/dev/shm/osal:RAM")
  4. Virtual Mount point (e.g. "/ram")

Furthermore not all functions use the same name. When implementing OS_FileSysStatVolume I noticed that the old OS_fs(Bytes|Blocks)Free() and OS_chkfs use virtual mount point (4), while the others use device name (1). The OS_FS_GetPhysDriveName() actually returns the system mount point (3) not the actual device (1) that other calls require.

Describe the solution you'd like
Ideally, change these APIs to work with IDs rather than names because IDs are not ambiguous. One can also find/lookup an ID based on any of the names (lookup functions don't all currently exist but easy to add).

Describe alternatives you've considered
If API changes are not possible at this stage, then then we should at least be consistent and choose one name to use. Probably the device name (1) should be the one, as it seems the one used by most calls currently.

Additional context
The fact that OS_chkfs() uses a virtual mount point should probably be considered a bug, as it implies the file system is already mounted at the time the call is done. Most OS's do not permit a file system check of a mounted device.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

jphickey added a commit to jphickey/osal that referenced this issue Aug 10, 2022
Replace all direct references to data types defined in ccsds.h
with the abstract type defined in cfe_sb.h
jphickey pushed a commit to jphickey/osal that referenced this issue Aug 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant