[vminitd]: api for trim filesystem operations#700
Conversation
012768d to
3824bae
Compare
7cd8a36 to
76c7fd9
Compare
|
Kind of messy, as the work is added to the freeze/thaw filesystem PR, but ready for initial review |
| string error = 2; // Non-empty if stat failed. | ||
| } | ||
|
|
||
| message FiTrimParams { |
There was a problem hiding this comment.
For FITRIM I don't think we want a 1:1 mapping between the ioctl parameters and the vminit API parameters. At least for now, we want to trim the entire volume that path points to:
struct fstrim_range range = {
.start = 0,
.len = ULLONG_MAX,
.minlen = 0,
};There was a problem hiding this comment.
What we want to build toward for this call is something where we define trim policies. For this PR, schedule could just contain OneShot, and we could add Recurring in a follow-up PR.
Once the one-shot operation is merged, you can implement a container clean command that runs one shot trim on the container root fs path, and the mount paths for each named volume.
Recurring would trim the named path periodically, with a duration of zero clearing a previously established schedule for the path.
Discussion topics once we get to the recurring trim policy include:
- Should the call naively trim
path, or should it infer the mount point such that callers don't inadvertently install multiple periodic trims that operate on the same mount? - Should there be a Params value that clears all previously established trim policies?
import "google/protobuf/duration.proto";
message FiTrimParams {
oneof schedule {
OneShot one_shot = 1;
Recurring recurring = 2;
}
message OneShot {}
message Recurring {
google.protobuf.Duration interval = 1;
}
}
Addition of
vminitdAPI for trim filesystem operationsCloses #1402
Depends on #685