/* * linux/net/sunrpc/clnt.c * * This file contains the high-level RPC interface. * It is modeled as a finite state machine to support both synchronous * and asynchronous requests. * * - RPC header generation and argument serialization. * - Credential refresh. * - TCP connect handling. * - Retry of operation when it is suspected the operation failed because * of uid squashing on the server, or when the credentials were stale * and need to be refreshed, or when a packet was damaged in transit. * This may be have to be moved to the VFS layer. * * NB: BSD uses a more intelligent approach to guessing when a request * or reply has been lost by keeping the RTO estimate for each procedure. * We currently make do with a constant timeout value. * * Copyright (C) 1992,1993 Rick Sladkey <jrs@world.std.com> * Copyright (C) 1995,1996 Olaf Kirch <okir@monad.swb.de> */#include<asm/system.h>#include<linux/module.h>#include<linux/types.h>#include<linux/mm.h>#include<linux/slab.h>#include<linux/utsname.h>#include<linux/workqueue.h>#include<linux/sunrpc/clnt.h>#include<linux/sunrpc/rpc_pipe_fs.h>#include<linux/sunrpc/metrics.h>#define RPC_SLACK_SPACE (1024) /* total overkill */#ifdef RPC_DEBUG# define RPCDBG_FACILITY RPCDBG_CALL#endifstaticDECLARE_WAIT_QUEUE_HEAD(destroy_wait);staticvoidcall_start(structrpc_task*task);staticvoidcall_reserve(structrpc_task*task);staticvoidcall_reserveresult(structrpc_task*task);staticvoidcall_allocate(structrpc_task*task);staticvoidcall_encode(structrpc_task*task);staticvoidcall_decode(structrpc_task*task);staticvoidcall_bind(structrpc_task*task);staticvoidcall_bind_status(structrpc_task*task);staticvoidcall_transmit(structrpc_task*task);staticvoidcall_status(structrpc_task*task);staticvoidcall_transmit_status(structrpc_task*task);staticvoidcall_refresh(structrpc_task*task);staticvoidcall_refreshresult(structrpc_task*task);staticvoidcall_timeout(structrpc_task*task);staticvoidcall_connect(structrpc_task*task);staticvoidcall_connect_status(structrpc_task*task);staticu32*call_header(structrpc_task*task);staticu32*call_verify(structrpc_task*task);staticintrpc_setup_pipedir(structrpc_clnt*clnt,char*dir_name){staticuint32_tclntid;interror;clnt->cl_vfsmnt=ERR_PTR(-ENOENT);clnt->cl_dentry=ERR_PTR(-ENOENT);if(dir_name==