From: Greg Banks <gnb@sgi.com>
To: Tom Tucker <tom@opengridcomputing.com>
Cc: Linux NFS Mailing List <nfs@lists.sourceforge.net>,
Thomas Talpey <Thomas.Talpey@netapp.com>,
Peter Leckie <pleckie@melbourne.sgi.com>
Subject: [RFC,PATCH 6/14] knfsd: add svc_sock_is_connection
Date: Thu, 17 May 2007 05:23:40 +1000 [thread overview]
Message-ID: <20070516192340.GL9626@sgi.com> (raw)
Add a svc_sock_is_connection() predicate to test whether a struct
svc_sock is a connected socket (currently this means TCP). Also, fix
ip_map_cached_put() to detect whether the svc_sock is a connection
using the new predicate, instead of reaching into the svc_sock's
socket, because later the NFS/RDMA transport will not have a socket.
Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Peter Leckie <pleckie@melbourne.sgi.com>
---
include/linux/sunrpc/svcsock.h | 5 +++++
net/sunrpc/svcauth_unix.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
Index: linux/include/linux/sunrpc/svcsock.h
===================================================================
--- linux.orig/include/linux/sunrpc/svcsock.h 2007-05-17 01:28:41.131377156 +1000
+++ linux/include/linux/sunrpc/svcsock.h 2007-05-17 01:58:40.829117616 +1000
@@ -95,6 +95,11 @@ struct svc_sock {
int sk_remotelen; /* length of address */
};
+static inline int svc_sock_is_connection(struct svc_sock *svsk)
+{
+ return (test_bit(SK_TEMP, &svsk->sk_flags));
+}
+
/*
* Function prototypes.
*/
Index: linux/net/sunrpc/svcauth_unix.c
===================================================================
--- linux.orig/net/sunrpc/svcauth_unix.c 2007-04-26 13:08:32.000000000 +1000
+++ linux/net/sunrpc/svcauth_unix.c 2007-05-17 01:58:40.865112934 +1000
@@ -411,7 +411,7 @@ ip_map_cached_put(struct svc_rqst *rqstp
struct svc_sock *svsk = rqstp->rq_sock;
spin_lock_bh(&svsk->sk_defer_lock);
- if (svsk->sk_sock->type == SOCK_STREAM &&
+ if (svc_sock_is_connection(svsk) &&
svsk->sk_info_authunix == NULL) {
/* newly cached, keep the reference */
svsk->sk_info_authunix = ipm;
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
Apparently, I'm Bedevere. Which MPHG character are you?
I don't speak for SGI.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next reply other threads:[~2007-05-16 19:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-16 19:23 Greg Banks [this message]
2007-05-17 10:43 ` [RFC,PATCH 6/14] knfsd: add svc_sock_is_connection Neil Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070516192340.GL9626@sgi.com \
--to=gnb@sgi.com \
--cc=Thomas.Talpey@netapp.com \
--cc=nfs@lists.sourceforge.net \
--cc=pleckie@melbourne.sgi.com \
--cc=tom@opengridcomputing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox