Commit 6533d56
PrivHelper: introduce functions for [de]serializing optional values
Summary:
# This diff
some NFS mount options are optional, and therefore we may need to essentially pass "std::nullopt" across the wire. Since std::optional<T> are not writeable (it is not an arithmetic type), we'll have to invent our own method for serializing/deserializing those values.
in this diff, I introduce [de]serializeOptional() functions which will:
1) serialize a bool to indicate whether the optional value is present or not.
2) If the value is present, then we continue to [de]serialize the value
3) If the value is std::nullopt, then we can skip #2 because there's no value to [de]serialize
# Context
NFS mounts are extremely configurable, especially on macOS. The configurations vary a ton and impact mount perf/reliability in many different ways. Instead of passing around all these mount options as a list of parameters, I decided to clean up the code and pass them around in a struct. That will keep the nfsMount() signature from growing out of hand, and overall make the code cleaner. This clean up is motivated by a desire to add even more NFS Mount Option configurations in the future (which is done later in this stack).
Reviewed By: jdelliot
Differential Revision: D68602730
fbshipit-source-id: 0e157bac918af0df07e3f0a250c68278bcc412bf1 parent 7404306 commit 6533d56
1 file changed
+27
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
71 | 98 | | |
72 | 99 | | |
73 | 100 | | |
| |||
0 commit comments