*/
hlist_del_init(&top->loh_hash);
list_del_init(&top->loh_lru);
+ -- site->ls_total;
kill_it = 1;
}
}
NULL, s->ls_top_dev);
if (IS_ERR(top))
RETURN(top);
- s->ls_total ++;
/*
* This is the only place where object fid is assigned. It's constant
* after this point.
if (scan->lo_ops->loo_object_delete != NULL)
scan->lo_ops->loo_object_delete(env, scan);
}
- -- o->lo_dev->ld_site->ls_total;
+
/*
* Then, splice object layers into stand-alone list, and call
* ->loo_object_free() on all layers to free memory. Splice is
continue;
hlist_del_init(&h->loh_hash);
list_move(&h->loh_lru, &dispose);
+ s->ls_total --;
}
spin_unlock(&s->ls_guard);
/*
hlist_add_head(&o->lo_header->loh_hash, bucket);
list_add_tail(&o->lo_header->loh_lru, &s->ls_lru);
++ s->ls_busy;
+ ++ s->ls_total;
shadow = o;
o = NULL;
} else
*/
list_move_tail(&s->ls_linkage, &splice);
}
+ spin_lock(&s->ls_guard);
cached += s->ls_total - s->ls_busy;
+ spin_unlock(&s->ls_guard);
if (remain <= 0)
break;
}
list_splice(&splice, lu_sites.prev);
up(&lu_sites_guard);
- return max(cached, 0); /* max() to avoid spurious underflow due to
- * lock-less access */
+ return cached;
}
static struct shrinker *lu_site_shrinker = NULL;