--- v2.6.18-rc2-mm1~ori/net/bluetooth/af_bluetooth.c 2006-07-27 11:46:12.000000000 +0200 +++ v2.6.18-rc2-mm1/net/bluetooth/af_bluetooth.c 2006-07-28 16:22:50.000000000 +0200 @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -54,7 +55,7 @@ /* Bluetooth sockets */ #define BT_MAX_PROTO 8 static struct net_proto_family *bt_proto[BT_MAX_PROTO]; -static DEFINE_RWLOCK(bt_proto_rwlock); +static DEFINE_LW_RWLOCK(bt_proto_rwlock); int bt_sock_register(int proto, struct net_proto_family *ops) { @@ -65,12 +66,12 @@ int bt_sock_register(int proto, struct n err = -EEXIST; - write_lock(&bt_proto_rwlock); + lw_write_lock(&bt_proto_rwlock); if (bt_proto[proto] == NULL) { err = 0; bt_proto[proto] = ops; } - write_unlock(&bt_proto_rwlock); + lw_write_unlock(&bt_proto_rwlock); return err; } @@ -84,12 +85,12 @@ int bt_sock_unregister(int proto) return -EINVAL; err = -ENOENT; - write_lock(&bt_proto_rwlock); + lw_write_lock(&bt_proto_rwlock); if (bt_proto[proto]) { err = 0; bt_proto[proto] = NULL; } - write_unlock(&bt_proto_rwlock); + lw_write_unlock(&bt_proto_rwlock); return err; } @@ -108,12 +109,12 @@ static int bt_sock_create(struct socket } #endif err = -EPROTONOSUPPORT; - read_lock(&bt_proto_rwlock); + lw_read_lock(&bt_proto_rwlock); if (bt_proto[proto] && try_module_get(bt_proto[proto]->owner)) { err = bt_proto[proto]->create(sock, proto); module_put(bt_proto[proto]->owner); } - read_unlock(&bt_proto_rwlock); + lw_read_unlock(&bt_proto_rwlock); return err; }