David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 1 | /* AFS Cache Manager Service |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
| 3 | * Copyright (C) 2002 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the License, or (at your option) any later version. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/module.h> |
| 13 | #include <linux/init.h> |
| 14 | #include <linux/sched.h> |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 15 | #include <linux/ip.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include "internal.h" |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 17 | #include "afs_cm.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 19 | struct workqueue_struct *afs_cm_workqueue; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 21 | static int afs_deliver_cb_init_call_back_state(struct afs_call *, |
| 22 | struct sk_buff *, bool); |
| 23 | static int afs_deliver_cb_probe(struct afs_call *, struct sk_buff *, bool); |
| 24 | static int afs_deliver_cb_callback(struct afs_call *, struct sk_buff *, bool); |
| 25 | static void afs_cm_destructor(struct afs_call *); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 27 | /* |
| 28 | * CB.CallBack operation type |
| 29 | */ |
| 30 | static const struct afs_call_type afs_SRXCBCallBack = { |
David Howells | 00d3b7a | 2007-04-26 15:57:07 -0700 | [diff] [blame^] | 31 | .name = "CB.CallBack", |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 32 | .deliver = afs_deliver_cb_callback, |
| 33 | .abort_to_error = afs_abort_to_error, |
| 34 | .destructor = afs_cm_destructor, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | }; |
| 36 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 37 | /* |
| 38 | * CB.InitCallBackState operation type |
| 39 | */ |
| 40 | static const struct afs_call_type afs_SRXCBInitCallBackState = { |
David Howells | 00d3b7a | 2007-04-26 15:57:07 -0700 | [diff] [blame^] | 41 | .name = "CB.InitCallBackState", |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 42 | .deliver = afs_deliver_cb_init_call_back_state, |
| 43 | .abort_to_error = afs_abort_to_error, |
| 44 | .destructor = afs_cm_destructor, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 45 | }; |
| 46 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 47 | /* |
| 48 | * CB.Probe operation type |
| 49 | */ |
| 50 | static const struct afs_call_type afs_SRXCBProbe = { |
David Howells | 00d3b7a | 2007-04-26 15:57:07 -0700 | [diff] [blame^] | 51 | .name = "CB.Probe", |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 52 | .deliver = afs_deliver_cb_probe, |
| 53 | .abort_to_error = afs_abort_to_error, |
| 54 | .destructor = afs_cm_destructor, |
| 55 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 58 | * route an incoming cache manager call |
| 59 | * - return T if supported, F if not |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 60 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 61 | bool afs_cm_incoming_call(struct afs_call *call) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 63 | u32 operation_id = ntohl(call->operation_ID); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 65 | _enter("{CB.OP %u}", operation_id); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 67 | switch (operation_id) { |
| 68 | case CBCallBack: |
| 69 | call->type = &afs_SRXCBCallBack; |
| 70 | return true; |
| 71 | case CBInitCallBackState: |
| 72 | call->type = &afs_SRXCBInitCallBackState; |
| 73 | return true; |
| 74 | case CBProbe: |
| 75 | call->type = &afs_SRXCBProbe; |
| 76 | return true; |
| 77 | default: |
| 78 | return false; |
| 79 | } |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 80 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 83 | * clean up a cache manager call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 84 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 85 | static void afs_cm_destructor(struct afs_call *call) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 86 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 87 | _enter(""); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 88 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 89 | afs_put_server(call->server); |
| 90 | call->server = NULL; |
| 91 | kfree(call->buffer); |
| 92 | call->buffer = NULL; |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 93 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 96 | * allow the fileserver to see if the cache manager is still alive |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 97 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 98 | static void SRXAFSCB_CallBack(struct work_struct *work) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 100 | struct afs_call *call = container_of(work, struct afs_call, work); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 101 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 102 | _enter(""); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 104 | /* be sure to send the reply *before* attempting to spam the AFS server |
| 105 | * with FSFetchStatus requests on the vnodes with broken callbacks lest |
| 106 | * the AFS server get into a vicious cycle of trying to break further |
| 107 | * callbacks because it hadn't received completion of the CBCallBack op |
| 108 | * yet */ |
| 109 | afs_send_empty_reply(call); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 111 | afs_break_callbacks(call->server, call->count, call->request); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | _leave(""); |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 113 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 115 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 116 | * deliver request data to a CB.CallBack call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 118 | static int afs_deliver_cb_callback(struct afs_call *call, struct sk_buff *skb, |
| 119 | bool last) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 120 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 121 | struct afs_callback *cb; |
| 122 | struct afs_server *server; |
| 123 | struct in_addr addr; |
| 124 | __be32 *bp; |
| 125 | u32 tmp; |
| 126 | int ret, loop; |
| 127 | |
| 128 | _enter("{%u},{%u},%d", call->unmarshall, skb->len, last); |
| 129 | |
| 130 | switch (call->unmarshall) { |
| 131 | case 0: |
| 132 | call->offset = 0; |
| 133 | call->unmarshall++; |
| 134 | |
| 135 | /* extract the FID array and its count in two steps */ |
| 136 | case 1: |
| 137 | _debug("extract FID count"); |
| 138 | ret = afs_extract_data(call, skb, last, &call->tmp, 4); |
| 139 | switch (ret) { |
| 140 | case 0: break; |
| 141 | case -EAGAIN: return 0; |
| 142 | default: return ret; |
| 143 | } |
| 144 | |
| 145 | call->count = ntohl(call->tmp); |
| 146 | _debug("FID count: %u", call->count); |
| 147 | if (call->count > AFSCBMAX) |
| 148 | return -EBADMSG; |
| 149 | |
| 150 | call->buffer = kmalloc(call->count * 3 * 4, GFP_KERNEL); |
| 151 | if (!call->buffer) |
| 152 | return -ENOMEM; |
| 153 | call->offset = 0; |
| 154 | call->unmarshall++; |
| 155 | |
| 156 | case 2: |
| 157 | _debug("extract FID array"); |
| 158 | ret = afs_extract_data(call, skb, last, call->buffer, |
| 159 | call->count * 3 * 4); |
| 160 | switch (ret) { |
| 161 | case 0: break; |
| 162 | case -EAGAIN: return 0; |
| 163 | default: return ret; |
| 164 | } |
| 165 | |
| 166 | _debug("unmarshall FID array"); |
| 167 | call->request = kcalloc(call->count, |
| 168 | sizeof(struct afs_callback), |
| 169 | GFP_KERNEL); |
| 170 | if (!call->request) |
| 171 | return -ENOMEM; |
| 172 | |
| 173 | cb = call->request; |
| 174 | bp = call->buffer; |
| 175 | for (loop = call->count; loop > 0; loop--, cb++) { |
| 176 | cb->fid.vid = ntohl(*bp++); |
| 177 | cb->fid.vnode = ntohl(*bp++); |
| 178 | cb->fid.unique = ntohl(*bp++); |
| 179 | cb->type = AFSCM_CB_UNTYPED; |
| 180 | } |
| 181 | |
| 182 | call->offset = 0; |
| 183 | call->unmarshall++; |
| 184 | |
| 185 | /* extract the callback array and its count in two steps */ |
| 186 | case 3: |
| 187 | _debug("extract CB count"); |
| 188 | ret = afs_extract_data(call, skb, last, &call->tmp, 4); |
| 189 | switch (ret) { |
| 190 | case 0: break; |
| 191 | case -EAGAIN: return 0; |
| 192 | default: return ret; |
| 193 | } |
| 194 | |
| 195 | tmp = ntohl(call->tmp); |
| 196 | _debug("CB count: %u", tmp); |
| 197 | if (tmp != call->count && tmp != 0) |
| 198 | return -EBADMSG; |
| 199 | call->offset = 0; |
| 200 | call->unmarshall++; |
| 201 | if (tmp == 0) |
| 202 | goto empty_cb_array; |
| 203 | |
| 204 | case 4: |
| 205 | _debug("extract CB array"); |
| 206 | ret = afs_extract_data(call, skb, last, call->request, |
| 207 | call->count * 3 * 4); |
| 208 | switch (ret) { |
| 209 | case 0: break; |
| 210 | case -EAGAIN: return 0; |
| 211 | default: return ret; |
| 212 | } |
| 213 | |
| 214 | _debug("unmarshall CB array"); |
| 215 | cb = call->request; |
| 216 | bp = call->buffer; |
| 217 | for (loop = call->count; loop > 0; loop--, cb++) { |
| 218 | cb->version = ntohl(*bp++); |
| 219 | cb->expiry = ntohl(*bp++); |
| 220 | cb->type = ntohl(*bp++); |
| 221 | } |
| 222 | |
| 223 | empty_cb_array: |
| 224 | call->offset = 0; |
| 225 | call->unmarshall++; |
| 226 | |
| 227 | case 5: |
| 228 | _debug("trailer"); |
| 229 | if (skb->len != 0) |
| 230 | return -EBADMSG; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 231 | break; |
| 232 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 234 | if (!last) |
| 235 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 237 | call->state = AFS_CALL_REPLYING; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 238 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 239 | /* we'll need the file server record as that tells us which set of |
| 240 | * vnodes to operate upon */ |
| 241 | memcpy(&addr, &ip_hdr(skb)->saddr, 4); |
| 242 | server = afs_find_server(&addr); |
| 243 | if (!server) |
| 244 | return -ENOTCONN; |
| 245 | call->server = server; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 247 | INIT_WORK(&call->work, SRXAFSCB_CallBack); |
| 248 | schedule_work(&call->work); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | return 0; |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 250 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 253 | * allow the fileserver to request callback state (re-)initialisation |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 254 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 255 | static void SRXAFSCB_InitCallBackState(struct work_struct *work) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 257 | struct afs_call *call = container_of(work, struct afs_call, work); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 258 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 259 | _enter("{%p}", call->server); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 260 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 261 | afs_init_callback_state(call->server); |
| 262 | afs_send_empty_reply(call); |
| 263 | _leave(""); |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 264 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 267 | * deliver request data to a CB.InitCallBackState call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 268 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 269 | static int afs_deliver_cb_init_call_back_state(struct afs_call *call, |
| 270 | struct sk_buff *skb, |
| 271 | bool last) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 272 | { |
| 273 | struct afs_server *server; |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 274 | struct in_addr addr; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 276 | _enter(",{%u},%d", skb->len, last); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 277 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 278 | if (skb->len > 0) |
| 279 | return -EBADMSG; |
| 280 | if (!last) |
| 281 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 282 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 283 | /* no unmarshalling required */ |
| 284 | call->state = AFS_CALL_REPLYING; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 286 | /* we'll need the file server record as that tells us which set of |
| 287 | * vnodes to operate upon */ |
| 288 | memcpy(&addr, &ip_hdr(skb)->saddr, 4); |
| 289 | server = afs_find_server(&addr); |
| 290 | if (!server) |
| 291 | return -ENOTCONN; |
| 292 | call->server = server; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 294 | INIT_WORK(&call->work, SRXAFSCB_InitCallBackState); |
| 295 | schedule_work(&call->work); |
| 296 | return 0; |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 297 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 300 | * allow the fileserver to see if the cache manager is still alive |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 302 | static void SRXAFSCB_Probe(struct work_struct *work) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 303 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 304 | struct afs_call *call = container_of(work, struct afs_call, work); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 306 | _enter(""); |
| 307 | afs_send_empty_reply(call); |
| 308 | _leave(""); |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 309 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 310 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 311 | /* |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 312 | * deliver request data to a CB.Probe call |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 313 | */ |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 314 | static int afs_deliver_cb_probe(struct afs_call *call, struct sk_buff *skb, |
| 315 | bool last) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 316 | { |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 317 | _enter(",{%u},%d", skb->len, last); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 319 | if (skb->len > 0) |
| 320 | return -EBADMSG; |
| 321 | if (!last) |
| 322 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 323 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 324 | /* no unmarshalling required */ |
| 325 | call->state = AFS_CALL_REPLYING; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 326 | |
David Howells | 08e0e7c | 2007-04-26 15:55:03 -0700 | [diff] [blame] | 327 | INIT_WORK(&call->work, SRXAFSCB_Probe); |
| 328 | schedule_work(&call->work); |
| 329 | return 0; |
David Howells | ec26815 | 2007-04-26 15:49:28 -0700 | [diff] [blame] | 330 | } |