adds all the directory entries in a segment to the segment freelist
| 217 | // adds all the directory entries |
| 218 | // in a segment to the segment freelist |
| 219 | void |
| 220 | dir_init_segment(int s, Stripe *stripe) |
| 221 | { |
| 222 | stripe->directory.header->freelist[s] = 0; |
| 223 | Dir *seg = stripe->directory.get_segment(s); |
| 224 | int l, b; |
| 225 | memset(static_cast<void *>(seg), 0, SIZEOF_DIR * DIR_DEPTH * stripe->directory.buckets); |
| 226 | for (l = 1; l < DIR_DEPTH; l++) { |
| 227 | for (b = 0; b < stripe->directory.buckets; b++) { |
| 228 | Dir *bucket = dir_bucket(b, seg); |
| 229 | dir_free_entry(dir_bucket_row(bucket, l), s, stripe); |
| 230 | } |
| 231 | } |
| 232 | } |
| 233 | |
| 234 | // break the infinite loop in directory entries |
| 235 | // Note : abuse of the token bit in dir entries |
no test coverage detected