Skip to content

Refactor out NFS-related code from save_restore.c #74

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

Merged
merged 6 commits into from
May 21, 2025

Conversation

simon-ess
Copy link
Contributor

This pull request is a first attempt at cleaning up some of the code in save_restore.c. It seems much more logical that save_restore is aware of reading and writing files, not specifically how and when to mount or unmount an NFS share.

Note that this PR does contain a breaking change: previously it was possible to have the following two lines in any order in a startup script:

set_savefile_path foo bar
save_restoreSet_NFSHost hostname port

The way this behaved was that if you set the savefile path first, it stored it in memory and then would mount the host:port combination at that specified mountpoint (foo/bar in this case), as no mount point was specified.

If you reversed the order:

save_restoreSet_NFSHost hostname port
set_savefile_path foo bar

then running set_savefile_path would actually mount host:port at the mountpoint foo/bar. This resulted in (IMO) needlessly complicated and confusing code, which is much simplified by enforcing that a mountpoint is specified before attempting to mount; after this change this can be done either by running set_savefile_path first, or by specifying the mount point as the third argument to save_restoreSet_NFSHost.

simon-ess added 6 commits May 13, 2025 09:17
Previously, it was perfectly acceptible to specify the savefile path
before or after specifying the NFS mount, both in the case that the
savefile path _was_ the NFS mount and in the case that it was within
that mount.

This added a lot of confusing logic. Instead, this is a breaking change
that forces that you specify the savefile path before the nfs host if you
want to use the savefile path as the mount point; that is, you must do
```
set_savefile_path foo bar
save_restoreSet_NFSHost hostname port
```
If the mountpoint is specified separately, then the order of the two
commands does not matter.

Moreover, set_savefile_path no longer mounts or unmounts the NFS.
@simon-ess simon-ess changed the title Refactor our NFS-related code from save_restore.c Refactor out NFS-related code from save_restore.c May 15, 2025
@keenanlang keenanlang merged commit 09d62bc into epics-modules:master May 21, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants