Lines Matching +full:2 +full:- +full:cell
1 // SPDX-License-Identifier: GPL-2.0-or-later
37 struct afs_cell *cell; in afs_proc_cells_show() local
45 cell = list_entry(v, struct afs_cell, proc_link); in afs_proc_cells_show()
46 vllist = rcu_dereference(cell->vl_servers); in afs_proc_cells_show()
48 /* display one cell per line on subsequent lines */ in afs_proc_cells_show()
49 seq_printf(m, "%3u %3u %6lld %2u %2u %s\n", in afs_proc_cells_show()
50 refcount_read(&cell->ref), in afs_proc_cells_show()
51 atomic_read(&cell->active), in afs_proc_cells_show()
52 cell->dns_expiry - ktime_get_real_seconds(), in afs_proc_cells_show()
53 vllist ? vllist->nr_servers : 0, in afs_proc_cells_show()
54 cell->state, in afs_proc_cells_show()
55 cell->name); in afs_proc_cells_show()
63 return seq_hlist_start_head_rcu(&afs_seq2net(m)->proc_cells, *_pos); in afs_proc_cells_start()
68 return seq_hlist_next_rcu(v, &afs_seq2net(m)->proc_cells, pos); in afs_proc_cells_next()
86 * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
90 struct seq_file *m = file->private_data; in afs_proc_cells_write()
123 struct afs_cell *cell; in afs_proc_cells_write() local
125 cell = afs_lookup_cell(net, name, strlen(name), args, true); in afs_proc_cells_write()
126 if (IS_ERR(cell)) { in afs_proc_cells_write()
127 ret = PTR_ERR(cell); in afs_proc_cells_write()
131 if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags)) in afs_proc_cells_write()
132 afs_unuse_cell(net, cell, afs_cell_trace_unuse_no_pin); in afs_proc_cells_write()
144 ret = -EINVAL; in afs_proc_cells_write()
150 * Display the name of the current workstation cell.
154 struct afs_cell *cell; in afs_proc_rootcell_show() local
158 down_read(&net->cells_lock); in afs_proc_rootcell_show()
159 cell = net->ws_cell; in afs_proc_rootcell_show()
160 if (cell) in afs_proc_rootcell_show()
161 seq_printf(m, "%s\n", cell->name); in afs_proc_rootcell_show()
162 up_read(&net->cells_lock); in afs_proc_rootcell_show()
167 * Set the current workstation cell and optionally supply its list of volume
170 * echo "cell.name:192.168.231.14" >/proc/fs/afs/rootcell
174 struct seq_file *m = file->private_data; in afs_proc_rootcell_write()
179 ret = -EINVAL; in afs_proc_rootcell_write()
207 * Display the list of volumes known to a cell.
220 refcount_read(&vol->ref), vol->vid, in afs_proc_cell_volumes_show()
221 afs_vol_types[vol->type], in afs_proc_cell_volumes_show()
222 vol->name); in afs_proc_cell_volumes_show()
228 __acquires(cell->proc_lock) in afs_proc_cell_volumes_start()
230 struct afs_cell *cell = pde_data(file_inode(m->file)); in afs_proc_cell_volumes_start() local
233 return seq_hlist_start_head_rcu(&cell->proc_volumes, *_pos); in afs_proc_cell_volumes_start()
239 struct afs_cell *cell = pde_data(file_inode(m->file)); in afs_proc_cell_volumes_next() local
241 return seq_hlist_next_rcu(v, &cell->proc_volumes, _pos); in afs_proc_cell_volumes_next()
245 __releases(cell->proc_lock) in afs_proc_cell_volumes_stop()
268 [DNS_LOOKUP_NOT_DONE] = "no-lookup",
272 [DNS_LOOKUP_GOT_NOT_FOUND] = "not-found",
273 [DNS_LOOKUP_GOT_LOCAL_FAILURE] = "local-failure",
274 [DNS_LOOKUP_GOT_TEMP_FAILURE] = "temp-failure",
275 [DNS_LOOKUP_GOT_NS_FAILURE] = "ns-failure",
280 * Display the list of Volume Location servers we're using for a cell.
284 const struct afs_vl_seq_net_private *priv = m->private; in afs_proc_cell_vlservers_show()
285 const struct afs_vlserver_list *vllist = priv->vllist; in afs_proc_cell_vlservers_show()
293 dns_record_sources[vllist ? vllist->source : 0], in afs_proc_cell_vlservers_show()
294 dns_lookup_statuses[vllist ? vllist->status : 0]); in afs_proc_cell_vlservers_show()
299 vlserver = entry->server; in afs_proc_cell_vlservers_show()
300 alist = rcu_dereference(vlserver->addresses); in afs_proc_cell_vlservers_show()
303 vlserver->name, entry->priority, entry->weight, in afs_proc_cell_vlservers_show()
304 dns_record_sources[alist ? alist->source : entry->source], in afs_proc_cell_vlservers_show()
305 dns_lookup_statuses[alist ? alist->status : entry->status]); in afs_proc_cell_vlservers_show()
307 for (i = 0; i < alist->nr_addrs; i++) in afs_proc_cell_vlservers_show()
309 alist->preferred == i ? '>' : '-', in afs_proc_cell_vlservers_show()
310 &alist->addrs[i].transport); in afs_proc_cell_vlservers_show()
312 seq_printf(m, " info: fl=%lx rtt=%d\n", vlserver->flags, vlserver->rtt); in afs_proc_cell_vlservers_show()
314 vlserver->probe.flags, vlserver->probe.error, in afs_proc_cell_vlservers_show()
315 vlserver->probe.abort_code, in afs_proc_cell_vlservers_show()
316 atomic_read(&vlserver->probe_outstanding)); in afs_proc_cell_vlservers_show()
323 struct afs_vl_seq_net_private *priv = m->private; in afs_proc_cell_vlservers_start()
325 struct afs_cell *cell = pde_data(file_inode(m->file)); in afs_proc_cell_vlservers_start() local
330 vllist = rcu_dereference(cell->vl_servers); in afs_proc_cell_vlservers_start()
331 priv->vllist = vllist; in afs_proc_cell_vlservers_start()
338 if (pos - 1 >= vllist->nr_servers) in afs_proc_cell_vlservers_start()
341 return &vllist->servers[pos - 1]; in afs_proc_cell_vlservers_start()
347 struct afs_vl_seq_net_private *priv = m->private; in afs_proc_cell_vlservers_next()
348 struct afs_vlserver_list *vllist = priv->vllist; in afs_proc_cell_vlservers_next()
354 if (!vllist || pos - 1 >= vllist->nr_servers) in afs_proc_cell_vlservers_next()
357 return &vllist->servers[pos - 1]; in afs_proc_cell_vlservers_next()
388 alist = rcu_dereference(server->addresses); in afs_proc_servers_show()
390 &server->uuid, in afs_proc_servers_show()
391 refcount_read(&server->ref), in afs_proc_servers_show()
392 atomic_read(&server->active)); in afs_proc_servers_show()
393 seq_printf(m, " - info: fl=%lx rtt=%u brk=%x\n", in afs_proc_servers_show()
394 server->flags, server->rtt, server->cb_s_break); in afs_proc_servers_show()
395 seq_printf(m, " - probe: last=%d out=%d\n", in afs_proc_servers_show()
396 (int)(jiffies - server->probed_at) / HZ, in afs_proc_servers_show()
397 atomic_read(&server->probe_outstanding)); in afs_proc_servers_show()
398 seq_printf(m, " - ALIST v=%u rsp=%lx f=%lx\n", in afs_proc_servers_show()
399 alist->version, alist->responded, alist->failed); in afs_proc_servers_show()
400 for (i = 0; i < alist->nr_addrs; i++) in afs_proc_servers_show()
402 i, &alist->addrs[i].transport, in afs_proc_servers_show()
403 alist->preferred == i ? "*" : ""); in afs_proc_servers_show()
411 return seq_hlist_start_head_rcu(&afs_seq2net(m)->fs_proc, *_pos); in afs_proc_servers_start()
416 return seq_hlist_next_rcu(v, &afs_seq2net(m)->fs_proc, _pos); in afs_proc_servers_next()
439 struct afs_sysnames *sysnames = net->sysnames; in afs_proc_sysname_show()
440 unsigned int i = (unsigned long)v - 1; in afs_proc_sysname_show()
442 if (i < sysnames->nr) in afs_proc_sysname_show()
443 seq_printf(m, "%s\n", sysnames->subs[i]); in afs_proc_sysname_show()
448 __acquires(&net->sysnames_lock) in afs_proc_sysname_start()
453 read_lock(&net->sysnames_lock); in afs_proc_sysname_start()
455 names = net->sysnames; in afs_proc_sysname_start()
456 if (*pos >= names->nr) in afs_proc_sysname_start()
464 struct afs_sysnames *names = net->sysnames; in afs_proc_sysname_next()
467 if (*pos >= names->nr) in afs_proc_sysname_next()
473 __releases(&net->sysnames_lock) in afs_proc_sysname_stop()
477 read_unlock(&net->sysnames_lock); in afs_proc_sysname_stop()
493 struct seq_file *m = file->private_data; in afs_proc_sysname_write()
500 return -ENOMEM; in afs_proc_sysname_write()
501 refcount_set(&sysnames->usage, 1); in afs_proc_sysname_write()
509 ret = -ENAMETOOLONG; in afs_proc_sysname_write()
514 s[len - 4] == '@' && in afs_proc_sysname_write()
515 s[len - 3] == 's' && in afs_proc_sysname_write()
516 s[len - 2] == 'y' && in afs_proc_sysname_write()
517 s[len - 1] == 's') in afs_proc_sysname_write()
522 (len < 2 || (len == 2 && s[1] == '.'))) in afs_proc_sysname_write()
528 ret = -EFBIG; in afs_proc_sysname_write()
529 if (sysnames->nr >= AFS_NR_SYSNAME) in afs_proc_sysname_write()
535 ret = -ENOMEM; in afs_proc_sysname_write()
541 sysnames->subs[sysnames->nr] = sub; in afs_proc_sysname_write()
542 sysnames->nr++; in afs_proc_sysname_write()
545 if (sysnames->nr == 0) { in afs_proc_sysname_write()
546 sysnames->subs[0] = sysnames->blank; in afs_proc_sysname_write()
547 sysnames->nr++; in afs_proc_sysname_write()
550 write_lock(&net->sysnames_lock); in afs_proc_sysname_write()
551 kill = net->sysnames; in afs_proc_sysname_write()
552 net->sysnames = sysnames; in afs_proc_sysname_write()
553 write_unlock(&net->sysnames_lock); in afs_proc_sysname_write()
560 ret = -EINVAL; in afs_proc_sysname_write()
569 if (sysnames && refcount_dec_and_test(&sysnames->usage)) { in afs_put_sysnames()
570 for (i = 0; i < sysnames->nr; i++) in afs_put_sysnames()
571 if (sysnames->subs[i] != afs_init_sysname && in afs_put_sysnames()
572 sysnames->subs[i] != sysnames->blank) in afs_put_sysnames()
573 kfree(sysnames->subs[i]); in afs_put_sysnames()
579 * Display general per-net namespace statistics
587 seq_printf(m, "dir-mgmt: look=%u reval=%u inval=%u relpg=%u\n", in afs_proc_stats_show()
588 atomic_read(&net->n_lookup), in afs_proc_stats_show()
589 atomic_read(&net->n_reval), in afs_proc_stats_show()
590 atomic_read(&net->n_inval), in afs_proc_stats_show()
591 atomic_read(&net->n_relpg)); in afs_proc_stats_show()
593 seq_printf(m, "dir-data: rdpg=%u\n", in afs_proc_stats_show()
594 atomic_read(&net->n_read_dir)); in afs_proc_stats_show()
596 seq_printf(m, "dir-edit: cr=%u rm=%u\n", in afs_proc_stats_show()
597 atomic_read(&net->n_dir_cr), in afs_proc_stats_show()
598 atomic_read(&net->n_dir_rm)); in afs_proc_stats_show()
600 seq_printf(m, "file-rd : n=%u nb=%lu\n", in afs_proc_stats_show()
601 atomic_read(&net->n_fetches), in afs_proc_stats_show()
602 atomic_long_read(&net->n_fetch_bytes)); in afs_proc_stats_show()
603 seq_printf(m, "file-wr : n=%u nb=%lu\n", in afs_proc_stats_show()
604 atomic_read(&net->n_stores), in afs_proc_stats_show()
605 atomic_long_read(&net->n_store_bytes)); in afs_proc_stats_show()
610 * initialise /proc/fs/afs/<cell>/
612 int afs_proc_cell_setup(struct afs_cell *cell) in afs_proc_cell_setup() argument
615 struct afs_net *net = cell->net; in afs_proc_cell_setup()
617 _enter("%p{%s},%p", cell, cell->name, net->proc_afs); in afs_proc_cell_setup()
619 dir = proc_net_mkdir(net->net, cell->name, net->proc_afs); in afs_proc_cell_setup()
626 cell) || in afs_proc_cell_setup()
630 cell)) in afs_proc_cell_setup()
637 remove_proc_subtree(cell->name, net->proc_afs); in afs_proc_cell_setup()
639 _leave(" = -ENOMEM"); in afs_proc_cell_setup()
640 return -ENOMEM; in afs_proc_cell_setup()
644 * remove /proc/fs/afs/<cell>/
646 void afs_proc_cell_remove(struct afs_cell *cell) in afs_proc_cell_remove() argument
648 struct afs_net *net = cell->net; in afs_proc_cell_remove()
651 remove_proc_subtree(cell->name, net->proc_afs); in afs_proc_cell_remove()
664 p = proc_net_mkdir(net->net, "afs", net->net->proc_net); in afs_proc_init()
687 net->proc_afs = p; in afs_proc_init()
694 _leave(" = -ENOMEM"); in afs_proc_init()
695 return -ENOMEM; in afs_proc_init()
703 proc_remove(net->proc_afs); in afs_proc_cleanup()
704 net->proc_afs = NULL; in afs_proc_cleanup()