From: Andy P. <at...@us...> - 2002-04-09 12:44:31
|
Update of /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc In directory usw-pr-cvs1:/tmp/cvs-serv17906/linux/sunrpc Modified Files: auth.h clnt.h sched.h stats.h types.h xdr.h xprt.h Log Message: sync 2.4.15 commit 3 Index: auth.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/auth.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- auth.h 14 Jan 2001 16:48:27 -0000 1.1.1.1 +++ auth.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -14,6 +14,8 @@ #include <linux/config.h> #include <linux/sunrpc/sched.h> +#include <asm/atomic.h> + /* size of the nodename buffer */ #define UNX_MAXNODENAME 32 @@ -22,8 +24,10 @@ */ struct rpc_cred { struct rpc_cred * cr_next; /* linked list */ + struct rpc_auth * cr_auth; + struct rpc_credops * cr_ops; unsigned long cr_expire; /* when to gc */ - unsigned short cr_count; /* ref count */ + atomic_t cr_count; /* ref count */ unsigned short cr_flags; /* various flags */ #ifdef RPC_DEBUG unsigned long cr_magic; /* 0x0f4aa4f0 */ @@ -71,6 +75,9 @@ void (*destroy)(struct rpc_auth *); struct rpc_cred * (*crcreate)(int); +}; + +struct rpc_credops { void (*crdestroy)(struct rpc_cred *); int (*crmatch)(struct rpc_cred *, int); @@ -92,8 +99,7 @@ struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); struct rpc_cred * rpcauth_bindcred(struct rpc_task *); void rpcauth_holdcred(struct rpc_task *); -void rpcauth_releasecred(struct rpc_auth *, - struct rpc_cred *); +void put_rpccred(struct rpc_cred *); void rpcauth_unbindcred(struct rpc_task *); int rpcauth_matchcred(struct rpc_auth *, struct rpc_cred *, int); @@ -106,6 +112,13 @@ void rpcauth_free_credcache(struct rpc_auth *); void rpcauth_insert_credcache(struct rpc_auth *, struct rpc_cred *); + +static inline +struct rpc_cred * get_rpccred(struct rpc_cred *cred) +{ + atomic_inc(&cred->cr_count); + return cred; +} #endif /* __KERNEL__ */ #endif /* _LINUX_SUNRPC_AUTH_H */ Index: clnt.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/clnt.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- clnt.h 14 Jan 2001 16:48:28 -0000 1.1.1.1 +++ clnt.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -130,7 +130,7 @@ } -extern __inline__ void +static __inline__ void rpc_set_timeout(struct rpc_clnt *clnt, unsigned int retr, unsigned long incr) { xprt_set_timeout(&clnt->cl_timeout, retr, incr); Index: sched.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/sched.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- sched.h 14 Jan 2001 16:48:29 -0000 1.1.1.1 +++ sched.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -80,7 +80,7 @@ unsigned short tk_lock; /* Task lock counter */ unsigned char tk_active : 1,/* Task has been activated */ tk_wakeup : 1;/* Task waiting to wake up */ - unsigned int tk_runstate; /* Task run status */ + unsigned long tk_runstate; /* Task run status */ #ifdef RPC_DEBUG unsigned short tk_pid; /* debugging aid */ #endif @@ -180,13 +180,13 @@ void rpc_show_tasks(void); #endif -extern __inline__ void * +static __inline__ void * rpc_malloc(struct rpc_task *task, unsigned int size) { return rpc_allocate(task->tk_flags, size); } -extern __inline__ void +static __inline__ void rpc_exit(struct rpc_task *task, int status) { task->tk_status = status; @@ -194,7 +194,7 @@ } #ifdef RPC_DEBUG -extern __inline__ char * +static __inline__ char * rpc_qname(struct rpc_wait_queue *q) { return q->name? q->name : "unknown"; Index: stats.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/stats.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- stats.h 14 Jan 2001 16:48:28 -0000 1.1.1.1 +++ stats.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -59,13 +59,13 @@ #else -extern inline void svc_proc_unregister(const char *p) {} -extern inline struct proc_dir_entry*svc_proc_register(struct svc_stat *s) +static inline void svc_proc_unregister(const char *p) {} +static inline struct proc_dir_entry*svc_proc_register(struct svc_stat *s) { return NULL; } -extern inline int svc_proc_read(char *a, char **b, off_t c, int d, int *e, void *f) +static inline int svc_proc_read(char *a, char **b, off_t c, int d, int *e, void *f) { return 0; } Index: types.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/types.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- types.h 14 Jan 2001 16:48:31 -0000 1.1.1.1 +++ types.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -21,7 +21,7 @@ struct rpc_listitem * next; }; -extern __inline__ void +static __inline__ void __rpc_append_list(struct rpc_listitem **q, struct rpc_listitem *item) { struct rpc_listitem *next, *prev; @@ -37,14 +37,14 @@ } } -extern __inline__ void +static __inline__ void __rpc_insert_list(struct rpc_listitem **q, struct rpc_listitem *item) { __rpc_append_list(q, item); *q = item; } -extern __inline__ void +static __inline__ void __rpc_remove_list(struct rpc_listitem **q, struct rpc_listitem *item) { struct rpc_listitem *prev = item->prev, Index: xdr.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/xdr.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- xdr.h 14 Jan 2001 16:48:31 -0000 1.1.1.1 +++ xdr.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -34,27 +34,27 @@ typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); /* - * These variables contain pre-xdr'ed values for faster operation. - * FIXME: should be replaced by macros for big-endian machines. + * pre-xdr'ed macros. */ -extern u32 xdr_zero, xdr_one, xdr_two; -extern u32 rpc_success, - rpc_prog_unavail, - rpc_prog_mismatch, - rpc_proc_unavail, - rpc_garbage_args, - rpc_system_err; +#define xdr_zero __constant_htonl(0) +#define xdr_one __constant_htonl(1) +#define xdr_two __constant_htonl(2) -extern u32 rpc_auth_ok, - rpc_autherr_badcred, - rpc_autherr_rejectedcred, - rpc_autherr_badverf, - rpc_autherr_rejectedverf, - rpc_autherr_tooweak, - rpc_autherr_dropit; +#define rpc_success __constant_htonl(RPC_SUCCESS) +#define rpc_prog_unavail __constant_htonl(RPC_PROG_UNAVAIL) +#define rpc_prog_mismatch __constant_htonl(RPC_PROG_MISMATCH) +#define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) +#define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) +#define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) + +#define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) +#define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) +#define rpc_autherr_rejectedcred __constant_htonl(RPC_AUTH_REJECTEDCRED) +#define rpc_autherr_badverf __constant_htonl(RPC_AUTH_BADVERF) +#define rpc_autherr_rejectedverf __constant_htonl(RPC_AUTH_REJECTEDVERF) +#define rpc_autherr_tooweak __constant_htonl(RPC_AUTH_TOOWEAK) -void xdr_init(void); /* * Miscellaneous XDR helper functions @@ -62,6 +62,7 @@ u32 * xdr_encode_array(u32 *p, const char *s, unsigned int len); u32 * xdr_encode_string(u32 *p, const char *s); u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen); +u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); u32 * xdr_decode_netobj_fixed(u32 *p, void *obj, unsigned int len); Index: xprt.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/include/linux/sunrpc/xprt.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- xprt.h 14 Jan 2001 16:48:32 -0000 1.1.1.1 +++ xprt.h 9 Apr 2002 12:44:17 -0000 1.2 @@ -135,15 +135,13 @@ struct rpc_wait_queue sending; /* requests waiting to send */ struct rpc_wait_queue pending; /* requests in flight */ struct rpc_wait_queue backlog; /* waiting for slot */ - struct rpc_wait_queue reconn; /* waiting for reconnect */ struct rpc_rqst * free; /* free slots */ struct rpc_rqst slot[RPC_MAXREQS]; - unsigned int sockstate; /* Socket state */ + unsigned long sockstate; /* Socket state */ unsigned char shutdown : 1, /* being shut down */ nocong : 1, /* no congestion control */ stream : 1, /* TCP */ - tcp_more : 1, /* more record fragments */ - connecting : 1; /* being reconnected */ + tcp_more : 1; /* more record fragments */ /* * State of TCP reply receive stuff @@ -158,6 +156,8 @@ /* * Send stuff */ + spinlock_t sock_lock; /* lock socket info */ + spinlock_t xprt_lock; /* lock xprt info */ struct rpc_task * snd_task; /* Task blocked in send */ @@ -185,10 +185,9 @@ void xprt_release(struct rpc_task *); void xprt_reconnect(struct rpc_task *); int xprt_clear_backlog(struct rpc_xprt *); +int xprt_tcp_pending(void); void __rpciod_tcp_dispatcher(void); -extern struct list_head rpc_xprt_pending; - #define XPRT_WSPACE 0 #define XPRT_CONNECT 1 @@ -200,12 +199,6 @@ #define xprt_set_connected(xp) (set_bit(XPRT_CONNECT, &(xp)->sockstate)) #define xprt_test_and_set_connected(xp) (test_and_set_bit(XPRT_CONNECT, &(xp)->sockstate)) #define xprt_clear_connected(xp) (clear_bit(XPRT_CONNECT, &(xp)->sockstate)) - -static inline -int xprt_tcp_pending(void) -{ - return !list_empty(&rpc_xprt_pending); -} static inline void rpciod_tcp_dispatcher(void) |