summaryrefslogtreecommitdiff
path: root/include/linux/sunrpc/auth.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:10:26 -0800
committerLinus Torvalds <torvalds@athlon.transmeta.com>2002-02-04 20:10:26 -0800
commitbb5b6e6c4dea4242f6ff75fa7adecea4f34935f1 (patch)
treedbdda6fdd7f0bfadb4c10a997bfb15660f3223c0 /include/linux/sunrpc/auth.h
parent0b9ded43ee424791d9283cee2a33dcb4a97da57d (diff)
v2.4.8.4 -> v2.4.9
- David Miller: sparc updates, FAT fs fixes, btaudio build fix - David Gibson: Orinoco driver update - Kevin Fleming: more disks the HPT controller doesn't like - David Miller: "min()/max()" cleanups. Understands signs and sizes. - Ben LaHaise: make vma merging more generous, help Mozilla /proc/<>/maps - Jens Axboe: CD updates - Trond Myklebust: save away NFS credentials in inode, so that mmap can writeout. - Mark Hemment: HIGHMEM ops cleanups - Jes Sorensen: use "unsigned long" for flags in various drivers
Diffstat (limited to 'include/linux/sunrpc/auth.h')
-rw-r--r--include/linux/sunrpc/auth.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index d66474b60c42..9ea631ace800 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -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 @@ struct rpc_authops {
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 @@ void rpcauth_destroy(struct rpc_auth *);
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);
@@ -107,5 +113,12 @@ 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 */