1
- /* cell.c: AFS cell and server record management
1
+ /* AFS cell and server record management
2
2
*
3
3
* Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4
4
* Written by David Howells (dhowells@redhat.com)
@@ -44,7 +44,6 @@ struct cachefs_index_def afs_cache_cell_index_def = {
44
44
};
45
45
#endif
46
46
47
- /*****************************************************************************/
48
47
/*
49
48
* create a cell record
50
49
* - "name" is the name of the cell
@@ -137,16 +136,15 @@ int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell)
137
136
_leave (" = 0 (%p)" , cell );
138
137
return 0 ;
139
138
140
- badaddr :
139
+ badaddr :
141
140
printk (KERN_ERR "kAFS: bad VL server IP address: '%s'\n" , vllist );
142
- error :
141
+ error :
143
142
up_write (& afs_cells_sem );
144
143
kfree (cell );
145
144
_leave (" = %d" , ret );
146
145
return ret ;
147
- } /* end afs_cell_create() */
146
+ }
148
147
149
- /*****************************************************************************/
150
148
/*
151
149
* initialise the cell database from module parameters
152
150
*/
@@ -199,10 +197,8 @@ int afs_cell_init(char *rootcell)
199
197
200
198
_leave (" = %d" , ret );
201
199
return ret ;
200
+ }
202
201
203
- } /* end afs_cell_init() */
204
-
205
- /*****************************************************************************/
206
202
/*
207
203
* lookup a cell record
208
204
*/
@@ -234,8 +230,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
234
230
235
231
if (cell )
236
232
ret = 0 ;
237
- }
238
- else {
233
+ } else {
239
234
read_lock (& afs_cells_lock );
240
235
241
236
cell = afs_cell_root ;
@@ -247,8 +242,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
247
242
* for other reasons.
248
243
*/
249
244
ret = - EDESTADDRREQ ;
250
- }
251
- else {
245
+ } else {
252
246
afs_get_cell (cell );
253
247
ret = 0 ;
254
248
}
@@ -259,10 +253,8 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
259
253
* _cell = cell ;
260
254
_leave (" = %d (%p)" , ret , cell );
261
255
return ret ;
256
+ }
262
257
263
- } /* end afs_cell_lookup() */
264
-
265
- /*****************************************************************************/
266
258
/*
267
259
* try and get a cell record
268
260
*/
@@ -281,9 +273,8 @@ struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell)
281
273
write_unlock (& afs_cells_lock );
282
274
283
275
return cell ;
284
- } /* end afs_get_cell_maybe() */
276
+ }
285
277
286
- /*****************************************************************************/
287
278
/*
288
279
* destroy a cell record
289
280
*/
@@ -315,9 +306,8 @@ void afs_put_cell(struct afs_cell *cell)
315
306
BUG_ON (!list_empty (& cell -> vl_graveyard ));
316
307
317
308
_leave (" [unused]" );
318
- } /* end afs_put_cell() */
309
+ }
319
310
320
- /*****************************************************************************/
321
311
/*
322
312
* destroy a cell record
323
313
*/
@@ -359,9 +349,8 @@ static void afs_cell_destroy(struct afs_cell *cell)
359
349
kfree (cell );
360
350
361
351
_leave (" [destroyed]" );
362
- } /* end afs_cell_destroy() */
352
+ }
363
353
364
- /*****************************************************************************/
365
354
/*
366
355
* lookup the server record corresponding to an Rx RPC peer
367
356
*/
@@ -411,28 +400,26 @@ int afs_server_find_by_peer(const struct rxrpc_peer *peer,
411
400
return - ENOENT ;
412
401
413
402
/* we found it in the graveyard - resurrect it */
414
- found_dead_server :
403
+ found_dead_server :
415
404
list_move_tail (& server -> link , & cell -> sv_list );
416
405
afs_get_server (server );
417
406
afs_kafstimod_del_timer (& server -> timeout );
418
407
spin_unlock (& cell -> sv_gylock );
419
408
goto success ;
420
409
421
410
/* we found it - increment its ref count and return it */
422
- found_server :
411
+ found_server :
423
412
afs_get_server (server );
424
413
425
- success :
414
+ success :
426
415
write_unlock (& cell -> sv_lock );
427
416
read_unlock (& afs_cells_lock );
428
417
429
418
* _server = server ;
430
419
_leave (" = 0 (s=%p c=%p)" , server , cell );
431
420
return 0 ;
421
+ }
432
422
433
- } /* end afs_server_find_by_peer() */
434
-
435
- /*****************************************************************************/
436
423
/*
437
424
* purge in-memory cell database on module unload or afs_init() failure
438
425
* - the timeout daemon is stopped before calling this
@@ -520,9 +507,8 @@ void afs_cell_purge(void)
520
507
}
521
508
522
509
_leave ("" );
523
- } /* end afs_cell_purge() */
510
+ }
524
511
525
- /*****************************************************************************/
526
512
/*
527
513
* match a cell record obtained from the cache
528
514
*/
@@ -542,10 +528,9 @@ static cachefs_match_val_t afs_cell_cache_match(void *target,
542
528
543
529
_leave (" = FAILED" );
544
530
return CACHEFS_MATCH_FAILED ;
545
- } /* end afs_cell_cache_match() */
531
+ }
546
532
#endif
547
533
548
- /*****************************************************************************/
549
534
/*
550
535
* update a cell record in the cache
551
536
*/
@@ -563,5 +548,5 @@ static void afs_cell_cache_update(void *source, void *entry)
563
548
cell -> vl_addrs ,
564
549
min (sizeof (ccell -> vl_servers ), sizeof (cell -> vl_addrs )));
565
550
566
- } /* end afs_cell_cache_update() */
551
+ }
567
552
#endif
0 commit comments