aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/cmservice.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/afs/cmservice.c')
-rw-r--r--fs/afs/cmservice.c46
1 files changed, 14 insertions, 32 deletions
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index 3d097fddcb7a..3f4585765cbf 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -1,4 +1,4 @@
1/* cmservice.c: AFS Cache Manager Service 1/* AFS Cache Manager Service
2 * 2 *
3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. 3 * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com) 4 * Written by David Howells (dhowells@redhat.com)
@@ -106,7 +106,6 @@ static DEFINE_SPINLOCK(afscm_calls_lock);
106static DEFINE_SPINLOCK(kafscmd_attention_lock); 106static DEFINE_SPINLOCK(kafscmd_attention_lock);
107static int kafscmd_die; 107static int kafscmd_die;
108 108
109/*****************************************************************************/
110/* 109/*
111 * AFS Cache Manager kernel thread 110 * AFS Cache Manager kernel thread
112 */ 111 */
@@ -177,10 +176,8 @@ static int kafscmd(void *arg)
177 176
178 /* and that's all */ 177 /* and that's all */
179 complete_and_exit(&kafscmd_dead, 0); 178 complete_and_exit(&kafscmd_dead, 0);
179}
180 180
181} /* end kafscmd() */
182
183/*****************************************************************************/
184/* 181/*
185 * handle a call coming in to the cache manager 182 * handle a call coming in to the cache manager
186 * - if I want to keep the call, I must increment its usage count 183 * - if I want to keep the call, I must increment its usage count
@@ -202,10 +199,8 @@ static int afscm_new_call(struct rxrpc_call *call)
202 199
203 _leave(" = 0"); 200 _leave(" = 0");
204 return 0; 201 return 0;
202}
205 203
206} /* end afscm_new_call() */
207
208/*****************************************************************************/
209/* 204/*
210 * queue on the kafscmd queue for attention 205 * queue on the kafscmd queue for attention
211 */ 206 */
@@ -226,9 +221,8 @@ static void afscm_attention(struct rxrpc_call *call)
226 wake_up(&kafscmd_sleepq); 221 wake_up(&kafscmd_sleepq);
227 222
228 _leave(" {u=%d}", atomic_read(&call->usage)); 223 _leave(" {u=%d}", atomic_read(&call->usage));
229} /* end afscm_attention() */ 224}
230 225
231/*****************************************************************************/
232/* 226/*
233 * handle my call being aborted 227 * handle my call being aborted
234 * - clean up, dequeue and put my ref to the call 228 * - clean up, dequeue and put my ref to the call
@@ -266,9 +260,8 @@ static void afscm_error(struct rxrpc_call *call)
266 wake_up(&kafscmd_sleepq); 260 wake_up(&kafscmd_sleepq);
267 261
268 _leave(""); 262 _leave("");
269} /* end afscm_error() */ 263}
270 264
271/*****************************************************************************/
272/* 265/*
273 * map afs abort codes to/from Linux error codes 266 * map afs abort codes to/from Linux error codes
274 * - called with call->lock held 267 * - called with call->lock held
@@ -285,9 +278,8 @@ static void afscm_aemap(struct rxrpc_call *call)
285 default: 278 default:
286 break; 279 break;
287 } 280 }
288} /* end afscm_aemap() */ 281}
289 282
290/*****************************************************************************/
291/* 283/*
292 * start the cache manager service if not already started 284 * start the cache manager service if not already started
293 */ 285 */
@@ -316,18 +308,16 @@ int afscm_start(void)
316 308
317 return 0; 309 return 0;
318 310
319 kill: 311kill:
320 kafscmd_die = 1; 312 kafscmd_die = 1;
321 wake_up(&kafscmd_sleepq); 313 wake_up(&kafscmd_sleepq);
322 wait_for_completion(&kafscmd_dead); 314 wait_for_completion(&kafscmd_dead);
323 315
324 out: 316out:
325 up_write(&afscm_sem); 317 up_write(&afscm_sem);
326 return ret; 318 return ret;
319}
327 320
328} /* end afscm_start() */
329
330/*****************************************************************************/
331/* 321/*
332 * stop the cache manager service 322 * stop the cache manager service
333 */ 323 */
@@ -394,10 +384,8 @@ void afscm_stop(void)
394 } 384 }
395 385
396 up_write(&afscm_sem); 386 up_write(&afscm_sem);
387}
397 388
398} /* end afscm_stop() */
399
400/*****************************************************************************/
401/* 389/*
402 * handle the fileserver breaking a set of callbacks 390 * handle the fileserver breaking a set of callbacks
403 */ 391 */
@@ -460,8 +448,7 @@ static void _SRXAFSCM_CallBack(struct rxrpc_call *call)
460 pcb->version = ntohl(*bp++); 448 pcb->version = ntohl(*bp++);
461 pcb->expiry = ntohl(*bp++); 449 pcb->expiry = ntohl(*bp++);
462 pcb->type = ntohl(*bp++); 450 pcb->type = ntohl(*bp++);
463 } 451 } else {
464 else {
465 pcb->version = 0; 452 pcb->version = 0;
466 pcb->expiry = 0; 453 pcb->expiry = 0;
467 pcb->type = AFSCM_CB_UNTYPED; 454 pcb->type = AFSCM_CB_UNTYPED;
@@ -512,10 +499,8 @@ static void _SRXAFSCM_CallBack(struct rxrpc_call *call)
512 afs_put_server(server); 499 afs_put_server(server);
513 500
514 _leave(" = %d", ret); 501 _leave(" = %d", ret);
502}
515 503
516} /* end _SRXAFSCM_CallBack() */
517
518/*****************************************************************************/
519/* 504/*
520 * handle the fileserver asking us to initialise our callback state 505 * handle the fileserver asking us to initialise our callback state
521 */ 506 */
@@ -580,10 +565,8 @@ static void _SRXAFSCM_InitCallBackState(struct rxrpc_call *call)
580 afs_put_server(server); 565 afs_put_server(server);
581 566
582 _leave(" = %d", ret); 567 _leave(" = %d", ret);
568}
583 569
584} /* end _SRXAFSCM_InitCallBackState() */
585
586/*****************************************************************************/
587/* 570/*
588 * handle a probe from a fileserver 571 * handle a probe from a fileserver
589 */ 572 */
@@ -648,5 +631,4 @@ static void _SRXAFSCM_Probe(struct rxrpc_call *call)
648 afs_put_server(server); 631 afs_put_server(server);
649 632
650 _leave(" = %d", ret); 633 _leave(" = %d", ret);
651 634}
652} /* end _SRXAFSCM_Probe() */