1- /* cell.c: AFS cell and server record management
1+ /* AFS cell and server record management
22 *
33 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
44 * Written by David Howells (dhowells@redhat.com)
@@ -44,7 +44,6 @@ struct cachefs_index_def afs_cache_cell_index_def = {
4444};
4545#endif
4646
47- /*****************************************************************************/
4847/*
4948 * create a cell record
5049 * - "name" is the name of the cell
@@ -137,16 +136,15 @@ int afs_cell_create(const char *name, char *vllist, struct afs_cell **_cell)
137136 _leave (" = 0 (%p)" , cell );
138137 return 0 ;
139138
140- badaddr :
139+ badaddr :
141140 printk (KERN_ERR "kAFS: bad VL server IP address: '%s'\n" , vllist );
142- error :
141+ error :
143142 up_write (& afs_cells_sem );
144143 kfree (cell );
145144 _leave (" = %d" , ret );
146145 return ret ;
147- } /* end afs_cell_create() */
146+ }
148147
149- /*****************************************************************************/
150148/*
151149 * initialise the cell database from module parameters
152150 */
@@ -199,10 +197,8 @@ int afs_cell_init(char *rootcell)
199197
200198 _leave (" = %d" , ret );
201199 return ret ;
200+ }
202201
203- } /* end afs_cell_init() */
204-
205- /*****************************************************************************/
206202/*
207203 * lookup a cell record
208204 */
@@ -234,8 +230,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
234230
235231 if (cell )
236232 ret = 0 ;
237- }
238- else {
233+ } else {
239234 read_lock (& afs_cells_lock );
240235
241236 cell = afs_cell_root ;
@@ -247,8 +242,7 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
247242 * for other reasons.
248243 */
249244 ret = - EDESTADDRREQ ;
250- }
251- else {
245+ } else {
252246 afs_get_cell (cell );
253247 ret = 0 ;
254248 }
@@ -259,10 +253,8 @@ int afs_cell_lookup(const char *name, unsigned namesz, struct afs_cell **_cell)
259253 * _cell = cell ;
260254 _leave (" = %d (%p)" , ret , cell );
261255 return ret ;
256+ }
262257
263- } /* end afs_cell_lookup() */
264-
265- /*****************************************************************************/
266258/*
267259 * try and get a cell record
268260 */
@@ -281,9 +273,8 @@ struct afs_cell *afs_get_cell_maybe(struct afs_cell **_cell)
281273 write_unlock (& afs_cells_lock );
282274
283275 return cell ;
284- } /* end afs_get_cell_maybe() */
276+ }
285277
286- /*****************************************************************************/
287278/*
288279 * destroy a cell record
289280 */
@@ -315,9 +306,8 @@ void afs_put_cell(struct afs_cell *cell)
315306 BUG_ON (!list_empty (& cell -> vl_graveyard ));
316307
317308 _leave (" [unused]" );
318- } /* end afs_put_cell() */
309+ }
319310
320- /*****************************************************************************/
321311/*
322312 * destroy a cell record
323313 */
@@ -359,9 +349,8 @@ static void afs_cell_destroy(struct afs_cell *cell)
359349 kfree (cell );
360350
361351 _leave (" [destroyed]" );
362- } /* end afs_cell_destroy() */
352+ }
363353
364- /*****************************************************************************/
365354/*
366355 * lookup the server record corresponding to an Rx RPC peer
367356 */
@@ -411,28 +400,26 @@ int afs_server_find_by_peer(const struct rxrpc_peer *peer,
411400 return - ENOENT ;
412401
413402 /* we found it in the graveyard - resurrect it */
414- found_dead_server :
403+ found_dead_server :
415404 list_move_tail (& server -> link , & cell -> sv_list );
416405 afs_get_server (server );
417406 afs_kafstimod_del_timer (& server -> timeout );
418407 spin_unlock (& cell -> sv_gylock );
419408 goto success ;
420409
421410 /* we found it - increment its ref count and return it */
422- found_server :
411+ found_server :
423412 afs_get_server (server );
424413
425- success :
414+ success :
426415 write_unlock (& cell -> sv_lock );
427416 read_unlock (& afs_cells_lock );
428417
429418 * _server = server ;
430419 _leave (" = 0 (s=%p c=%p)" , server , cell );
431420 return 0 ;
421+ }
432422
433- } /* end afs_server_find_by_peer() */
434-
435- /*****************************************************************************/
436423/*
437424 * purge in-memory cell database on module unload or afs_init() failure
438425 * - the timeout daemon is stopped before calling this
@@ -520,9 +507,8 @@ void afs_cell_purge(void)
520507 }
521508
522509 _leave ("" );
523- } /* end afs_cell_purge() */
510+ }
524511
525- /*****************************************************************************/
526512/*
527513 * match a cell record obtained from the cache
528514 */
@@ -542,10 +528,9 @@ static cachefs_match_val_t afs_cell_cache_match(void *target,
542528
543529 _leave (" = FAILED" );
544530 return CACHEFS_MATCH_FAILED ;
545- } /* end afs_cell_cache_match() */
531+ }
546532#endif
547533
548- /*****************************************************************************/
549534/*
550535 * update a cell record in the cache
551536 */
@@ -563,5 +548,5 @@ static void afs_cell_cache_update(void *source, void *entry)
563548 cell -> vl_addrs ,
564549 min (sizeof (ccell -> vl_servers ), sizeof (cell -> vl_addrs )));
565550
566- } /* end afs_cell_cache_update() */
551+ }
567552#endif
0 commit comments