while (b) {
int ph;
int free_me = 0;
- int onlru = 0;
struct inode *checkpin = NULL;
struct inode *myi = NULL;
spin_lock(&lafs_hash_lock);
- if (!list_empty(&b->lru) &&
- !test_bit(B_IOLock, &b->flags) &&
- !test_bit(B_Writeback, &b->flags) &&
- !test_bit(B_OnFree, &b->flags))
- /* If B_IOLock, then it might be on the cluster
- * list, but not the LRU.
- */
- onlru = 1;
-
/* PinPending disappears with the last non-lru reference,
* (or possibly at other times).
*/
/* Don't need to be Pinned any more */
lafs_checkpoint_lock(fs);
if (test_and_clear_bit(B_Pinned, &b->flags)) {
- if (onlru) {
+ if (test_bit(B_Index, &b->flags) && !list_empty_careful(&b->lru)) {
spin_lock(&fs->lock);
list_del_init(&b->lru);
spin_unlock(&fs->lock);