Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs

Pull configfs update from Christoph Hellwig:
"Just one simple change from Andrzej to drop the pointless return value
from the ->drop_link method"

* tag 'configfs-for-4.10' of git://git.infradead.org/users/hch/configfs:
fs: configfs: don't return anything from drop_link

+17 -37
+1 -1
Documentation/filesystems/configfs/configfs.txt
··· 174 174 void (*release)(struct config_item *); 175 175 int (*allow_link)(struct config_item *src, 176 176 struct config_item *target); 177 - int (*drop_link)(struct config_item *src, 177 + void (*drop_link)(struct config_item *src, 178 178 struct config_item *target); 179 179 }; 180 180
+4 -6
drivers/nvme/target/configfs.c
··· 480 480 return ret; 481 481 } 482 482 483 - static int nvmet_port_subsys_drop_link(struct config_item *parent, 483 + static void nvmet_port_subsys_drop_link(struct config_item *parent, 484 484 struct config_item *target) 485 485 { 486 486 struct nvmet_port *port = to_nvmet_port(parent->ci_parent); ··· 493 493 goto found; 494 494 } 495 495 up_write(&nvmet_config_sem); 496 - return -EINVAL; 496 + return; 497 497 498 498 found: 499 499 list_del(&p->entry); ··· 502 502 nvmet_disable_port(port); 503 503 up_write(&nvmet_config_sem); 504 504 kfree(p); 505 - return 0; 506 505 } 507 506 508 507 static struct configfs_item_operations nvmet_port_subsys_item_ops = { ··· 555 556 return ret; 556 557 } 557 558 558 - static int nvmet_allowed_hosts_drop_link(struct config_item *parent, 559 + static void nvmet_allowed_hosts_drop_link(struct config_item *parent, 559 560 struct config_item *target) 560 561 { 561 562 struct nvmet_subsys *subsys = to_subsys(parent->ci_parent); ··· 568 569 goto found; 569 570 } 570 571 up_write(&nvmet_config_sem); 571 - return -EINVAL; 572 + return; 572 573 573 574 found: 574 575 list_del(&p->entry); 575 576 nvmet_genctr++; 576 577 up_write(&nvmet_config_sem); 577 578 kfree(p); 578 - return 0; 579 579 } 580 580 581 581 static struct configfs_item_operations nvmet_allowed_hosts_item_ops = {
+3 -4
drivers/target/target_core_fabric_configfs.c
··· 137 137 return core_dev_add_initiator_node_lun_acl(se_tpg, lacl, lun, lun_access_ro); 138 138 } 139 139 140 - static int target_fabric_mappedlun_unlink( 140 + static void target_fabric_mappedlun_unlink( 141 141 struct config_item *lun_acl_ci, 142 142 struct config_item *lun_ci) 143 143 { ··· 146 146 struct se_lun *lun = container_of(to_config_group(lun_ci), 147 147 struct se_lun, lun_group); 148 148 149 - return core_dev_del_initiator_node_lun_acl(lun, lacl); 149 + core_dev_del_initiator_node_lun_acl(lun, lacl); 150 150 } 151 151 152 152 static struct se_lun_acl *item_to_lun_acl(struct config_item *item) ··· 669 669 return ret; 670 670 } 671 671 672 - static int target_fabric_port_unlink( 672 + static void target_fabric_port_unlink( 673 673 struct config_item *lun_ci, 674 674 struct config_item *se_dev_ci) 675 675 { ··· 688 688 } 689 689 690 690 core_dev_del_lun(se_tpg, lun); 691 - return 0; 692 691 } 693 692 694 693 static void target_fabric_port_release(struct config_item *item)
+3 -5
drivers/usb/gadget/configfs.c
··· 408 408 return ret; 409 409 } 410 410 411 - static int config_usb_cfg_unlink( 411 + static void config_usb_cfg_unlink( 412 412 struct config_item *usb_cfg_ci, 413 413 struct config_item *usb_func_ci) 414 414 { ··· 437 437 list_del(&f->list); 438 438 usb_put_function(f); 439 439 mutex_unlock(&gi->lock); 440 - return 0; 440 + return; 441 441 } 442 442 } 443 443 mutex_unlock(&gi->lock); 444 444 WARN(1, "Unable to locate function to unbind\n"); 445 - return 0; 446 445 } 447 446 448 447 static struct configfs_item_operations gadget_config_item_ops = { ··· 864 865 return ret; 865 866 } 866 867 867 - static int os_desc_unlink(struct config_item *os_desc_ci, 868 + static void os_desc_unlink(struct config_item *os_desc_ci, 868 869 struct config_item *usb_cfg_ci) 869 870 { 870 871 struct gadget_info *gi = container_of(to_config_group(os_desc_ci), ··· 877 878 cdev->os_desc_config = NULL; 878 879 WARN_ON(gi->composite.gadget_driver.udc_name); 879 880 mutex_unlock(&gi->lock); 880 - return 0; 881 881 } 882 882 883 883 static struct configfs_item_operations os_desc_ops = {
+5 -20
drivers/usb/gadget/function/uvc_configfs.c
··· 547 547 return ret; 548 548 } 549 549 550 - static int uvcg_control_class_drop_link(struct config_item *src, 550 + static void uvcg_control_class_drop_link(struct config_item *src, 551 551 struct config_item *target) 552 552 { 553 553 struct config_item *control, *header; ··· 555 555 struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex; 556 556 struct uvc_descriptor_header **class_array; 557 557 struct uvcg_control_header *target_hdr; 558 - int ret = -EINVAL; 559 558 560 559 mutex_lock(su_mutex); /* for navigating configfs hierarchy */ 561 560 ··· 568 569 mutex_lock(&opts->lock); 569 570 570 571 class_array = uvcg_get_ctl_class_arr(src, opts); 571 - if (!class_array) 572 + if (!class_array || opts->refcnt) 572 573 goto unlock; 573 - if (opts->refcnt) { 574 - ret = -EBUSY; 575 - goto unlock; 576 - } 577 574 578 575 target_hdr = to_uvcg_control_header(target); 579 576 --target_hdr->linked; 580 577 class_array[0] = NULL; 581 - ret = 0; 582 578 583 579 unlock: 584 580 mutex_unlock(&opts->lock); 585 581 out: 586 582 mutex_unlock(su_mutex); 587 - return ret; 588 583 } 589 584 590 585 static struct configfs_item_operations uvcg_control_class_item_ops = { ··· 770 777 return ret; 771 778 } 772 779 773 - static int uvcg_streaming_header_drop_link(struct config_item *src, 780 + static void uvcg_streaming_header_drop_link(struct config_item *src, 774 781 struct config_item *target) 775 782 { 776 783 struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex; ··· 779 786 struct uvcg_streaming_header *src_hdr; 780 787 struct uvcg_format *target_fmt = NULL; 781 788 struct uvcg_format_ptr *format_ptr, *tmp; 782 - int ret = -EINVAL; 783 789 784 790 src_hdr = to_uvcg_streaming_header(src); 785 791 mutex_lock(su_mutex); /* for navigating configfs hierarchy */ ··· 803 811 out: 804 812 mutex_unlock(&opts->lock); 805 813 mutex_unlock(su_mutex); 806 - return ret; 807 - 808 814 } 809 815 810 816 static struct configfs_item_operations uvcg_streaming_header_item_ops = { ··· 2041 2051 return ret; 2042 2052 } 2043 2053 2044 - static int uvcg_streaming_class_drop_link(struct config_item *src, 2054 + static void uvcg_streaming_class_drop_link(struct config_item *src, 2045 2055 struct config_item *target) 2046 2056 { 2047 2057 struct config_item *streaming, *header; ··· 2049 2059 struct mutex *su_mutex = &src->ci_group->cg_subsys->su_mutex; 2050 2060 struct uvc_descriptor_header ***class_array; 2051 2061 struct uvcg_streaming_header *target_hdr; 2052 - int ret = -EINVAL; 2053 2062 2054 2063 mutex_lock(su_mutex); /* for navigating configfs hierarchy */ 2055 2064 ··· 2065 2076 if (!class_array || !*class_array) 2066 2077 goto unlock; 2067 2078 2068 - if (opts->refcnt) { 2069 - ret = -EBUSY; 2079 + if (opts->refcnt) 2070 2080 goto unlock; 2071 - } 2072 2081 2073 2082 target_hdr = to_uvcg_streaming_header(target); 2074 2083 --target_hdr->linked; 2075 2084 kfree(**class_array); 2076 2085 kfree(*class_array); 2077 2086 *class_array = NULL; 2078 - ret = 0; 2079 2087 2080 2088 unlock: 2081 2089 mutex_unlock(&opts->lock); 2082 2090 out: 2083 2091 mutex_unlock(su_mutex); 2084 - return ret; 2085 2092 } 2086 2093 2087 2094 static struct configfs_item_operations uvcg_streaming_class_item_ops = {
+1 -1
include/linux/configfs.h
··· 228 228 struct configfs_item_operations { 229 229 void (*release)(struct config_item *); 230 230 int (*allow_link)(struct config_item *src, struct config_item *target); 231 - int (*drop_link)(struct config_item *src, struct config_item *target); 231 + void (*drop_link)(struct config_item *src, struct config_item *target); 232 232 }; 233 233 234 234 struct configfs_group_operations {