pub enum CommitPrecondition {
NamespaceHead {
expected_head_seq: ChangeSeq,
},
FileRevision {
inode_id: InodeId,
expected_revision_no: RevisionNo,
},
PathBinding {
path: AbsolutePath,
expected_inode_id: InodeId,
expected_binding_generation: Option<BindingGeneration>,
},
AttributesRevision {
inode_id: InodeId,
expected_attributes_revision_no: AttributeRevisionNo,
},
AccessRevision {
inode_id: InodeId,
expected_access_revision_no: AccessRevisionNo,
},
PathAbsence {
path: AbsolutePath,
},
}Expand description
Admission conditions checked against the candidate’s pre-state before its operations. The pre-state head sequence is the last admitted commit’s sequence in the batch, or the batch’s base head sequence when no earlier candidate was admitted.
Variants§
NamespaceHead
Requires the pre-state head sequence to equal expected_head_seq.
FileRevision
Requires a visible inode with the content revision the caller read.
Fields
expected_revision_no: RevisionNoContent revision observed by the caller.
PathBinding
Requires the path to retain the binding the caller read.
Fields
path: AbsolutePathAbsolute path to check, including the root.
expected_binding_generation: Option<BindingGeneration>Detects moves away and back.
AttributesRevision
Requires a visible inode with the attribute revision the caller read.
Fields
expected_attributes_revision_no: AttributeRevisionNoAttribute revision observed by the caller.
AccessRevision
Requires a visible inode with the access revision the caller read.
Fields
expected_access_revision_no: AccessRevisionNoAccess revision observed by the caller.
PathAbsence
Requires no visible entry at the full path.
Fields
path: AbsolutePathAbsolute path to check, including the root.