Lines Matching refs:ds

73 	cinfo->ds->nwritten--;  in pnfs_generic_clear_request_commit()
101 cinfo->ds->nwritten -= ret; in pnfs_generic_scan_ds_commit_list()
102 cinfo->ds->ncommitting += ret; in pnfs_generic_scan_ds_commit_list()
122 for (i = 0; i < cinfo->ds->nbuckets && max != 0; i++) { in pnfs_generic_scan_commit_lists()
123 cnt = pnfs_generic_scan_ds_commit_list(&cinfo->ds->buckets[i], in pnfs_generic_scan_commit_lists()
143 for (i = 0, b = cinfo->ds->buckets; i < cinfo->ds->nbuckets; i++, b++) { in pnfs_generic_recover_commit_reqs()
147 cinfo->ds->nwritten -= nwritten; in pnfs_generic_recover_commit_reqs()
160 struct pnfs_ds_commit_info *fl_cinfo = cinfo->ds; in pnfs_generic_retry_commit()
175 cinfo->ds->ncommitting--; in pnfs_generic_retry_commit()
195 fl_cinfo = cinfo->ds; in pnfs_generic_alloc_ds_commits()
221 bucket = &cinfo->ds->buckets[data->ds_commit_index]; in pnfs_fetch_commit_bucket_list()
224 cinfo->ds->ncommitting--; in pnfs_fetch_commit_bucket_list()
327 print_ds(struct nfs4_pnfs_ds *ds) in print_ds() argument
329 if (ds == NULL) { in print_ds()
337 ds->ds_remotestr, in print_ds()
338 refcount_read(&ds->ds_count), ds->ds_clp, in print_ds()
339 ds->ds_clp ? ds->ds_clp->cl_exchange_flags : 0); in print_ds()
418 struct nfs4_pnfs_ds *ds; in _data_server_lookup_locked() local
420 list_for_each_entry(ds, &nfs4_data_server_cache, ds_node) in _data_server_lookup_locked()
421 if (_same_data_server_addrs_locked(&ds->ds_addrs, dsaddrs)) in _data_server_lookup_locked()
422 return ds; in _data_server_lookup_locked()
426 static void destroy_ds(struct nfs4_pnfs_ds *ds) in destroy_ds() argument
432 print_ds(ds); in destroy_ds()
434 nfs_put_client(ds->ds_clp); in destroy_ds()
436 while (!list_empty(&ds->ds_addrs)) { in destroy_ds()
437 da = list_first_entry(&ds->ds_addrs, in destroy_ds()
445 kfree(ds->ds_remotestr); in destroy_ds()
446 kfree(ds); in destroy_ds()
449 void nfs4_pnfs_ds_put(struct nfs4_pnfs_ds *ds) in nfs4_pnfs_ds_put() argument
451 if (refcount_dec_and_lock(&ds->ds_count, in nfs4_pnfs_ds_put()
453 list_del_init(&ds->ds_node); in nfs4_pnfs_ds_put()
455 destroy_ds(ds); in nfs4_pnfs_ds_put()
516 struct nfs4_pnfs_ds *tmp_ds, *ds = NULL; in nfs4_pnfs_ds_add() local
524 ds = kzalloc(sizeof(*ds), gfp_flags); in nfs4_pnfs_ds_add()
525 if (!ds) in nfs4_pnfs_ds_add()
534 INIT_LIST_HEAD(&ds->ds_addrs); in nfs4_pnfs_ds_add()
535 list_splice_init(dsaddrs, &ds->ds_addrs); in nfs4_pnfs_ds_add()
536 ds->ds_remotestr = remotestr; in nfs4_pnfs_ds_add()
537 refcount_set(&ds->ds_count, 1); in nfs4_pnfs_ds_add()
538 INIT_LIST_HEAD(&ds->ds_node); in nfs4_pnfs_ds_add()
539 ds->ds_clp = NULL; in nfs4_pnfs_ds_add()
540 list_add(&ds->ds_node, &nfs4_data_server_cache); in nfs4_pnfs_ds_add()
542 ds->ds_remotestr); in nfs4_pnfs_ds_add()
545 kfree(ds); in nfs4_pnfs_ds_add()
550 ds = tmp_ds; in nfs4_pnfs_ds_add()
554 return ds; in nfs4_pnfs_ds_add()
558 static int nfs4_wait_ds_connect(struct nfs4_pnfs_ds *ds) in nfs4_wait_ds_connect() argument
561 return wait_on_bit(&ds->ds_state, NFS4DS_CONNECTING, TASK_KILLABLE); in nfs4_wait_ds_connect()
564 static void nfs4_clear_ds_conn_bit(struct nfs4_pnfs_ds *ds) in nfs4_clear_ds_conn_bit() argument
567 clear_and_wake_up_bit(NFS4DS_CONNECTING, &ds->ds_state); in nfs4_clear_ds_conn_bit()
597 struct nfs4_pnfs_ds *ds, in _nfs4_pnfs_v3_ds_connect() argument
605 dprintk("--> %s DS %s\n", __func__, ds->ds_remotestr); in _nfs4_pnfs_v3_ds_connect()
610 list_for_each_entry(da, &ds->ds_addrs, da_node) { in _nfs4_pnfs_v3_ds_connect()
612 __func__, ds->ds_remotestr, da->da_remotestr); in _nfs4_pnfs_v3_ds_connect()
638 WRITE_ONCE(ds->ds_clp, clp); in _nfs4_pnfs_v3_ds_connect()
639 dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr); in _nfs4_pnfs_v3_ds_connect()
645 struct nfs4_pnfs_ds *ds, in _nfs4_pnfs_v4_ds_connect() argument
654 dprintk("--> %s DS %s\n", __func__, ds->ds_remotestr); in _nfs4_pnfs_v4_ds_connect()
656 list_for_each_entry(da, &ds->ds_addrs, da_node) { in _nfs4_pnfs_v4_ds_connect()
658 __func__, ds->ds_remotestr, da->da_remotestr); in _nfs4_pnfs_v4_ds_connect()
711 WRITE_ONCE(ds->ds_clp, clp); in _nfs4_pnfs_v4_ds_connect()
712 dprintk("%s [new] addr: %s\n", __func__, ds->ds_remotestr); in _nfs4_pnfs_v4_ds_connect()
722 int nfs4_pnfs_ds_connect(struct nfs_server *mds_srv, struct nfs4_pnfs_ds *ds, in nfs4_pnfs_ds_connect() argument
729 err = nfs4_wait_ds_connect(ds); in nfs4_pnfs_ds_connect()
730 if (err || ds->ds_clp) in nfs4_pnfs_ds_connect()
734 } while (test_and_set_bit(NFS4DS_CONNECTING, &ds->ds_state) != 0); in nfs4_pnfs_ds_connect()
736 if (ds->ds_clp) in nfs4_pnfs_ds_connect()
741 err = _nfs4_pnfs_v3_ds_connect(mds_srv, ds, timeo, retrans); in nfs4_pnfs_ds_connect()
744 err = _nfs4_pnfs_v4_ds_connect(mds_srv, ds, timeo, retrans, in nfs4_pnfs_ds_connect()
753 nfs4_clear_ds_conn_bit(ds); in nfs4_pnfs_ds_connect()
760 if (!ds->ds_clp || !nfs_client_init_is_complete(ds->ds_clp)) { in nfs4_pnfs_ds_connect()
761 WARN_ON_ONCE(ds->ds_clp || in nfs4_pnfs_ds_connect()
765 err = nfs_client_init_status(ds->ds_clp); in nfs4_pnfs_ds_connect()
930 buckets = cinfo->ds->buckets; in pnfs_layout_mark_request_commit()
948 cinfo->ds->nwritten++; in pnfs_layout_mark_request_commit()