| 281 | } |
| 282 | |
| 283 | int |
| 284 | check_dir(Stripe *stripe) |
| 285 | { |
| 286 | int i, s; |
| 287 | Dbg(dbg_ctl_cache_check_dir, "inside check dir"); |
| 288 | for (s = 0; s < stripe->directory.segments; s++) { |
| 289 | Dir *seg = stripe->directory.get_segment(s); |
| 290 | for (i = 0; i < stripe->directory.buckets; i++) { |
| 291 | Dir *b = dir_bucket(i, seg); |
| 292 | if (!(dir_bucket_length(b, s, stripe) >= 0)) { |
| 293 | return 0; |
| 294 | } |
| 295 | if (!(!dir_next(b) || dir_offset(b))) { |
| 296 | return 0; |
| 297 | } |
| 298 | if (!(dir_bucket_loop_check(b, seg))) { |
| 299 | return 0; |
| 300 | } |
| 301 | } |
| 302 | } |
| 303 | return 1; |
| 304 | } |
| 305 | |
| 306 | inline void |
| 307 | unlink_from_freelist(Dir *e, int s, Stripe *stripe) |