sbin/hammer: Properly break from cache flush loop
authorTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 14 Mar 2015 18:55:48 +0000 (03:55 +0900)
committerTomohiro Kusumi <kusumi.tomohiro@gmail.com>
Sat, 14 Mar 2015 19:33:40 +0000 (04:33 +0900)
commitd75d1dc9e556527b1784e6addb219fd9f4ff5168
tree0cf4a64658160a377052aaccdc7682c41743be99
parentc2f57ae23f00d1702a74f48c3f96a33c8c55aa51
sbin/hammer: Properly break from cache flush loop

- hammer_cache_flush() needs to keep track of the first element
  that was pushed back to tail of the list (ref!=0), and break from
  the loop if it hits that element for the second time.

- It's currently working without above check because it breaks from
  the loop after it has accomplished 'target'. If this function was
  changed to release unlimited number of cache then it'll loop
  forever unless tracking those that can't be released (ref!=0).
sbin/hammer/cache.c