proc.c (f401b2c9931a70317b6ac0d3e6020adc3a404cc0) proc.c (88c853c3f5c0a07c5db61b494ee25152535cfeee)
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* /proc interface for AFS
3 *
4 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#include <linux/slab.h>

--- 24 unchanged lines hidden (view full) ---

33 */
34static int afs_proc_cells_show(struct seq_file *m, void *v)
35{
36 struct afs_vlserver_list *vllist;
37 struct afs_cell *cell;
38
39 if (v == SEQ_START_TOKEN) {
40 /* display header on line 1 */
1// SPDX-License-Identifier: GPL-2.0-or-later
2/* /proc interface for AFS
3 *
4 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
6 */
7
8#include <linux/slab.h>

--- 24 unchanged lines hidden (view full) ---

33 */
34static int afs_proc_cells_show(struct seq_file *m, void *v)
35{
36 struct afs_vlserver_list *vllist;
37 struct afs_cell *cell;
38
39 if (v == SEQ_START_TOKEN) {
40 /* display header on line 1 */
41 seq_puts(m, "USE TTL SV ST NAME\n");
41 seq_puts(m, "USE ACT TTL SV ST NAME\n");
42 return 0;
43 }
44
45 cell = list_entry(v, struct afs_cell, proc_link);
46 vllist = rcu_dereference(cell->vl_servers);
47
48 /* display one cell per line on subsequent lines */
42 return 0;
43 }
44
45 cell = list_entry(v, struct afs_cell, proc_link);
46 vllist = rcu_dereference(cell->vl_servers);
47
48 /* display one cell per line on subsequent lines */
49 seq_printf(m, "%3u %6lld %2u %2u %s\n",
50 atomic_read(&cell->usage),
49 seq_printf(m, "%3u %3u %6lld %2u %2u %s\n",
50 atomic_read(&cell->ref),
51 atomic_read(&cell->active),
51 cell->dns_expiry - ktime_get_real_seconds(),
52 cell->dns_expiry - ktime_get_real_seconds(),
52 vllist->nr_servers,
53 vllist ? vllist->nr_servers : 0,
53 cell->state,
54 cell->name);
55 return 0;
56}
57
58static void *afs_proc_cells_start(struct seq_file *m, loff_t *_pos)
59 __acquires(rcu)
60{

--- 62 unchanged lines hidden (view full) ---

123
124 cell = afs_lookup_cell(net, name, strlen(name), args, true);
125 if (IS_ERR(cell)) {
126 ret = PTR_ERR(cell);
127 goto done;
128 }
129
130 if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags))
54 cell->state,
55 cell->name);
56 return 0;
57}
58
59static void *afs_proc_cells_start(struct seq_file *m, loff_t *_pos)
60 __acquires(rcu)
61{

--- 62 unchanged lines hidden (view full) ---

124
125 cell = afs_lookup_cell(net, name, strlen(name), args, true);
126 if (IS_ERR(cell)) {
127 ret = PTR_ERR(cell);
128 goto done;
129 }
130
131 if (test_and_set_bit(AFS_CELL_FL_NO_GC, &cell->flags))
131 afs_put_cell(net, cell);
132 afs_unuse_cell(net, cell);
132 } else {
133 goto inval;
134 }
135
136 ret = 0;
137
138done:
139 _leave(" = %d", ret);

--- 9 unchanged lines hidden (view full) ---

149 * Display the name of the current workstation cell.
150 */
151static int afs_proc_rootcell_show(struct seq_file *m, void *v)
152{
153 struct afs_cell *cell;
154 struct afs_net *net;
155
156 net = afs_seq2net_single(m);
133 } else {
134 goto inval;
135 }
136
137 ret = 0;
138
139done:
140 _leave(" = %d", ret);

--- 9 unchanged lines hidden (view full) ---

150 * Display the name of the current workstation cell.
151 */
152static int afs_proc_rootcell_show(struct seq_file *m, void *v)
153{
154 struct afs_cell *cell;
155 struct afs_net *net;
156
157 net = afs_seq2net_single(m);
157 if (rcu_access_pointer(net->ws_cell)) {
158 rcu_read_lock();
159 cell = rcu_dereference(net->ws_cell);
160 if (cell)
161 seq_printf(m, "%s\n", cell->name);
162 rcu_read_unlock();
163 }
158 down_read(&net->cells_lock);
159 cell = net->ws_cell;
160 if (cell)
161 seq_printf(m, "%s\n", cell->name);
162 up_read(&net->cells_lock);
164 return 0;
165}
166
167/*
168 * Set the current workstation cell and optionally supply its list of volume
169 * location servers.
170 *
171 * echo "cell.name:192.168.231.14" >/proc/fs/afs/rootcell

--- 535 unchanged lines hidden ---
163 return 0;
164}
165
166/*
167 * Set the current workstation cell and optionally supply its list of volume
168 * location servers.
169 *
170 * echo "cell.name:192.168.231.14" >/proc/fs/afs/rootcell

--- 535 unchanged lines hidden ---