svcproc.c (8990c1bc4be46473ad19bf2fa612ca57286f3df4) svcproc.c (7db836d4a427c3c64406b00b6d8d745d6335d72a)
1/*
2 * linux/fs/lockd/svcproc.c
3 *
4 * Lockd server procedures. We don't implement the NLM_*_RES
5 * procedures because we don't use the async procedures.
6 *
7 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
8 */
9
10#include <linux/types.h>
11#include <linux/time.h>
1/*
2 * linux/fs/lockd/svcproc.c
3 *
4 * Lockd server procedures. We don't implement the NLM_*_RES
5 * procedures because we don't use the async procedures.
6 *
7 * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de>
8 */
9
10#include <linux/types.h>
11#include <linux/time.h>
12#include <linux/smp_lock.h>
13#include <linux/lockd/lockd.h>
14#include <linux/lockd/share.h>
15
16#define NLMDBG_FACILITY NLMDBG_CLIENT
17
18#ifdef CONFIG_LOCKD_V4
19static __be32
20cast_to_nlm(__be32 status, u32 vers)

--- 232 unchanged lines hidden (view full) ---

253 * This is the generic lockd callback for async RPC calls
254 */
255static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
256{
257 dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
258 -task->tk_status);
259}
260
12#include <linux/lockd/lockd.h>
13#include <linux/lockd/share.h>
14
15#define NLMDBG_FACILITY NLMDBG_CLIENT
16
17#ifdef CONFIG_LOCKD_V4
18static __be32
19cast_to_nlm(__be32 status, u32 vers)

--- 232 unchanged lines hidden (view full) ---

252 * This is the generic lockd callback for async RPC calls
253 */
254static void nlmsvc_callback_exit(struct rpc_task *task, void *data)
255{
256 dprintk("lockd: %5u callback returned %d\n", task->tk_pid,
257 -task->tk_status);
258}
259
260void nlmsvc_release_call(struct nlm_rqst *call)
261{
262 if (!atomic_dec_and_test(&call->a_count))
263 return;
264 nlm_release_host(call->a_host);
265 kfree(call);
266}
267
261static void nlmsvc_callback_release(void *data)
262{
268static void nlmsvc_callback_release(void *data)
269{
263 nlm_release_call(data);
270 nlmsvc_release_call(data);
264}
265
266static const struct rpc_call_ops nlmsvc_callback_ops = {
267 .rpc_call_done = nlmsvc_callback_exit,
268 .rpc_release = nlmsvc_callback_release,
269};
270
271/*

--- 15 unchanged lines hidden (view full) ---

287 return rpc_system_err;
288
289 call = nlm_alloc_call(host);
290 if (call == NULL)
291 return rpc_system_err;
292
293 stat = func(rqstp, argp, &call->a_res);
294 if (stat != 0) {
271}
272
273static const struct rpc_call_ops nlmsvc_callback_ops = {
274 .rpc_call_done = nlmsvc_callback_exit,
275 .rpc_release = nlmsvc_callback_release,
276};
277
278/*

--- 15 unchanged lines hidden (view full) ---

294 return rpc_system_err;
295
296 call = nlm_alloc_call(host);
297 if (call == NULL)
298 return rpc_system_err;
299
300 stat = func(rqstp, argp, &call->a_res);
301 if (stat != 0) {
295 nlm_release_call(call);
302 nlmsvc_release_call(call);
296 return stat;
297 }
298
299 call->a_flags = RPC_TASK_ASYNC;
300 if (nlm_async_reply(call, proc, &nlmsvc_callback_ops) < 0)
301 return rpc_system_err;
302 return rpc_success;
303}

--- 234 unchanged lines hidden ---
303 return stat;
304 }
305
306 call->a_flags = RPC_TASK_ASYNC;
307 if (nlm_async_reply(call, proc, &nlmsvc_callback_ops) < 0)
308 return rpc_system_err;
309 return rpc_success;
310}

--- 234 unchanged lines hidden ---