File tree 1 file changed +9
-3
lines changed
lading/src/generator/file_gen
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ impl File {
95
95
/// TODO these need to modify access time et al
96
96
pub fn open ( & mut self , now : Tick ) {
97
97
self . advance_time ( now) ;
98
+ if now > self . access_tick {
99
+ self . access_tick = now;
100
+ self . status_tick = now;
101
+ }
98
102
99
103
self . open_handles += 1 ;
100
104
}
@@ -109,7 +113,7 @@ impl File {
109
113
self . advance_time ( now) ;
110
114
111
115
assert ! (
112
- self . open_handles == 0 ,
116
+ self . open_handles > 0 ,
113
117
"Attempted to close a file with no open handles"
114
118
) ;
115
119
self . open_handles -= 1 ;
@@ -146,10 +150,12 @@ impl File {
146
150
/// will be advanced, meaning `modified_tick` may update.
147
151
pub fn read ( & mut self , request : u64 , now : Tick ) {
148
152
self . advance_time ( now) ;
153
+ if now > self . access_tick {
154
+ self . access_tick = now;
155
+ self . status_tick = now;
156
+ }
149
157
150
158
self . bytes_read = self . bytes_read . saturating_add ( request) ;
151
- self . access_tick = now;
152
- self . status_tick = now;
153
159
}
154
160
155
161
/// Run the clock forward in the `File`.
You can’t perform that action at this time.
0 commit comments