diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-01-31 22:22:27 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-01-31 22:22:27 +0000 |
commit | 825423e4c4f18289df2393951cfd2a7a31fc0464 (patch) | |
tree | 4ad80e981c3d9effa910d2247d118d254f9a5d09 /net/unix | |
parent | c4693dc4856ab907a5c02187a8d398861bebfc7e (diff) |
Merge with Linux 2.4.1.
Diffstat (limited to 'net/unix')
-rw-r--r-- | net/unix/Makefile | 2 | ||||
-rw-r--r-- | net/unix/af_unix.c | 52 | ||||
-rw-r--r-- | net/unix/sysctl_net_unix.c | 22 |
3 files changed, 31 insertions, 45 deletions
diff --git a/net/unix/Makefile b/net/unix/Makefile index 88a262671..9a840afde 100644 --- a/net/unix/Makefile +++ b/net/unix/Makefile @@ -16,5 +16,3 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_unix.o include $(TOPDIR)/Rules.make -tar: - tar -cvf /dev/f1 . diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index e48b8549a..121e4d9de 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -1,5 +1,5 @@ /* - * NET3: Implementation of BSD Unix domain sockets. + * NET4: Implementation of BSD Unix domain sockets. * * Authors: Alan Cox, <alan.cox@linux.org> * @@ -8,7 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. * - * Version: $Id: af_unix.c,v 1.108 2000/11/10 04:02:04 davem Exp $ + * Version: $Id: af_unix.c,v 1.109 2001/01/06 00:42:23 davem Exp $ * * Fixes: * Linus Torvalds : Assorted bug cures. @@ -124,13 +124,12 @@ static atomic_t unix_nr_socks = ATOMIC_INIT(0); #define UNIX_ABSTRACT(sk) ((sk)->protinfo.af_unix.addr->hash!=UNIX_HASH_SIZE) /* - SMP locking strategy. - * hash table is protceted with rwlock unix_table_lock - * each socket state is protected by separate rwlock. - + * SMP locking strategy: + * hash table is protected with rwlock unix_table_lock + * each socket state is protected by separate rwlock. */ -extern __inline__ unsigned unix_hash_fold(unsigned hash) +static inline unsigned unix_hash_fold(unsigned hash) { hash ^= hash>>16; hash ^= hash>>8; @@ -139,17 +138,17 @@ extern __inline__ unsigned unix_hash_fold(unsigned hash) #define unix_peer(sk) ((sk)->pair) -extern __inline__ int unix_our_peer(unix_socket *sk, unix_socket *osk) +static inline int unix_our_peer(unix_socket *sk, unix_socket *osk) { return unix_peer(osk) == sk; } -extern __inline__ int unix_may_send(unix_socket *sk, unix_socket *osk) +static inline int unix_may_send(unix_socket *sk, unix_socket *osk) { return (unix_peer(osk) == NULL || unix_our_peer(sk, osk)); } -static __inline__ unix_socket * unix_peer_get(unix_socket *s) +static inline unix_socket * unix_peer_get(unix_socket *s) { unix_socket *peer; @@ -161,7 +160,7 @@ static __inline__ unix_socket * unix_peer_get(unix_socket *s) return peer; } -extern __inline__ void unix_release_addr(struct unix_address *addr) +extern inline void unix_release_addr(struct unix_address *addr) { if (atomic_dec_and_test(&addr->refcnt)) kfree(addr); @@ -231,14 +230,14 @@ static void __unix_insert_socket(unix_socket **list, unix_socket *sk) sock_hold(sk); } -static __inline__ void unix_remove_socket(unix_socket *sk) +static inline void unix_remove_socket(unix_socket *sk) { write_lock(&unix_table_lock); __unix_remove_socket(sk); write_unlock(&unix_table_lock); } -static __inline__ void unix_insert_socket(unix_socket **list, unix_socket *sk) +static inline void unix_insert_socket(unix_socket **list, unix_socket *sk) { write_lock(&unix_table_lock); __unix_insert_socket(list, sk); @@ -258,7 +257,7 @@ static unix_socket *__unix_find_socket_byname(struct sockaddr_un *sunname, return NULL; } -static __inline__ unix_socket * +static inline unix_socket * unix_find_socket_byname(struct sockaddr_un *sunname, int len, int type, unsigned hash) { @@ -291,7 +290,7 @@ static unix_socket *unix_find_socket_byinode(struct inode *i) return s; } -static __inline__ int unix_writable(struct sock *sk) +static inline int unix_writable(struct sock *sk) { return ((atomic_read(&sk->wmem_alloc)<<2) <= sk->sndbuf); } @@ -1823,7 +1822,7 @@ struct proto_ops unix_stream_ops = { struct proto_ops unix_dgram_ops = { family: PF_UNIX, - + release: unix_release, bind: unix_bind, connect: unix_dgram_connect, @@ -1842,20 +1841,25 @@ struct proto_ops unix_dgram_ops = { }; struct net_proto_family unix_family_ops = { - PF_UNIX, - unix_create + family: PF_UNIX, + create: unix_create }; #ifdef CONFIG_SYSCTL extern void unix_sysctl_register(void); extern void unix_sysctl_unregister(void); +#else +static inline unix_sysctl_register() {}; +static inline unix_sysctl_unregister() {}; #endif +static const char banner[] __initdata = KERN_INFO "NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.\n"; + static int __init af_unix_init(void) { struct sk_buff *dummy_skb; - - printk(KERN_INFO "NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.\n"); + + printk(banner); if (sizeof(struct unix_skb_parms) > sizeof(dummy_skb->cb)) { printk(KERN_CRIT "unix_proto_init: panic\n"); @@ -1865,23 +1869,15 @@ static int __init af_unix_init(void) #ifdef CONFIG_PROC_FS create_proc_read_entry("net/unix", 0, 0, unix_read_proc, NULL); #endif - -#ifdef CONFIG_SYSCTL unix_sysctl_register(); -#endif - return 0; } static void __exit af_unix_exit(void) { sock_unregister(PF_UNIX); -#ifdef CONFIG_SYSCTL unix_sysctl_unregister(); -#endif -#ifdef CONFIG_PROC_FS remove_proc_entry("net/unix", 0); -#endif } module_init(af_unix_init); diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c index 885119da3..eceea5c95 100644 --- a/net/unix/sysctl_net_unix.c +++ b/net/unix/sysctl_net_unix.c @@ -1,10 +1,8 @@ /* - * NET3: Sysctl interface to net af_unix subsystem. + * NET4: Sysctl interface to net af_unix subsystem. * * Authors: Mike Shaver. * - * Added /proc/sys/net/unix directory entry (empty =) ). - * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -13,9 +11,6 @@ #include <linux/mm.h> #include <linux/sysctl.h> -#include <linux/config.h> - -#ifdef CONFIG_SYSCTL extern int sysctl_unix_max_dgram_qlen; @@ -26,20 +21,18 @@ ctl_table unix_table[] = { {0} }; -static struct ctl_table_header * unix_sysctl_header; -static struct ctl_table unix_root_table[]; -static struct ctl_table unix_net_table[]; - -ctl_table unix_root_table[] = { - {CTL_NET, "net", NULL, 0, 0555, unix_net_table}, +static ctl_table unix_net_table[] = { + {NET_UNIX, "unix", NULL, 0, 0555, unix_table}, {0} }; -ctl_table unix_net_table[] = { - {NET_UNIX, "unix", NULL, 0, 0555, unix_table}, +static ctl_table unix_root_table[] = { + {CTL_NET, "net", NULL, 0, 0555, unix_net_table}, {0} }; +static struct ctl_table_header * unix_sysctl_header; + void unix_sysctl_register(void) { unix_sysctl_header = register_sysctl_table(unix_root_table, 0); @@ -50,4 +43,3 @@ void unix_sysctl_unregister(void) unregister_sysctl_table(unix_sysctl_header); } -#endif /* CONFIG_SYSCTL */ |