]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/dccp/ccid.c
Documentation/email-clients.txt: add some info about gmail
[linux-2.6-omap-h63xx.git] / net / dccp / ccid.c
index ff05e59043cdb33769f810d16a8a667320d9e075..8fe931a3d7a1b1b7240a3421b7af0c404afae375 100644 (file)
@@ -40,6 +40,7 @@ static inline void ccids_write_unlock(void)
 static inline void ccids_read_lock(void)
 {
        atomic_inc(&ccids_lockct);
+       smp_mb__after_atomic_inc();
        spin_unlock_wait(&ccids_lock);
 }
 
@@ -55,9 +56,9 @@ static inline void ccids_read_unlock(void)
 #define ccids_read_unlock() do { } while(0)
 #endif
 
-static kmem_cache_t *ccid_kmem_cache_create(int obj_size, const char *fmt,...)
+static struct kmem_cache *ccid_kmem_cache_create(int obj_size, const char *fmt,...)
 {
-       kmem_cache_t *slab;
+       struct kmem_cache *slab;
        char slab_name_fmt[32], *slab_name;
        va_list args;
 
@@ -69,13 +70,13 @@ static kmem_cache_t *ccid_kmem_cache_create(int obj_size, const char *fmt,...)
        if (slab_name == NULL)
                return NULL;
        slab = kmem_cache_create(slab_name, sizeof(struct ccid) + obj_size, 0,
-                                SLAB_HWCACHE_ALIGN, NULL, NULL);
+                                SLAB_HWCACHE_ALIGN, NULL);
        if (slab == NULL)
                kfree(slab_name);
        return slab;
 }
 
-static void ccid_kmem_cache_destroy(kmem_cache_t *slab)
+static void ccid_kmem_cache_destroy(struct kmem_cache *slab)
 {
        if (slab != NULL) {
                const char *name = kmem_cache_name(slab);
@@ -91,15 +92,15 @@ int ccid_register(struct ccid_operations *ccid_ops)
 
        ccid_ops->ccid_hc_rx_slab =
                        ccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size,
-                                              "%s_hc_rx_sock",
-                                              ccid_ops->ccid_name);
+                                              "ccid%u_hc_rx_sock",
+                                              ccid_ops->ccid_id);
        if (ccid_ops->ccid_hc_rx_slab == NULL)
                goto out;
 
        ccid_ops->ccid_hc_tx_slab =
                        ccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size,
-                                              "%s_hc_tx_sock",
-                                              ccid_ops->ccid_name);
+                                              "ccid%u_hc_tx_sock",
+                                              ccid_ops->ccid_id);
        if (ccid_ops->ccid_hc_tx_slab == NULL)
                goto out_free_rx_slab;
 
@@ -153,7 +154,7 @@ struct ccid *ccid_new(unsigned char id, struct sock *sk, int rx, gfp_t gfp)
        struct ccid *ccid = NULL;
 
        ccids_read_lock();
-#ifdef CONFIG_KMOD
+#ifdef CONFIG_MODULES
        if (ccids[id] == NULL) {
                /* We only try to load if in process context */
                ccids_read_unlock();