[haiku-commits] Re: haiku: hrev44355 - in src: system/kernel/cache tools/fs_shell

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 19 Jul 2012 17:51:38 -0400

> -       if (block->transaction == NULL && block->ref_count == 0) {
> +       if (block->transaction == NULL && block->ref_count == 0 && 
> !block->unused) {
>                 // the block is no longer used
>                 block->unused = true;

I'm not sure what this code does, but it seems that the code does not
match the comment.

!block->unused => not unused => used, the comment says the block is not used.

after that you set block->unused = true. Isn't it already guaranteed
to be true based on the fact that you entered that if statement?

Sorry if I'm misunderstanding something.

Other related posts: