mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
dfdcada31e
user-mode lock manager, build a kernel with the NFSLOCKD option and add '-k' to 'rpc_lockd_flags' in rc.conf. Highlights include: * Thread-safe kernel RPC client - many threads can use the same RPC client handle safely with replies being de-multiplexed at the socket upcall (typically driven directly by the NIC interrupt) and handed off to whichever thread matches the reply. For UDP sockets, many RPC clients can share the same socket. This allows the use of a single privileged UDP port number to talk to an arbitrary number of remote hosts. * Single-threaded kernel RPC server. Adding support for multi-threaded server would be relatively straightforward and would follow approximately the Solaris KPI. A single thread should be sufficient for the NLM since it should rarely block in normal operation. * Kernel mode NLM server supporting cancel requests and granted callbacks. I've tested the NLM server reasonably extensively - it passes both my own tests and the NFS Connectathon locking tests running on Solaris, Mac OS X and Ubuntu Linux. * Userland NLM client supported. While the NLM server doesn't have support for the local NFS client's locking needs, it does have to field async replies and granted callbacks from remote NLMs that the local client has contacted. We relay these replies to the userland rpc.lockd over a local domain RPC socket. * Robust deadlock detection for the local lock manager. In particular it will detect deadlocks caused by a lock request that covers more than one blocking request. As required by the NLM protocol, all deadlock detection happens synchronously - a user is guaranteed that if a lock request isn't rejected immediately, the lock will eventually be granted. The old system allowed for a 'deferred deadlock' condition where a blocked lock request could wake up and find that some other deadlock-causing lock owner had beaten them to the lock. * Since both local and remote locks are managed by the same kernel locking code, local and remote processes can safely use file locks for mutual exclusion. Local processes have no fairness advantage compared to remote processes when contending to lock a region that has just been unlocked - the local lock manager enforces a strict first-come first-served model for both local and remote lockers. Sponsored by: Isilon Systems PR: 95247 107555 115524 116679 MFC after: 2 weeks
84 lines
2.1 KiB
C
84 lines
2.1 KiB
C
/* $FreeBSD$ */
|
|
/*
|
|
* Copyright (c) 1986 - 1991, 1994, 1996, 1997 by Sun Microsystems, Inc.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
/*
|
|
* clnt_stat.h - Client side remote procedure call enum
|
|
*
|
|
*/
|
|
|
|
#ifndef _RPC_CLNT_STAT_H
|
|
#define _RPC_CLNT_STAT_H
|
|
|
|
/* #pragma ident "@(#)clnt_stat.h 1.2 97/04/28 SMI" */
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum clnt_stat {
|
|
RPC_SUCCESS = 0, /* call succeeded */
|
|
/*
|
|
* local errors
|
|
*/
|
|
RPC_CANTENCODEARGS = 1, /* can't encode arguments */
|
|
RPC_CANTDECODERES = 2, /* can't decode results */
|
|
RPC_CANTSEND = 3, /* failure in sending call */
|
|
RPC_CANTRECV = 4,
|
|
/* failure in receiving result */
|
|
RPC_TIMEDOUT = 5, /* call timed out */
|
|
RPC_INTR = 18, /* call interrupted */
|
|
RPC_UDERROR = 23, /* recv got uderr indication */
|
|
/*
|
|
* remote errors
|
|
*/
|
|
RPC_VERSMISMATCH = 6, /* rpc versions not compatible */
|
|
RPC_AUTHERROR = 7, /* authentication error */
|
|
RPC_PROGUNAVAIL = 8, /* program not available */
|
|
RPC_PROGVERSMISMATCH = 9, /* program version mismatched */
|
|
RPC_PROCUNAVAIL = 10, /* procedure unavailable */
|
|
RPC_CANTDECODEARGS = 11, /* decode arguments error */
|
|
RPC_SYSTEMERROR = 12, /* generic "other problem" */
|
|
|
|
/*
|
|
* rpc_call & clnt_create errors
|
|
*/
|
|
RPC_UNKNOWNHOST = 13, /* unknown host name */
|
|
RPC_UNKNOWNPROTO = 17, /* unknown protocol */
|
|
RPC_UNKNOWNADDR = 19, /* Remote address unknown */
|
|
RPC_NOBROADCAST = 21, /* Broadcasting not supported */
|
|
|
|
/*
|
|
* rpcbind errors
|
|
*/
|
|
RPC_RPCBFAILURE = 14, /* the pmapper failed in its call */
|
|
#define RPC_PMAPFAILURE RPC_RPCBFAILURE
|
|
RPC_PROGNOTREGISTERED = 15, /* remote program is not registered */
|
|
RPC_N2AXLATEFAILURE = 22,
|
|
/* Name to address translation failed */
|
|
/*
|
|
* Misc error in the TLI library
|
|
*/
|
|
RPC_TLIERROR = 20,
|
|
/*
|
|
* unspecified error
|
|
*/
|
|
RPC_FAILED = 16,
|
|
/*
|
|
* asynchronous errors
|
|
*/
|
|
RPC_INPROGRESS = 24,
|
|
RPC_STALERACHANDLE = 25,
|
|
RPC_CANTCONNECT = 26, /* couldn't make connection (cots) */
|
|
RPC_XPRTFAILED = 27, /* received discon from remote (cots) */
|
|
RPC_CANTCREATESTREAM = 28 /* can't push rpc module (cots) */
|
|
};
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* !_RPC_CLNT_STAT_H */
|