diff for duplicates of <20081221003239.GA5700@ghostprotocols.net> diff --git a/a/1.txt b/N1/1.txt index b65c30d..15fdc83 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -124,10 +124,11 @@ Em Sat, Dec 20, 2008 at 09:08:13AM +0100, Gerrit Renker escreveu: > { > - int err = -ENOBUFS; > - -> ccid_ops->ccid_hc_rx_slab > ccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size, +> ccid_ops->ccid_hc_rx_slab = +> ccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size, > "ccid%u_hc_rx_sock", > ccid_ops->ccid_id); -> if (ccid_ops->ccid_hc_rx_slab = NULL) +> if (ccid_ops->ccid_hc_rx_slab == NULL) > - goto out; > + return -ENOBUFS; @@ -135,10 +136,11 @@ You could have maintained the gotos, that way the patch would be smaller... > -> ccid_ops->ccid_hc_tx_slab > ccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size, +> ccid_ops->ccid_hc_tx_slab = +> ccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size, > "ccid%u_hc_tx_sock", > ccid_ops->ccid_id); -> - if (ccid_ops->ccid_hc_tx_slab = NULL) +> - if (ccid_ops->ccid_hc_tx_slab == NULL) > - goto out_free_rx_slab; > > - ccids_write_lock(); @@ -147,10 +149,10 @@ I.e. we would see that in the end what you did here was just to remove the locking. > - err = -EEXIST; -> - if (ccids[ccid_ops->ccid_id] = NULL) { +> - if (ccids[ccid_ops->ccid_id] == NULL) { > - ccids[ccid_ops->ccid_id] = ccid_ops; > - err = 0; -> + if (ccid_ops->ccid_hc_tx_slab = NULL) { +> + if (ccid_ops->ccid_hc_tx_slab == NULL) { > + ccid_kmem_cache_destroy(ccid_ops->ccid_hc_rx_slab); > + ccid_ops->ccid_hc_rx_slab = NULL; > + return -ENOBUFS; @@ -226,7 +228,7 @@ registration being done, just allocating/deallocating resources > + int i; > + > + for (i = 0; i < ARRAY_SIZE(ccids); i++) -> + if (ccids[i]->ccid_id = id) +> + if (ccids[i]->ccid_id == id) > + return ccids[i]; > + return NULL; @@ -247,12 +249,12 @@ Why the we searching? Can't we just do: > + struct ccid_operations *ccid_ops = ccid_find_by_id(id); > + struct ccid *ccid; > + -> + if (ccid_ops = NULL) +> + if (ccid_ops == NULL) > + return NULL; > + > + ccid = kmem_cache_alloc(rx ? ccid_ops->ccid_hc_rx_slab : > + ccid_ops->ccid_hc_tx_slab, gfp_any()); -> if (ccid = NULL) +> if (ccid == NULL) > return NULL; > > @@ -241,58 +189,14 @@ static struct ccid *__ccid_new(struct cc @@ -272,7 +274,7 @@ Why the we searching? Can't we just do: > -{ > - int i; > - for (i = 0; i < ARRAY_SIZE(builtin_ccids); i++) -> - if (id = builtin_ccids[i]) +> - if (id == builtin_ccids[i]) > - return true; > - return false; > -} @@ -284,13 +286,13 @@ Why the we searching? Can't we just do: > - > - if (is_builtin_ccid(id)) { > - ccid_ops = ccids[id]; -> - BUG_ON(ccid_ops = NULL); +> - BUG_ON(ccid_ops == NULL); > - return __ccid_new(ccid_ops, sk, rx, gfp); > - } > - > - ccids_read_lock(); > -#ifdef CONFIG_MODULES -> - if (ccids[id] = NULL) { +> - if (ccids[id] == NULL) { > - /* We only try to load if in process context */ > - ccids_read_unlock(); > - if (gfp & GFP_ATOMIC) @@ -300,7 +302,7 @@ Why the we searching? Can't we just do: > - } > -#endif > - ccid_ops = ccids[id]; -> - if (ccid_ops = NULL) +> - if (ccid_ops == NULL) > - goto out_unlock; > - > - ccids_read_unlock(); @@ -325,5 +327,5 @@ Why the we searching? Can't we just do: > - struct ccid *new_ccid = ccid_new(ccid, sk, rx, gfp_any()); > + struct ccid *new_ccid = ccid_new(ccid, sk, rx); > -> if (new_ccid = NULL) +> if (new_ccid == NULL) > return -ENOMEM; diff --git a/a/content_digest b/N1/content_digest index 83d434b..c239a48 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -1,8 +1,14 @@ + "ref\020081218053349.GA6172@gerrit.erg.abdn.ac.uk\0" + "ref\020081218.191534.194793981.davem@davemloft.net\0" + "ref\020081219052446.GA3651@gerrit.erg.abdn.ac.uk\0" + "ref\020081218.222842.174783235.davem@davemloft.net\0" "ref\020081220080813.GC3853@gerrit.erg.abdn.ac.uk\0" "From\0Arnaldo Carvalho de Melo <acme@redhat.com>\0" "Subject\0Re: [RFC] [Patch 2/4] dccp: Lockless use of CCID blocks\0" - "Date\0Sun, 21 Dec 2008 00:32:39 +0000\0" - "To\0dccp@vger.kernel.org\0" + "Date\0Sat, 20 Dec 2008 22:32:39 -0200\0" + "To\0Gerrit Renker <gerrit@erg.abdn.ac.uk>\0" + "Cc\0dccp@vger.kernel.org" + " netdev@vger.kernel.org\0" "\00:1\0" "b\0" "Em Sat, Dec 20, 2008 at 09:08:13AM +0100, Gerrit Renker escreveu:\n" @@ -131,10 +137,11 @@ "> {\n" "> -\tint err = -ENOBUFS;\n" "> -\n" - "> \tccid_ops->ccid_hc_rx_slab > \t\t\tccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size,\n" + "> \tccid_ops->ccid_hc_rx_slab =\n" + "> \t\t\tccid_kmem_cache_create(ccid_ops->ccid_hc_rx_obj_size,\n" "> \t\t\t\t\t \"ccid%u_hc_rx_sock\",\n" "> \t\t\t\t\t ccid_ops->ccid_id);\n" - "> \tif (ccid_ops->ccid_hc_rx_slab = NULL)\n" + "> \tif (ccid_ops->ccid_hc_rx_slab == NULL)\n" "> -\t\tgoto out;\n" "> +\t\treturn -ENOBUFS;\n" "\n" @@ -142,10 +149,11 @@ "smaller...\n" "\n" "> \n" - "> \tccid_ops->ccid_hc_tx_slab > \t\t\tccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size,\n" + "> \tccid_ops->ccid_hc_tx_slab =\n" + "> \t\t\tccid_kmem_cache_create(ccid_ops->ccid_hc_tx_obj_size,\n" "> \t\t\t\t\t \"ccid%u_hc_tx_sock\",\n" "> \t\t\t\t\t ccid_ops->ccid_id);\n" - "> -\tif (ccid_ops->ccid_hc_tx_slab = NULL)\n" + "> -\tif (ccid_ops->ccid_hc_tx_slab == NULL)\n" "> -\t\tgoto out_free_rx_slab;\n" "> \n" "> -\tccids_write_lock();\n" @@ -154,10 +162,10 @@ "the locking.\n" "\n" "> -\terr = -EEXIST;\n" - "> -\tif (ccids[ccid_ops->ccid_id] = NULL) {\n" + "> -\tif (ccids[ccid_ops->ccid_id] == NULL) {\n" "> -\t\tccids[ccid_ops->ccid_id] = ccid_ops;\n" "> -\t\terr = 0;\n" - "> +\tif (ccid_ops->ccid_hc_tx_slab = NULL) {\n" + "> +\tif (ccid_ops->ccid_hc_tx_slab == NULL) {\n" "> +\t\tccid_kmem_cache_destroy(ccid_ops->ccid_hc_rx_slab);\n" "> +\t\tccid_ops->ccid_hc_rx_slab = NULL;\n" "> +\t\treturn -ENOBUFS;\n" @@ -233,7 +241,7 @@ "> +\tint i;\n" "> +\n" "> +\tfor (i = 0; i < ARRAY_SIZE(ccids); i++)\n" - "> +\t\tif (ccids[i]->ccid_id = id)\n" + "> +\t\tif (ccids[i]->ccid_id == id)\n" "> +\t\t\treturn ccids[i];\n" "> +\treturn NULL;\n" "\n" @@ -254,12 +262,12 @@ "> +\tstruct ccid_operations *ccid_ops = ccid_find_by_id(id);\n" "> +\tstruct ccid *ccid;\n" "> +\n" - "> +\tif (ccid_ops = NULL)\n" + "> +\tif (ccid_ops == NULL)\n" "> +\t\treturn NULL;\n" "> +\n" "> +\tccid = kmem_cache_alloc(rx ? ccid_ops->ccid_hc_rx_slab :\n" "> +\t\t\t\t ccid_ops->ccid_hc_tx_slab, gfp_any());\n" - "> \tif (ccid = NULL)\n" + "> \tif (ccid == NULL)\n" "> \t\treturn NULL;\n" "> \n" "> @@ -241,58 +189,14 @@ static struct ccid *__ccid_new(struct cc\n" @@ -279,7 +287,7 @@ "> -{\n" "> -\tint i;\n" "> -\tfor (i = 0; i < ARRAY_SIZE(builtin_ccids); i++)\n" - "> -\t\tif (id = builtin_ccids[i])\n" + "> -\t\tif (id == builtin_ccids[i])\n" "> -\t\t\treturn true;\n" "> -\treturn false;\n" "> -}\n" @@ -291,13 +299,13 @@ "> -\n" "> -\tif (is_builtin_ccid(id)) {\n" "> -\t\tccid_ops = ccids[id];\n" - "> -\t\tBUG_ON(ccid_ops = NULL);\n" + "> -\t\tBUG_ON(ccid_ops == NULL);\n" "> -\t\treturn __ccid_new(ccid_ops, sk, rx, gfp);\n" "> -\t}\n" "> -\n" "> -\tccids_read_lock();\n" "> -#ifdef CONFIG_MODULES\n" - "> -\tif (ccids[id] = NULL) {\n" + "> -\tif (ccids[id] == NULL) {\n" "> -\t\t/* We only try to load if in process context */\n" "> -\t\tccids_read_unlock();\n" "> -\t\tif (gfp & GFP_ATOMIC)\n" @@ -307,7 +315,7 @@ "> -\t}\n" "> -#endif\n" "> -\tccid_ops = ccids[id];\n" - "> -\tif (ccid_ops = NULL)\n" + "> -\tif (ccid_ops == NULL)\n" "> -\t\tgoto out_unlock;\n" "> -\n" "> -\tccids_read_unlock();\n" @@ -332,7 +340,7 @@ "> -\tstruct ccid *new_ccid = ccid_new(ccid, sk, rx, gfp_any());\n" "> +\tstruct ccid *new_ccid = ccid_new(ccid, sk, rx);\n" "> \n" - "> \tif (new_ccid = NULL)\n" + "> \tif (new_ccid == NULL)\n" "> \t\treturn -ENOMEM;" -ecb5233871b332e58388abadc60f666e6387356acff5527f88fcdf0aa07fd4e9 +cf742ce4a8c9d31ba81957de4ae2166b8e8df691c5a1f16dc2507312175b4f14
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.