aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2007-04-26 18:58:49 -0400
committerDavid S. Miller <davem@davemloft.net>2007-04-26 18:58:49 -0400
commitc35eccb1f614954b10cba3f74b7c301993b2f42e (patch)
tree4812a026024ab683944901d9d41d70aac4e45ba8
parentb908fe6b2d1294d93b0d0badf6bf4f9a2cd7d729 (diff)
[AFS]: Implement the CB.InitCallBackState3 operation.
Implement the CB.InitCallBackState3 operation for the fileserver to call. This reduces the amount of network traffic because if this op is aborted, the fileserver will then attempt an CB.InitCallBackState operation. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--fs/afs/afs_cm.h1
-rw-r--r--fs/afs/cmservice.c46
2 files changed, 47 insertions, 0 deletions
diff --git a/fs/afs/afs_cm.h b/fs/afs/afs_cm.h
index d4bd201cc31e..7b4d4fab4c80 100644
--- a/fs/afs/afs_cm.h
+++ b/fs/afs/afs_cm.h
@@ -23,6 +23,7 @@ enum AFS_CM_Operations {
23 CBGetCE = 208, /* get cache file description */ 23 CBGetCE = 208, /* get cache file description */
24 CBGetXStatsVersion = 209, /* get version of extended statistics */ 24 CBGetXStatsVersion = 209, /* get version of extended statistics */
25 CBGetXStats = 210, /* get contents of extended statistics data */ 25 CBGetXStats = 210, /* get contents of extended statistics data */
26 CBInitCallBackState3 = 213, /* initialise callback state, version 3 */
26 CBGetCapabilities = 65538, /* get client capabilities */ 27 CBGetCapabilities = 65538, /* get client capabilities */
27}; 28};
28 29
diff --git a/fs/afs/cmservice.c b/fs/afs/cmservice.c
index a6af3acf016e..6685f4cbccb3 100644
--- a/fs/afs/cmservice.c
+++ b/fs/afs/cmservice.c
@@ -20,6 +20,8 @@ struct workqueue_struct *afs_cm_workqueue;
20 20
21static int afs_deliver_cb_init_call_back_state(struct afs_call *, 21static int afs_deliver_cb_init_call_back_state(struct afs_call *,
22 struct sk_buff *, bool); 22 struct sk_buff *, bool);
23static int afs_deliver_cb_init_call_back_state3(struct afs_call *,
24 struct sk_buff *, bool);
23static int afs_deliver_cb_probe(struct afs_call *, struct sk_buff *, bool); 25static int afs_deliver_cb_probe(struct afs_call *, struct sk_buff *, bool);
24static int afs_deliver_cb_callback(struct afs_call *, struct sk_buff *, bool); 26static int afs_deliver_cb_callback(struct afs_call *, struct sk_buff *, bool);
25static int afs_deliver_cb_get_capabilities(struct afs_call *, struct sk_buff *, 27static int afs_deliver_cb_get_capabilities(struct afs_call *, struct sk_buff *,
@@ -47,6 +49,16 @@ static const struct afs_call_type afs_SRXCBInitCallBackState = {
47}; 49};
48 50
49/* 51/*
52 * CB.InitCallBackState3 operation type
53 */
54static const struct afs_call_type afs_SRXCBInitCallBackState3 = {
55 .name = "CB.InitCallBackState3",
56 .deliver = afs_deliver_cb_init_call_back_state3,
57 .abort_to_error = afs_abort_to_error,
58 .destructor = afs_cm_destructor,
59};
60
61/*
50 * CB.Probe operation type 62 * CB.Probe operation type
51 */ 63 */
52static const struct afs_call_type afs_SRXCBProbe = { 64static const struct afs_call_type afs_SRXCBProbe = {
@@ -83,6 +95,9 @@ bool afs_cm_incoming_call(struct afs_call *call)
83 case CBInitCallBackState: 95 case CBInitCallBackState:
84 call->type = &afs_SRXCBInitCallBackState; 96 call->type = &afs_SRXCBInitCallBackState;
85 return true; 97 return true;
98 case CBInitCallBackState3:
99 call->type = &afs_SRXCBInitCallBackState3;
100 return true;
86 case CBProbe: 101 case CBProbe:
87 call->type = &afs_SRXCBProbe; 102 call->type = &afs_SRXCBProbe;
88 return true; 103 return true;
@@ -312,6 +327,37 @@ static int afs_deliver_cb_init_call_back_state(struct afs_call *call,
312} 327}
313 328
314/* 329/*
330 * deliver request data to a CB.InitCallBackState3 call
331 */
332static int afs_deliver_cb_init_call_back_state3(struct afs_call *call,
333 struct sk_buff *skb,
334 bool last)
335{
336 struct afs_server *server;
337 struct in_addr addr;
338
339 _enter(",{%u},%d", skb->len, last);
340
341 if (!last)
342 return 0;
343
344 /* no unmarshalling required */
345 call->state = AFS_CALL_REPLYING;
346
347 /* we'll need the file server record as that tells us which set of
348 * vnodes to operate upon */
349 memcpy(&addr, &ip_hdr(skb)->saddr, 4);
350 server = afs_find_server(&addr);
351 if (!server)
352 return -ENOTCONN;
353 call->server = server;
354
355 INIT_WORK(&call->work, SRXAFSCB_InitCallBackState);
356 schedule_work(&call->work);
357 return 0;
358}
359
360/*
315 * allow the fileserver to see if the cache manager is still alive 361 * allow the fileserver to see if the cache manager is still alive
316 */ 362 */
317static void SRXAFSCB_Probe(struct work_struct *work) 363static void SRXAFSCB_Probe(struct work_struct *work)