summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNeil Brown <neilb@cse.unsw.edu.au>2002-02-25 22:23:32 -0800
committerLinus Torvalds <torvalds@penguin.transmeta.com>2002-02-25 22:23:32 -0800
commit294d77d98b929017f6d8e3929c58ccfa189e44d7 (patch)
treef68e133085e1b4c3f43650f6c85f4d9219902c60 /include
parent2b063bda0bde669f5a71927bba5af4c3a4538129 (diff)
[PATCH] PATCH 10/16: NFSD: TCP: rationalise locking in RPC server routines
Tidy up SMP locking for svc_sock sk_lock is not necessary and is now removed. The only things that were happening under sk_lock but not the more global sv_lock were testing and setting some of the flags: sk_busy, sk_conn, sk_data etc. These have been changed to bits in a flags word which are atomically set and tested. Also, by establishing some simple rules about that must be done after setting these flags, the locking is not needed. With this patch sk_conn and sk_data are now flags, not counts (sk_data was already a flag for udp). They are set if there might be a connection or data, and only clear when we are sure there aren't (or when we are about to check if there is). svc_sock_accepted becomes identical to svc_sock_recieved and so is discarded in favour of the latter. sk_rqstp was never used and is now gone.
Diffstat (limited to 'include')
-rw-r--r--include/linux/sunrpc/svcsock.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 0c565502e272..e4bdc96ab6d8 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -19,17 +19,18 @@ struct svc_sock {
struct list_head sk_list; /* list of all sockets */
struct socket * sk_sock; /* berkeley socket layer */
struct sock * sk_sk; /* INET layer */
- spinlock_t sk_lock;
struct svc_serv * sk_server; /* service for this socket */
unsigned char sk_inuse; /* use count */
- unsigned char sk_busy; /* enqueued/receiving */
- unsigned char sk_conn; /* conn pending */
- unsigned char sk_close; /* dead or dying */
- int sk_data; /* data pending */
- unsigned int sk_temp : 1, /* temp socket */
- sk_qued : 1, /* on serv->sk_sockets */
- sk_dead : 1; /* socket closed */
+ unsigned int sk_flags;
+#define SK_BUSY 0 /* enqueued/receiving */
+#define SK_CONN 1 /* conn pending */
+#define SK_CLOSE 2 /* dead or dying */
+#define SK_DATA 3 /* data pending */
+#define SK_TEMP 4 /* temp (TCP) socket */
+#define SK_QUED 5 /* on serv->sk_sockets */
+#define SK_DEAD 6 /* socket closed */
+
int (*sk_recvfrom)(struct svc_rqst *rqstp);
int (*sk_sendto)(struct svc_rqst *rqstp);
@@ -40,9 +41,6 @@ struct svc_sock {
/* private TCP part */
int sk_reclen; /* length of record */
int sk_tcplen; /* current read length */
-
- /* Debugging */
- struct svc_rqst * sk_rqstp;
};
/*