descr->cld_start = osc_index(opg);
descr->cld_end = osc_index(opg);
spin_lock(&hdr->coh_lock_guard);
- cfs_list_for_each_entry(scan, &hdr->coh_locks, cll_linkage) {
+ list_for_each_entry(scan, &hdr->coh_locks, cll_linkage) {
/*
* Lock-less sub-lock has to be either in HELD state
* (when io is actively going on), or in CACHED state,
osc_lru_use(osc_cli(obj), opg);
spin_lock(&obj->oo_seatbelt);
- cfs_list_add(&opg->ops_inflight, &obj->oo_inflight[crt]);
+ list_add(&opg->ops_inflight, &obj->oo_inflight[crt]);
opg->ops_submitter = current;
spin_unlock(&obj->oo_seatbelt);
}
RETURN(result);
}
-static const char *osc_list(cfs_list_t *head)
+static const char *osc_list(struct list_head *head)
{
- return cfs_list_empty(head) ? "-" : "+";
+ return list_empty(head) ? "-" : "+";
}
static inline cfs_time_t osc_submit_duration(struct osc_page *opg)
spin_lock(&obj->oo_seatbelt);
if (opg->ops_submitter != NULL) {
- LASSERT(!cfs_list_empty(&opg->ops_inflight));
- cfs_list_del_init(&opg->ops_inflight);
+ LASSERT(!list_empty(&opg->ops_inflight));
+ list_del_init(&opg->ops_inflight);
opg->ops_submitter = NULL;
}
spin_unlock(&obj->oo_seatbelt);
#endif
/* ops_inflight and ops_lru are the same field, but it doesn't
* hurt to initialize it twice :-) */
- CFS_INIT_LIST_HEAD(&opg->ops_inflight);
- CFS_INIT_LIST_HEAD(&opg->ops_lru);
+ INIT_LIST_HEAD(&opg->ops_inflight);
+ INIT_LIST_HEAD(&opg->ops_lru);
/* reserve an LRU space for this page */
if (page->cp_type == CPT_CACHEABLE && result == 0) {
RETURN(0);
}
-void osc_lru_add_batch(struct client_obd *cli, cfs_list_t *plist)
+void osc_lru_add_batch(struct client_obd *cli, struct list_head *plist)
{
- CFS_LIST_HEAD(lru);
+ struct list_head lru = LIST_HEAD_INIT(lru);
struct osc_async_page *oap;
int npages = 0;
- cfs_list_for_each_entry(oap, plist, oap_pending_item) {
+ list_for_each_entry(oap, plist, oap_pending_item) {
struct osc_page *opg = oap2osc_page(oap);
if (!opg->ops_in_lru)
continue;
++npages;
- LASSERT(cfs_list_empty(&opg->ops_lru));
- cfs_list_add(&opg->ops_lru, &lru);
+ LASSERT(list_empty(&opg->ops_lru));
+ list_add(&opg->ops_lru, &lru);
}
if (npages > 0) {
client_obd_list_lock(&cli->cl_lru_list_lock);
- cfs_list_splice_tail(&lru, &cli->cl_lru_list);
+ list_splice_tail(&lru, &cli->cl_lru_list);
atomic_sub(npages, &cli->cl_lru_busy);
atomic_add(npages, &cli->cl_lru_in_list);
client_obd_list_unlock(&cli->cl_lru_list_lock);
static void __osc_lru_del(struct client_obd *cli, struct osc_page *opg)
{
LASSERT(atomic_read(&cli->cl_lru_in_list) > 0);
- cfs_list_del_init(&opg->ops_lru);
+ list_del_init(&opg->ops_lru);
atomic_dec(&cli->cl_lru_in_list);
}
{
if (opg->ops_in_lru) {
client_obd_list_lock(&cli->cl_lru_list_lock);
- if (!cfs_list_empty(&opg->ops_lru)) {
+ if (!list_empty(&opg->ops_lru)) {
__osc_lru_del(cli, opg);
} else {
LASSERT(atomic_read(&cli->cl_lru_busy) > 0);
(void)ptlrpcd_queue_work(cli->cl_lru_work);
wake_up(&osc_lru_waitq);
} else {
- LASSERT(cfs_list_empty(&opg->ops_lru));
+ LASSERT(list_empty(&opg->ops_lru));
}
}
{
/* If page is being transfered for the first time,
* ops_lru should be empty */
- if (opg->ops_in_lru && !cfs_list_empty(&opg->ops_lru)) {
+ if (opg->ops_in_lru && !list_empty(&opg->ops_lru)) {
client_obd_list_lock(&cli->cl_lru_list_lock);
__osc_lru_del(cli, opg);
client_obd_list_unlock(&cli->cl_lru_list_lock);
client_obd_list_lock(&cli->cl_lru_list_lock);
maxscan = min(target << 1, atomic_read(&cli->cl_lru_in_list));
- while (!cfs_list_empty(&cli->cl_lru_list)) {
+ while (!list_empty(&cli->cl_lru_list)) {
struct cl_page *page;
bool will_free = false;
if (--maxscan < 0)
break;
- opg = cfs_list_entry(cli->cl_lru_list.next, struct osc_page,
- ops_lru);
+ opg = list_entry(cli->cl_lru_list.next, struct osc_page,
+ ops_lru);
page = opg->ops_cl.cpl_page;
if (cl_page_in_use_noref(page)) {
- cfs_list_move_tail(&opg->ops_lru, &cli->cl_lru_list);
+ list_move_tail(&opg->ops_lru, &cli->cl_lru_list);
continue;
}
}
if (!will_free) {
- cfs_list_move_tail(&opg->ops_lru, &cli->cl_lru_list);
+ list_move_tail(&opg->ops_lru, &cli->cl_lru_list);
continue;
}
ENTRY;
LASSERT(cache != NULL);
- LASSERT(!cfs_list_empty(&cache->ccc_lru));
+ LASSERT(!list_empty(&cache->ccc_lru));
env = cl_env_nested_get(&nest);
if (IS_ERR(env))
* from its own. This should rarely happen. */
spin_lock(&cache->ccc_lru_lock);
cache->ccc_lru_shrinkers++;
- cfs_list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);
+ list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);
max_scans = atomic_read(&cache->ccc_users);
- while (--max_scans > 0 && !cfs_list_empty(&cache->ccc_lru)) {
- cli = cfs_list_entry(cache->ccc_lru.next, struct client_obd,
- cl_lru_osc);
+ while (--max_scans > 0 && !list_empty(&cache->ccc_lru)) {
+ cli = list_entry(cache->ccc_lru.next, struct client_obd,
+ cl_lru_osc);
CDEBUG(D_CACHE, "%s: cli %p LRU pages: %d, busy: %d.\n",
cli->cl_import->imp_obd->obd_name, cli,
atomic_read(&cli->cl_lru_in_list),
atomic_read(&cli->cl_lru_busy));
- cfs_list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);
+ list_move_tail(&cli->cl_lru_osc, &cache->ccc_lru);
if (osc_cache_too_much(cli) > 0) {
spin_unlock(&cache->ccc_lru_lock);