|
52 | 52 | Read_State : State := (others => -1);
|
53 | 53 |
|
54 | 54 | function State_Finished (S : State) return Boolean is
|
55 |
| - (S.Sent = Request_Count and S.Acked = Request_Count); |
| 55 | + (S.Acked >= Request_Count); |
56 | 56 |
|
57 | 57 | procedure Single (S : in out State;
|
58 | 58 | Operation : Block.Request_Kind) with
|
59 | 59 | Pre => Block_Client.Initialized (Client)
|
60 |
| - and Componolit.Interfaces.Log.Client.Initialized (Log) |
61 |
| - and Operation in Block.Read .. Block.Write, |
| 60 | + and then Componolit.Interfaces.Log.Client.Initialized (Log) |
| 61 | + and then Operation in Block.Read .. Block.Write, |
62 | 62 | Post => Block_Client.Initialized (Client)
|
63 |
| - and Componolit.Interfaces.Log.Client.Initialized (Log); |
| 63 | + and then Componolit.Interfaces.Log.Client.Initialized (Log); |
64 | 64 |
|
65 | 65 | procedure Write (C : Block.Client_Instance;
|
66 | 66 | R : Request_Id;
|
|
75 | 75 | procedure Single (S : in out State;
|
76 | 76 | Operation : Block.Request_Kind)
|
77 | 77 | is
|
| 78 | + use type Block_Client.Result; |
78 | 79 | Block_Size : constant Block.Size := Block_Client.Block_Size (Client);
|
79 | 80 | Result : Block_Client.Result;
|
80 | 81 | begin
|
81 |
| - if |
82 |
| - Block_Size <= 4096 and Block_Size >= 256 |
83 |
| - then |
| 82 | + if Block_Size <= 4096 and Block_Size >= 256 then |
84 | 83 | for I in Request_Cache'Range loop
|
85 | 84 |
|
86 |
| - if Block_Client.Status (Request_Cache (I)) = Block.Pending then |
| 85 | + if |
| 86 | + S.Acked < Request_Count |
| 87 | + and then Block_Client.Status (Request_Cache (I)) = Block.Pending |
| 88 | + then |
87 | 89 | Block_Client.Update_Request (Client, Request_Cache (I));
|
88 | 90 | if Block_Client.Status (Request_Cache (I)) = Block.Ok then
|
89 | 91 | case Block_Client.Kind (Request_Cache (I)) is
|
|
128 | 130 | Main.Vacate (P_Cap, Main.Failure);
|
129 | 131 | end case;
|
130 | 132 | end if;
|
| 133 | + |
| 134 | + pragma Loop_Invariant (Block_Client.Initialized (Client)); |
| 135 | + pragma Loop_Invariant (Componolit.Interfaces.Log.Client.Initialized (Log)); |
131 | 136 | end loop;
|
132 | 137 | Block_Client.Submit (Client);
|
133 | 138 | else
|
|
0 commit comments