[PATCH] uml: add locking to network transport registration

The registration of host network transports needed some locking.  The
transport list itself is locked, but calls to the registration routines are
not.  This is compensated for by checking that a transport structure is not
yet on any list.

I also took the opportunity to const all fields in the transport structure
except the list, which obviously can be modified.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Jeff Dike
2007-02-10 01:43:56 -08:00
committed by Linus Torvalds
parent 190c3e4563
commit d3b7f69de2
2 changed files with 9 additions and 8 deletions

View File

@@ -52,12 +52,12 @@ struct net_kern_info {
struct transport {
struct list_head list;
char *name;
int (*setup)(char *, char **, void *);
const char *name;
int (* const setup)(char *, char **, void *);
const struct net_user_info *user;
const struct net_kern_info *kern;
int private_size;
int setup_size;
const int private_size;
const int setup_size;
};
extern struct net_device *ether_init(int);