mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-30 06:04:25 +00:00
tresor: snap garbage collection on each request
The Superblock Control module now issues a snapshot garbage collection on each incoming request. In return for that, the commit removes all calls to the garbage collection from other modules. Ref #4971
This commit is contained in:
parent
3eb5302ab0
commit
b44ffc9361
@ -136,6 +136,8 @@ void Superblock_control::_execute_read_vba(Channel &channel,
|
|||||||
{
|
{
|
||||||
switch (channel._state) {
|
switch (channel._state) {
|
||||||
case Channel::State::SUBMITTED:
|
case Channel::State::SUBMITTED:
|
||||||
|
|
||||||
|
_sb.snapshots.discard_disposable_snapshots(_sb.last_secured_generation, _curr_gen);
|
||||||
switch (sb.state) {
|
switch (sb.state) {
|
||||||
case Superblock::REKEYING: {
|
case Superblock::REKEYING: {
|
||||||
Virtual_block_address const vba = channel._request._vba;
|
Virtual_block_address const vba = channel._request._vba;
|
||||||
@ -207,6 +209,8 @@ void Superblock_control::_execute_write_vba(Channel &channel,
|
|||||||
{
|
{
|
||||||
switch (channel._state) {
|
switch (channel._state) {
|
||||||
case Channel::State::SUBMITTED:
|
case Channel::State::SUBMITTED:
|
||||||
|
|
||||||
|
sb.snapshots.discard_disposable_snapshots(sb.last_secured_generation, curr_gen);
|
||||||
switch (sb.state) {
|
switch (sb.state) {
|
||||||
case Superblock::REKEYING: {
|
case Superblock::REKEYING: {
|
||||||
Virtual_block_address const vba = channel._request._vba;
|
Virtual_block_address const vba = channel._request._vba;
|
||||||
@ -354,6 +358,7 @@ void Superblock_control::_execute_tree_ext_step(Channel &chan,
|
|||||||
switch (chan._state) {
|
switch (chan._state) {
|
||||||
case Channel::SUBMITTED:
|
case Channel::SUBMITTED:
|
||||||
{
|
{
|
||||||
|
_sb.snapshots.discard_disposable_snapshots(_sb.last_secured_generation, _curr_gen);
|
||||||
Physical_block_address const last_used_pba { _sb.first_pba + (_sb.nr_of_pbas - 1) };
|
Physical_block_address const last_used_pba { _sb.first_pba + (_sb.nr_of_pbas - 1) };
|
||||||
Number_of_blocks const nr_of_unused_pbas { MAX_PBA - last_used_pba };
|
Number_of_blocks const nr_of_unused_pbas { MAX_PBA - last_used_pba };
|
||||||
|
|
||||||
@ -481,6 +486,7 @@ void Superblock_control::_execute_rekey_vba(Channel &chan,
|
|||||||
switch (chan._state) {
|
switch (chan._state) {
|
||||||
case Channel::SUBMITTED:
|
case Channel::SUBMITTED:
|
||||||
|
|
||||||
|
_sb.snapshots.discard_disposable_snapshots(_sb.last_secured_generation, _curr_gen);
|
||||||
if (_sb.state != Superblock::REKEYING) {
|
if (_sb.state != Superblock::REKEYING) {
|
||||||
_mark_req_failed(chan, progress, "check superblock state");
|
_mark_req_failed(chan, progress, "check superblock state");
|
||||||
break;
|
break;
|
||||||
@ -739,6 +745,7 @@ Superblock_control::_execute_initialize_rekeying(Channel &chan,
|
|||||||
switch (chan._state) {
|
switch (chan._state) {
|
||||||
case Channel::SUBMITTED:
|
case Channel::SUBMITTED:
|
||||||
|
|
||||||
|
_sb.snapshots.discard_disposable_snapshots(_sb.last_secured_generation, _curr_gen);
|
||||||
chan._generated_prim = {
|
chan._generated_prim = {
|
||||||
.op = Generated_prim::READ,
|
.op = Generated_prim::READ,
|
||||||
.succ = false,
|
.succ = false,
|
||||||
@ -992,6 +999,7 @@ void Superblock_control::_execute_initialize(Channel &channel,
|
|||||||
switch (channel._state) {
|
switch (channel._state) {
|
||||||
case Channel::State::SUBMITTED:
|
case Channel::State::SUBMITTED:
|
||||||
|
|
||||||
|
_sb.snapshots.discard_disposable_snapshots(_sb.last_secured_generation, _curr_gen);
|
||||||
channel._sb_found = false;
|
channel._sb_found = false;
|
||||||
channel._generated_prim = {
|
channel._generated_prim = {
|
||||||
.op = Channel::Generated_prim::Type::READ,
|
.op = Channel::Generated_prim::Type::READ,
|
||||||
|
@ -895,9 +895,6 @@ void Virtual_block_device::_execute_rekey_vba(Channel &chan,
|
|||||||
switch (chan._state) {
|
switch (chan._state) {
|
||||||
case Channel::State::SUBMITTED:
|
case Channel::State::SUBMITTED:
|
||||||
{
|
{
|
||||||
req._snapshots.discard_disposable_snapshots(
|
|
||||||
req._curr_gen, req._last_secured_generation);
|
|
||||||
|
|
||||||
Snapshot_index first_snap_idx { 0 };
|
Snapshot_index first_snap_idx { 0 };
|
||||||
bool first_snap_idx_found { false };
|
bool first_snap_idx_found { false };
|
||||||
for (Snapshot_index snap_idx { 0 };
|
for (Snapshot_index snap_idx { 0 };
|
||||||
@ -1558,9 +1555,6 @@ void Virtual_block_device::_execute_vbd_extension_step(Channel &chan,
|
|||||||
switch (chan._state) {
|
switch (chan._state) {
|
||||||
case Channel::State::SUBMITTED:
|
case Channel::State::SUBMITTED:
|
||||||
{
|
{
|
||||||
req._snapshots.discard_disposable_snapshots(
|
|
||||||
req._curr_gen, req._last_secured_generation);
|
|
||||||
|
|
||||||
req._nr_of_leaves = 0;
|
req._nr_of_leaves = 0;
|
||||||
chan._snapshot_idx = req._snapshots.newest_snapshot_idx();
|
chan._snapshot_idx = req._snapshots.newest_snapshot_idx();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user