[SSI] openssi/kernel/include/cluster/ssi/ipc unixnm.h,1.18,1.19

Roger Tsang <[email protected]> Sun, 08 Aug 2010 02:28:04 +0000
Newsgroups gmane.linux.cluster.ssic.cvs
Message-ID <[email protected]>
Update of /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/ipc
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv3491/include/cluster/ssi/ipc

Modified Files:
      Tag: OPENSSI-FC
	unixnm.h 
Log Message:
IPC:
- Move rmtunix_make_info(), rmtunix_cache_lookup(), and rmtunix_decache_info() into cluster/ssi/ipc/rmtunix.c

 cluster/ssi/ipc/rmtunix.c        |   91 ++++++++
 include/cluster/ssi/ipc/unixnm.h |   97 --------


Index: unixnm.h
===================================================================
RCS file: /cvsroot/ssic-linux/openssi/kernel/include/cluster/ssi/ipc/unixnm.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- unixnm.h	5 Mar 2010 06:20:46 -0000	1.18
+++ unixnm.h	8 Aug 2010 02:28:02 -0000	1.19
@@ -67,10 +67,7 @@
 #ifdef RCU_RMTUNIX_CACHE
 extern void rmtunix_dealloc(struct rmtunix_socket_info *);
 #endif
-
-#ifdef RMTUNIX_SOCK_INFO_CACHE
-extern kmem_cache_t *rmtunix_socket_info_cachep;
-#endif
+extern struct rmtunix_socket_info *rmtunix_make_info(void);
 
 /*
  * Function prototypes
@@ -172,37 +169,6 @@
 	spin_unlock(&rmtunix_cache_listlock);
 }
 
-static inline struct rmtunix_socket_info *
-rmtunix_cache_lookup(unix_socket *s)
-{
-#ifdef RCU_RMTUNIX_CACHE
-	struct rmtunix_socket_info *info;
-	char found = 0;
-
-	rcu_read_lock();
-	list_for_each_entry_rcu(info, &rmtunix_cache_list, list) {
-		if (info->sk != s)
-			continue;
-		if (atomic_test_and_add(1, &info->rsk_refcnt))
-			found = 1;
-		break;
-	}
-	rcu_read_unlock();
-	return found ? info : NULL;
-#else /* RCU_RMTUNIX_CACHE */
-	struct list_head *cur;
-
-	/* Caller must hold rmtunix_cache_listlock */
-	list_for_each(cur, &rmtunix_cache_list) {
-		struct rmtunix_socket_info *tmp = list_entry(cur,
-				struct rmtunix_socket_info, list);
-		if (tmp->sk == s)
-			return tmp;
-	}
-	return NULL;
-#endif /* !RCU_RMTUNIX_CACHE */
-}
-
 static inline void
 __rmtunix_decache_info(struct rmtunix_socket_info *info)
 {
@@ -235,42 +201,6 @@
 #endif /* !RCU_RMTUNIX_CACHE */
 }
 
-static inline void
-rmtunix_decache_info(unix_socket *s)
-{
-	struct rmtunix_socket_info *info =
-			(struct rmtunix_socket_info *)(unix_peer(s));
-#ifndef RCU_RMTUNIX_CACHE
-	int orphan = 0;
-
-	spin_lock(&rmtunix_cache_listlock);
-	if (!info) {
-		orphan = 1;
-#else
-	if (!info) {
-#endif
-		info = rmtunix_cache_lookup(s);
-#ifdef IPC_STALE_RMTUNIX_CACHE_FIX
-		if (!info)
-			return;
-		/* SSI_XXX: expect orphans? */
-		printk(KERN_DEBUG "%s: orphan rmtunix socket info found.\n",
-				__FUNCTION__);
-#else
-		SSI_ASSERT(info);
-#endif
-	}
-
-	(void) __rmtunix_decache_info(info);
-
-#ifndef RCU_RMTUNIX_CACHE
-	if (orphan) {
-		info->magic = 0;
-		kfree(info);
-	}
-#endif
-}
-
 #ifndef IPC_STALE_RMTUNIX_CACHE_FIX
 static inline int
 rmtunix_iscached(unix_socket *s)
@@ -279,31 +209,6 @@
 }
 #endif
 
-static inline struct rmtunix_socket_info *
-rmtunix_make_info(void)
-{
-	struct rmtunix_socket_info *info;
-
-#ifdef RMTUNIX_SOCK_INFO_CACHE
-	info = kmem_cache_alloc(rmtunix_socket_info_cachep, SLAB_USER);
-	memset(info, 0, sizeof(*info));
-#else
-	info = kzmalloc(sizeof(*info), GFP_USER);
-#endif
-	if (!info)
-		goto out;
-
-#ifdef IPC_STALE_RMTUNIX_CACHE_FIX
-	INIT_LIST_HEAD(&info->list);
-	atomic_set(&info->rsk_refcnt, 1);
-#endif
-#ifdef RCU_RMTUNIX_CACHE
-	INIT_RCU_HEAD(&info->rhead);
-#endif
-out:
-	return info;
-}
-
 static inline u_long
 rmtunix_sk2ino(unix_socket *sk)
 {


------------------------------------------------------------------------------
This SF.net email is sponsored by 

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev