diff for duplicates of <53FCC593.6020201@gmail.com> diff --git a/a/2.txt b/N1/2.txt index 93372ef..8b13789 100644 --- a/a/2.txt +++ b/N1/2.txt @@ -1,160 +1 @@ ->From 748370b1220693b755b6b92828e651cc0bac7846 Mon Sep 17 00:00:00 2001 -From: Boaz Harrosh <boaz@plexistor.com> -Date: Thu, 21 Aug 2014 19:03:48 +0300 -Subject: [PATCH 12/12] SQUASHME: pmem: KISS, remove the all pmem_major - registration -Though this looks revolutionary, it actually does nothing -but removes dead code. - -Since the move of pmem to the dynamic BLOCK_EXT_MAJOR -range, by Ross, all this stuff is not used by the Kernel. - -Note that with current code pmem_major defaults to ZERO -but even if I run with - modprobe pmem map=1G@1G pmem_major=17 - -I still ever get: -brw-rw----. 1 root disk 259, 0 Aug 21 19:02 /dev/pmem0 -brw-rw----. 1 root disk 259, 1 Aug 21 19:02 /dev/pmem0p1 -brw-rw----. 1 root disk 259, 2 Aug 21 19:02 /dev/pmem0p2 - ->From the BLOCK_EXT_MAJOR (259) range. Even Though the -registration of pmem_major=17 succeeded just fine, and - disk->major = 17; -was set in pmem_alloc() - -I have tested all the tests that I know how to perform -on the devices, fdisk, partitions, multiple pmemX devices, -mknode, lsblk, blkid, and it all behaves exactly as -before this patch. - -I have also done: - find /sys/ -name "*pmem*" - find /proc/ -name "*pmem*" - find /dev/ -name "*pmem*" -And get the same output as before this patch. - -If anyone knows of what would work differently after this -patch please do tell. - -But it looks like the calls to register_blkdev + -blk_register_region are just dead code for us right now - -Thanks - -Signed-off-by: Boaz Harrosh <boaz@plexistor.com> ---- - drivers/block/pmem.c | 45 +-------------------------------------------- - 1 file changed, 1 insertion(+), 44 deletions(-) - -diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c -index a272c43..014bba7 100644 ---- a/drivers/block/pmem.c -+++ b/drivers/block/pmem.c -@@ -228,9 +228,6 @@ static const struct block_device_operations pmem_fops = { - }; - - /* Kernel module stuff */ --static int pmem_major; --module_param(pmem_major, int, 0); --MODULE_PARM_DESC(pmem_major, "Major number to request for this driver"); - - static char *map; - module_param(map, charp, S_IRUGO); -@@ -239,7 +236,6 @@ MODULE_PARM_DESC(map, - "mapS=nn[KMG]$ss[KMG] or mapS=nn[KMG]@ss[KMG], nn=size, ss=offset."); - - static LIST_HEAD(pmem_devices); --static DEFINE_MUTEX(pmem_devices_mutex); - - #ifdef CONFIG_BLK_DEV_PMEM_USE_PAGES - static int pmem_add_page_mapping(phys_addr_t phys_addr, size_t total_size, -@@ -455,7 +451,7 @@ static struct pmem_device *pmem_alloc(phys_addr_t phys_addr, size_t disk_size, - err = -ENOMEM; - goto out_free_queue; - } -- disk->major = pmem_major; -+ disk->major = BLOCK_EXT_MAJOR; - disk->first_minor = 0; - disk->fops = &pmem_fops; - disk->private_data = pmem; -@@ -492,30 +488,6 @@ static void pmem_del_one(struct pmem_device *pmem) - pmem_free(pmem); - } - --/*FIXME: Actually in our driver pmem_probe is never used. Can be removed */ --static struct kobject *pmem_probe(dev_t dev, int *part, void *data) --{ -- struct pmem_device *pmem; -- struct kobject *kobj; -- int number = MINOR(dev); -- -- mutex_lock(&pmem_devices_mutex); -- -- list_for_each_entry(pmem, &pmem_devices, pmem_list) { -- if (pmem->pmem_number == number) { -- kobj = get_disk(pmem->pmem_disk); -- goto out; -- } -- } -- -- pr_err("pmem: pmem_probe: Unexpected parameter=%d\n", number); -- kobj = NULL; -- --out: -- mutex_unlock(&pmem_devices_mutex); -- return kobj; --} -- - static int pmem_parse_map_one(char *map, phys_addr_t *start, size_t *size) - { - char *p = map; -@@ -540,13 +512,6 @@ static int __init pmem_init(void) - return -EINVAL; - } - -- result = register_blkdev(pmem_major, "pmem"); -- if (result < 0) { -- result = -EIO; -- goto out; -- } else if (result > 0) -- pmem_major = result; -- - i = 0; - while ((p = strsep(&pmem_map, ",")) != NULL) { - phys_addr_t phys_addr; -@@ -570,9 +535,6 @@ static int __init pmem_init(void) - list_for_each_entry(pmem, &pmem_devices, pmem_list) - add_disk(pmem->pmem_disk); - -- blk_register_region(MKDEV(pmem_major, 0), 0, -- THIS_MODULE, pmem_probe, NULL, NULL); -- - pr_info("pmem: module loaded\n"); - return 0; - -@@ -581,8 +543,6 @@ out_free: - list_del(&pmem->pmem_list); - pmem_free(pmem); - } -- unregister_blkdev(pmem_major, "pmem"); --out: - return result; - } - -@@ -590,12 +550,9 @@ static void __exit pmem_exit(void) - { - struct pmem_device *pmem, *next; - -- blk_unregister_region(MKDEV(pmem_major, 0), 0); -- - list_for_each_entry_safe(pmem, next, &pmem_devices, pmem_list) - pmem_del_one(pmem); - -- unregister_blkdev(pmem_major, "pmem"); - pr_info("pmem: module unloaded\n"); - } - --- -1.9.3 diff --git a/a/content_digest b/N1/content_digest index 8e7cefd..d9517be 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -63,165 +63,5 @@ "\01:2\0" "fn\00012-SQUASHME-pmem-KISS-remove-the-all-pmem_major-registr.patch\0" "b\0" - ">From 748370b1220693b755b6b92828e651cc0bac7846 Mon Sep 17 00:00:00 2001\n" - "From: Boaz Harrosh <boaz@plexistor.com>\n" - "Date: Thu, 21 Aug 2014 19:03:48 +0300\n" - "Subject: [PATCH 12/12] SQUASHME: pmem: KISS, remove the all pmem_major\n" - " registration\n" - "\n" - "Though this looks revolutionary, it actually does nothing\n" - "but removes dead code.\n" - "\n" - "Since the move of pmem to the dynamic BLOCK_EXT_MAJOR\n" - "range, by Ross, all this stuff is not used by the Kernel.\n" - "\n" - "Note that with current code pmem_major defaults to ZERO\n" - "but even if I run with\n" - "\tmodprobe pmem map=1G@1G pmem_major=17\n" - "\n" - "I still ever get:\n" - "brw-rw----. 1 root disk 259, 0 Aug 21 19:02 /dev/pmem0\n" - "brw-rw----. 1 root disk 259, 1 Aug 21 19:02 /dev/pmem0p1\n" - "brw-rw----. 1 root disk 259, 2 Aug 21 19:02 /dev/pmem0p2\n" - "\n" - ">From the BLOCK_EXT_MAJOR (259) range. Even Though the\n" - "registration of pmem_major=17 succeeded just fine, and\n" - "\tdisk->major = 17;\n" - "was set in pmem_alloc()\n" - "\n" - "I have tested all the tests that I know how to perform\n" - "on the devices, fdisk, partitions, multiple pmemX devices,\n" - "mknode, lsblk, blkid, and it all behaves exactly as\n" - "before this patch.\n" - "\n" - "I have also done:\n" - "\tfind /sys/ -name \"*pmem*\"\n" - "\tfind /proc/ -name \"*pmem*\"\n" - "\tfind /dev/ -name \"*pmem*\"\n" - "And get the same output as before this patch.\n" - "\n" - "If anyone knows of what would work differently after this\n" - "patch please do tell.\n" - "\n" - "But it looks like the calls to register_blkdev +\n" - "blk_register_region are just dead code for us right now\n" - "\n" - "Thanks\n" - "\n" - "Signed-off-by: Boaz Harrosh <boaz@plexistor.com>\n" - "---\n" - " drivers/block/pmem.c | 45 +--------------------------------------------\n" - " 1 file changed, 1 insertion(+), 44 deletions(-)\n" - "\n" - "diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c\n" - "index a272c43..014bba7 100644\n" - "--- a/drivers/block/pmem.c\n" - "+++ b/drivers/block/pmem.c\n" - "@@ -228,9 +228,6 @@ static const struct block_device_operations pmem_fops = {\n" - " };\n" - " \n" - " /* Kernel module stuff */\n" - "-static int pmem_major;\n" - "-module_param(pmem_major, int, 0);\n" - "-MODULE_PARM_DESC(pmem_major, \"Major number to request for this driver\");\n" - " \n" - " static char *map;\n" - " module_param(map, charp, S_IRUGO);\n" - "@@ -239,7 +236,6 @@ MODULE_PARM_DESC(map,\n" - " \t\"mapS=nn[KMG]$ss[KMG] or mapS=nn[KMG]@ss[KMG], nn=size, ss=offset.\");\n" - " \n" - " static LIST_HEAD(pmem_devices);\n" - "-static DEFINE_MUTEX(pmem_devices_mutex);\n" - " \n" - " #ifdef CONFIG_BLK_DEV_PMEM_USE_PAGES\n" - " static int pmem_add_page_mapping(phys_addr_t phys_addr, size_t total_size,\n" - "@@ -455,7 +451,7 @@ static struct pmem_device *pmem_alloc(phys_addr_t phys_addr, size_t disk_size,\n" - " \t\terr = -ENOMEM;\n" - " \t\tgoto out_free_queue;\n" - " \t}\n" - "-\tdisk->major\t\t= pmem_major;\n" - "+\tdisk->major\t\t= BLOCK_EXT_MAJOR;\n" - " \tdisk->first_minor\t= 0;\n" - " \tdisk->fops\t\t= &pmem_fops;\n" - " \tdisk->private_data\t= pmem;\n" - "@@ -492,30 +488,6 @@ static void pmem_del_one(struct pmem_device *pmem)\n" - " \tpmem_free(pmem);\n" - " }\n" - " \n" - "-/*FIXME: Actually in our driver pmem_probe is never used. Can be removed */\n" - "-static struct kobject *pmem_probe(dev_t dev, int *part, void *data)\n" - "-{\n" - "-\tstruct pmem_device *pmem;\n" - "-\tstruct kobject *kobj;\n" - "-\tint number = MINOR(dev);\n" - "-\n" - "-\tmutex_lock(&pmem_devices_mutex);\n" - "-\n" - "-\tlist_for_each_entry(pmem, &pmem_devices, pmem_list) {\n" - "-\t\tif (pmem->pmem_number == number) {\n" - "-\t\t\tkobj = get_disk(pmem->pmem_disk);\n" - "-\t\t\tgoto out;\n" - "-\t\t}\n" - "-\t}\n" - "-\n" - "-\tpr_err(\"pmem: pmem_probe: Unexpected parameter=%d\\n\", number);\n" - "-\tkobj = NULL;\n" - "-\n" - "-out:\n" - "-\tmutex_unlock(&pmem_devices_mutex);\n" - "-\treturn kobj;\n" - "-}\n" - "-\n" - " static int pmem_parse_map_one(char *map, phys_addr_t *start, size_t *size)\n" - " {\n" - " \tchar *p = map;\n" - "@@ -540,13 +512,6 @@ static int __init pmem_init(void)\n" - " \t\treturn -EINVAL;\n" - " \t}\n" - " \n" - "-\tresult = register_blkdev(pmem_major, \"pmem\");\n" - "-\tif (result < 0) {\n" - "-\t\tresult = -EIO;\n" - "-\t\tgoto out;\n" - "-\t} else if (result > 0)\n" - "-\t\tpmem_major = result;\n" - "-\n" - " \ti = 0;\n" - " \twhile ((p = strsep(&pmem_map, \",\")) != NULL) {\n" - " \t\tphys_addr_t phys_addr;\n" - "@@ -570,9 +535,6 @@ static int __init pmem_init(void)\n" - " \tlist_for_each_entry(pmem, &pmem_devices, pmem_list)\n" - " \t\tadd_disk(pmem->pmem_disk);\n" - " \n" - "-\tblk_register_region(MKDEV(pmem_major, 0), 0,\n" - "-\t\t\t\t THIS_MODULE, pmem_probe, NULL, NULL);\n" - "-\n" - " \tpr_info(\"pmem: module loaded\\n\");\n" - " \treturn 0;\n" - " \n" - "@@ -581,8 +543,6 @@ out_free:\n" - " \t\tlist_del(&pmem->pmem_list);\n" - " \t\tpmem_free(pmem);\n" - " \t}\n" - "-\tunregister_blkdev(pmem_major, \"pmem\");\n" - "-out:\n" - " \treturn result;\n" - " }\n" - " \n" - "@@ -590,12 +550,9 @@ static void __exit pmem_exit(void)\n" - " {\n" - " \tstruct pmem_device *pmem, *next;\n" - " \n" - "-\tblk_unregister_region(MKDEV(pmem_major, 0), 0);\n" - "-\n" - " \tlist_for_each_entry_safe(pmem, next, &pmem_devices, pmem_list)\n" - " \t\tpmem_del_one(pmem);\n" - " \n" - "-\tunregister_blkdev(pmem_major, \"pmem\");\n" - " \tpr_info(\"pmem: module unloaded\\n\");\n" - " }\n" - " \n" - "-- \n" - 1.9.3 -2e14112d277a12058e0555e57adf3f639e3f4178486394dad77ec75c8625d55f +fa04a65de9cfc55e500c6093cdb69badc5b2fc99263b58ad5ed93e0f3090a2e1
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.