File tree 2 files changed +8
-11
lines changed
2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -119,10 +119,6 @@ fn getattr_helper(
119
119
ino : attr. inode as u64 ,
120
120
size : attr. size ,
121
121
blocks : ( attr. size + 511 ) / 512 ,
122
- // TODO these times should reflect those in the model, will need to
123
- // be translated from the tick to systemtime. Implies we'll need to
124
- // adjust up from start_time, knowing that a tick is one second
125
- // wide.
126
122
atime,
127
123
mtime,
128
124
ctime,
@@ -233,6 +229,9 @@ impl Filesystem for LogrotateFS {
233
229
// TODO building up a vec of entries here to handle offset really does
234
230
// suggest that the model needs to be exposed in such a way that this
235
231
// needn't be done.
232
+ //
233
+ // Ah, actually, the right buffer to push into is reply.add. There's no
234
+ // need for `entries` at all.
236
235
let mut entries = Vec :: new ( ) ;
237
236
238
237
// '.' and '..'
@@ -248,7 +247,7 @@ impl Filesystem for LogrotateFS {
248
247
) ) ;
249
248
}
250
249
251
- // reaming children
250
+ // remaining children
252
251
if let Some ( child_inodes) = state. readdir ( ino as usize ) {
253
252
for child_ino in child_inodes {
254
253
let file_type = state
Original file line number Diff line number Diff line change 1
1
//! Model the internal logic of a logrotate filesystem.
2
2
3
- //use lading_payload::block;
4
-
5
3
use std:: collections:: { HashMap , HashSet } ;
6
4
7
5
use bytes:: Bytes ;
@@ -60,7 +58,7 @@ pub struct File {
60
58
61
59
/// The group ID of this File. So for instance all File instances that are
62
60
/// called foo.log, foo.log.1 etc have the same group ID.
63
- group_id : u8 ,
61
+ group_id : u16 ,
64
62
}
65
63
66
64
impl File {
@@ -284,7 +282,7 @@ impl State {
284
282
let mut names = Vec :: new ( ) ;
285
283
names. push ( base_name. clone ( ) ) ; // Ordinal 0
286
284
for i in 1 ..=max_rotations {
287
- names. push ( format ! ( "{}.{}" , base_name , i ) ) ; // Ordinal i
285
+ names. push ( format ! ( "{base_name }.{i}" ) ) ; // Ordinal i
288
286
}
289
287
state. group_names . push ( names) ;
290
288
}
@@ -349,7 +347,7 @@ impl State {
349
347
new_inode
350
348
}
351
349
} else {
352
- panic ! ( "current_inode {} is not a directory" , current_inode ) ;
350
+ panic ! ( "current_inode {current_inode } is not a directory" ) ;
353
351
}
354
352
} ;
355
353
@@ -372,7 +370,7 @@ impl State {
372
370
read_only : false ,
373
371
ordinal : 0 ,
374
372
peer : None ,
375
- group_id : group_id as u8 ,
373
+ group_id,
376
374
} ;
377
375
state. nodes . insert ( file_inode, Node :: File { file } ) ;
378
376
You can’t perform that action at this time.
0 commit comments