• Home
  • Raw
  • Download

Lines Matching +full:1 +full:- +full:cell

35 	struct afs_cell *cell = list_entry(v, struct afs_cell, proc_link);  in afs_proc_cells_show()  local
38 /* display header on line 1 */ in afs_proc_cells_show()
43 /* display one cell per line on subsequent lines */ in afs_proc_cells_show()
44 seq_printf(m, "%3u %s\n", atomic_read(&cell->usage), cell->name); in afs_proc_cells_show()
52 return seq_hlist_start_head_rcu(&afs_seq2net(m)->proc_cells, *_pos); in afs_proc_cells_start()
57 return seq_hlist_next_rcu(v, &afs_seq2net(m)->proc_cells, pos); in afs_proc_cells_next()
75 * - to add cells: echo "add <cellname> <IP>[:<IP>][:<IP>]"
79 struct seq_file *m = file->private_data; in afs_proc_cells_write()
112 struct afs_cell *cell; in afs_proc_cells_write() local
114 cell = afs_lookup_cell(net, name, strlen(name), args, true); in afs_proc_cells_write()
115 if (IS_ERR(cell)) { in afs_proc_cells_write()
116 ret = PTR_ERR(cell); in afs_proc_cells_write()
120 if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags)) in afs_proc_cells_write()
121 afs_put_cell(net, cell); in afs_proc_cells_write()
133 ret = -EINVAL; in afs_proc_cells_write()
139 * Display the name of the current workstation cell.
143 struct afs_cell *cell; in afs_proc_rootcell_show() local
147 if (rcu_access_pointer(net->ws_cell)) { in afs_proc_rootcell_show()
149 cell = rcu_dereference(net->ws_cell); in afs_proc_rootcell_show()
150 if (cell) in afs_proc_rootcell_show()
151 seq_printf(m, "%s\n", cell->name); in afs_proc_rootcell_show()
158 * Set the current workstation cell and optionally supply its list of volume
161 * echo "cell.name:192.168.231.14" >/proc/fs/afs/rootcell
165 struct seq_file *m = file->private_data; in afs_proc_rootcell_write()
170 ret = -EINVAL; in afs_proc_rootcell_write()
198 * Display the list of volumes known to a cell.
202 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_volumes_show() local
205 /* Display header on line 1 */ in afs_proc_cell_volumes_show()
206 if (v == &cell->proc_volumes) { in afs_proc_cell_volumes_show()
212 atomic_read(&vol->usage), vol->vid, in afs_proc_cell_volumes_show()
213 afs_vol_types[vol->type]); in afs_proc_cell_volumes_show()
219 __acquires(cell->proc_lock) in afs_proc_cell_volumes_start()
221 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_volumes_start() local
223 read_lock(&cell->proc_lock); in afs_proc_cell_volumes_start()
224 return seq_list_start_head(&cell->proc_volumes, *_pos); in afs_proc_cell_volumes_start()
230 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_volumes_next() local
232 return seq_list_next(v, &cell->proc_volumes, _pos); in afs_proc_cell_volumes_next()
236 __releases(cell->proc_lock) in afs_proc_cell_volumes_stop()
238 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_volumes_stop() local
240 read_unlock(&cell->proc_lock); in afs_proc_cell_volumes_stop()
251 * Display the list of Volume Location servers we're using for a cell.
257 /* display header on line 1 */ in afs_proc_cell_vlservers_show()
258 if (v == (void *)1) { in afs_proc_cell_vlservers_show()
263 /* display one cell per line on subsequent lines */ in afs_proc_cell_vlservers_show()
264 seq_printf(m, "%pISp\n", &addr->transport); in afs_proc_cell_vlservers_show()
272 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_vlservers_start() local
277 alist = rcu_dereference(cell->vl_addrs); in afs_proc_cell_vlservers_start()
281 return (void *) 1; in afs_proc_cell_vlservers_start()
282 pos--; in afs_proc_cell_vlservers_start()
284 if (!alist || pos >= alist->nr_addrs) in afs_proc_cell_vlservers_start()
287 return alist->addrs + pos; in afs_proc_cell_vlservers_start()
294 struct afs_cell *cell = PDE_DATA(file_inode(m->file)); in afs_proc_cell_vlservers_next() local
297 alist = rcu_dereference(cell->vl_addrs); in afs_proc_cell_vlservers_next()
301 if (!alist || pos >= alist->nr_addrs) in afs_proc_cell_vlservers_next()
304 return alist->addrs + pos; in afs_proc_cell_vlservers_next()
335 alist = rcu_dereference(server->addresses); in afs_proc_servers_show()
337 &server->uuid, in afs_proc_servers_show()
338 atomic_read(&server->usage), in afs_proc_servers_show()
339 &alist->addrs[0].transport, in afs_proc_servers_show()
340 alist->index == 0 ? "*" : ""); in afs_proc_servers_show()
341 for (i = 1; i < alist->nr_addrs; i++) in afs_proc_servers_show()
343 &alist->addrs[i].transport, in afs_proc_servers_show()
344 alist->index == i ? "*" : ""); in afs_proc_servers_show()
352 return seq_hlist_start_head_rcu(&afs_seq2net(m)->fs_proc, *_pos); in afs_proc_servers_start()
357 return seq_hlist_next_rcu(v, &afs_seq2net(m)->fs_proc, _pos); in afs_proc_servers_next()
380 struct afs_sysnames *sysnames = net->sysnames; in afs_proc_sysname_show()
381 unsigned int i = (unsigned long)v - 1; in afs_proc_sysname_show()
383 if (i < sysnames->nr) in afs_proc_sysname_show()
384 seq_printf(m, "%s\n", sysnames->subs[i]); in afs_proc_sysname_show()
389 __acquires(&net->sysnames_lock) in afs_proc_sysname_start()
394 read_lock(&net->sysnames_lock); in afs_proc_sysname_start()
396 names = net->sysnames; in afs_proc_sysname_start()
397 if (*pos >= names->nr) in afs_proc_sysname_start()
399 return (void *)(unsigned long)(*pos + 1); in afs_proc_sysname_start()
405 struct afs_sysnames *names = net->sysnames; in afs_proc_sysname_next()
407 *pos += 1; in afs_proc_sysname_next()
408 if (*pos >= names->nr) in afs_proc_sysname_next()
410 return (void *)(unsigned long)(*pos + 1); in afs_proc_sysname_next()
414 __releases(&net->sysnames_lock) in afs_proc_sysname_stop()
418 read_unlock(&net->sysnames_lock); in afs_proc_sysname_stop()
434 struct seq_file *m = file->private_data; in afs_proc_sysname_write()
441 return -ENOMEM; in afs_proc_sysname_write()
442 refcount_set(&sysnames->usage, 1); in afs_proc_sysname_write()
450 ret = -ENAMETOOLONG; in afs_proc_sysname_write()
455 s[len - 4] == '@' && in afs_proc_sysname_write()
456 s[len - 3] == 's' && in afs_proc_sysname_write()
457 s[len - 2] == 'y' && in afs_proc_sysname_write()
458 s[len - 1] == 's') in afs_proc_sysname_write()
463 (len < 2 || (len == 2 && s[1] == '.'))) in afs_proc_sysname_write()
469 ret = -EFBIG; in afs_proc_sysname_write()
470 if (sysnames->nr >= AFS_NR_SYSNAME) in afs_proc_sysname_write()
476 ret = -ENOMEM; in afs_proc_sysname_write()
477 sub = kmemdup(s, len + 1, GFP_KERNEL); in afs_proc_sysname_write()
482 sysnames->subs[sysnames->nr] = sub; in afs_proc_sysname_write()
483 sysnames->nr++; in afs_proc_sysname_write()
486 if (sysnames->nr == 0) { in afs_proc_sysname_write()
487 sysnames->subs[0] = sysnames->blank; in afs_proc_sysname_write()
488 sysnames->nr++; in afs_proc_sysname_write()
491 write_lock(&net->sysnames_lock); in afs_proc_sysname_write()
492 kill = net->sysnames; in afs_proc_sysname_write()
493 net->sysnames = sysnames; in afs_proc_sysname_write()
494 write_unlock(&net->sysnames_lock); in afs_proc_sysname_write()
501 ret = -EINVAL; in afs_proc_sysname_write()
510 if (sysnames && refcount_dec_and_test(&sysnames->usage)) { in afs_put_sysnames()
511 for (i = 0; i < sysnames->nr; i++) in afs_put_sysnames()
512 if (sysnames->subs[i] != afs_init_sysname && in afs_put_sysnames()
513 sysnames->subs[i] != sysnames->blank) in afs_put_sysnames()
514 kfree(sysnames->subs[i]); in afs_put_sysnames()
520 * Display general per-net namespace statistics
528 seq_printf(m, "dir-mgmt: look=%u reval=%u inval=%u relpg=%u\n", in afs_proc_stats_show()
529 atomic_read(&net->n_lookup), in afs_proc_stats_show()
530 atomic_read(&net->n_reval), in afs_proc_stats_show()
531 atomic_read(&net->n_inval), in afs_proc_stats_show()
532 atomic_read(&net->n_relpg)); in afs_proc_stats_show()
534 seq_printf(m, "dir-data: rdpg=%u\n", in afs_proc_stats_show()
535 atomic_read(&net->n_read_dir)); in afs_proc_stats_show()
537 seq_printf(m, "dir-edit: cr=%u rm=%u\n", in afs_proc_stats_show()
538 atomic_read(&net->n_dir_cr), in afs_proc_stats_show()
539 atomic_read(&net->n_dir_rm)); in afs_proc_stats_show()
541 seq_printf(m, "file-rd : n=%u nb=%lu\n", in afs_proc_stats_show()
542 atomic_read(&net->n_fetches), in afs_proc_stats_show()
543 atomic_long_read(&net->n_fetch_bytes)); in afs_proc_stats_show()
544 seq_printf(m, "file-wr : n=%u nb=%lu\n", in afs_proc_stats_show()
545 atomic_read(&net->n_stores), in afs_proc_stats_show()
546 atomic_long_read(&net->n_store_bytes)); in afs_proc_stats_show()
551 * initialise /proc/fs/afs/<cell>/
553 int afs_proc_cell_setup(struct afs_cell *cell) in afs_proc_cell_setup() argument
556 struct afs_net *net = cell->net; in afs_proc_cell_setup()
558 _enter("%p{%s},%p", cell, cell->name, net->proc_afs); in afs_proc_cell_setup()
560 dir = proc_net_mkdir(net->net, cell->name, net->proc_afs); in afs_proc_cell_setup()
567 cell) || in afs_proc_cell_setup()
571 cell)) in afs_proc_cell_setup()
578 remove_proc_subtree(cell->name, net->proc_afs); in afs_proc_cell_setup()
580 _leave(" = -ENOMEM"); in afs_proc_cell_setup()
581 return -ENOMEM; in afs_proc_cell_setup()
585 * remove /proc/fs/afs/<cell>/
587 void afs_proc_cell_remove(struct afs_cell *cell) in afs_proc_cell_remove() argument
589 struct afs_net *net = cell->net; in afs_proc_cell_remove()
592 remove_proc_subtree(cell->name, net->proc_afs); in afs_proc_cell_remove()
605 p = proc_net_mkdir(net->net, "afs", net->net->proc_net); in afs_proc_init()
628 net->proc_afs = p; in afs_proc_init()
635 _leave(" = -ENOMEM"); in afs_proc_init()
636 return -ENOMEM; in afs_proc_init()
644 proc_remove(net->proc_afs); in afs_proc_cleanup()
645 net->proc_afs = NULL; in afs_proc_cleanup()