From patchwork Thu Jan 2 07:53:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Balbir" X-Patchwork-Id: 11315437 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E807138D for ; Thu, 2 Jan 2020 07:53:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D49721734 for ; Thu, 2 Jan 2020 07:53:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="VaEYoJu2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbgABHxn (ORCPT ); Thu, 2 Jan 2020 02:53:43 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:13891 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbgABHxe (ORCPT ); Thu, 2 Jan 2020 02:53:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577951614; x=1609487614; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=4qUj5u+oxc6hneYGlI2C/8YFgqo7dDcV2dUhIEALWZk=; b=VaEYoJu2j4/kmV0WmTRWhh4izEyWBb44D3dTwgBDJcIjci2OPvqEK6db ueYsddt7VTSZD5Op/j6z9TFMsnvbxUqAc8Qj9dErxIKJ2NU4zGrAntzWK FRA7dLOwmm895mOgskFw1eWwxUzWbP1n99k1i7vkR8IvAiynBdyWkCi7R E=; IronPort-SDR: DdkJEDsnq8BF7n8r5K3LtX4Lt3Cx0ND9gS41qTOlfsRwfIuOoR8+Aud6YpOvPng1lPX/lFdwEM rVXxoDTImHuw== X-IronPort-AV: E=Sophos;i="5.69,385,1571702400"; d="scan'208";a="17779134" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1e-57e1d233.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 02 Jan 2020 07:53:23 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1e-57e1d233.us-east-1.amazon.com (Postfix) with ESMTPS id 003DF1416C4; Thu, 2 Jan 2020 07:53:19 +0000 (UTC) Received: from EX13D01UWA004.ant.amazon.com (10.43.160.99) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:19 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13d01UWA004.ant.amazon.com (10.43.160.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:18 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 07:53:18 +0000 From: Balbir Singh To: , , CC: , , , , , , Balbir Singh Subject: [resend v1 1/5] block/genhd: Notify udev about capacity change Date: Thu, 2 Jan 2020 07:53:11 +0000 Message-ID: <20200102075315.22652-2-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20200102075315.22652-1-sblbir@amazon.com> References: <20200102075315.22652-1-sblbir@amazon.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Allow block/genhd to notify user space (via udev) about disk size changes using a new helper disk_set_capacity(), which is a wrapper on top of set_capacity(). disk_set_capacity() will only notify via udev if the current capacity or the target capacity is not zero. Suggested-by: Christoph Hellwig Signed-off-by: Someswarudu Sangaraju Signed-off-by: Balbir Singh --- block/genhd.c | 19 +++++++++++++++++++ include/linux/genhd.h | 1 + 2 files changed, 20 insertions(+) diff --git a/block/genhd.c b/block/genhd.c index ff6268970ddc..94faec98607b 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -46,6 +46,25 @@ static void disk_add_events(struct gendisk *disk); static void disk_del_events(struct gendisk *disk); static void disk_release_events(struct gendisk *disk); +/* + * Set disk capacity and notify if the size is not currently + * zero and will not be set to zero + */ +void disk_set_capacity(struct gendisk *disk, sector_t size) +{ + sector_t capacity = get_capacity(disk); + + set_capacity(disk, size); + if (capacity != 0 && size != 0) { + char *envp[] = { "RESIZE=1", NULL }; + + kobject_uevent_env(&disk_to_dev(disk)->kobj, KOBJ_CHANGE, envp); + } +} + +EXPORT_SYMBOL_GPL(disk_set_capacity); + + void part_inc_in_flight(struct request_queue *q, struct hd_struct *part, int rw) { if (queue_is_mq(q)) diff --git a/include/linux/genhd.h b/include/linux/genhd.h index a927829bb73a..f1a5ddcc781d 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -449,6 +449,7 @@ static inline int get_disk_ro(struct gendisk *disk) extern void disk_block_events(struct gendisk *disk); extern void disk_unblock_events(struct gendisk *disk); extern void disk_flush_events(struct gendisk *disk, unsigned int mask); +extern void disk_set_capacity(struct gendisk *disk, sector_t size); extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); /* drivers/char/random.c */ From patchwork Thu Jan 2 07:53:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Balbir" X-Patchwork-Id: 11315427 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 32657109A for ; Thu, 2 Jan 2020 07:53:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0B0FD20866 for ; Thu, 2 Jan 2020 07:53:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="wEv2x8t7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727659AbgABHxZ (ORCPT ); Thu, 2 Jan 2020 02:53:25 -0500 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:35797 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgABHxZ (ORCPT ); Thu, 2 Jan 2020 02:53:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577951605; x=1609487605; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=bFqvuHtUJ2uTuBGE5u3MI0p2QpGGNs+AUqkx0RpdLvY=; b=wEv2x8t7KYv9Lih6EHzXMF8++oG5ZlHqJuhW7PJFSmIh+2pAmL8sRShl jij0QyEyazFcn7sOYjZ3kpDPw4VnqyO9QFKokfWvJbTRWJFi62nU/r4UE HHeHojS0EzWkrKWzxbIEUUM7W6gXLAaLYwj8BV2PSQDMR3m8mTl/UWm/c k=; IronPort-SDR: RNTC/4q3xGWHPIh9vssYnvrzBZGJuP19UJzRbqvoIonGLncvhmcp0JXo+YaHAWgnXjsCY0bewp oZ4tNqPWAC5A== X-IronPort-AV: E=Sophos;i="5.69,386,1571702400"; d="scan'208";a="9797737" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-2a-e7be2041.us-west-2.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 02 Jan 2020 07:53:22 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-e7be2041.us-west-2.amazon.com (Postfix) with ESMTPS id 438D1A1E23; Thu, 2 Jan 2020 07:53:21 +0000 (UTC) Received: from EX13D11UWB003.ant.amazon.com (10.43.161.206) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:20 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D11UWB003.ant.amazon.com (10.43.161.206) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:20 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 07:53:19 +0000 From: Balbir Singh To: , , CC: , , , , , , Balbir Singh Subject: [resend v1 2/5] drivers/block/virtio_blk.c: Convert to use disk_set_capacity Date: Thu, 2 Jan 2020 07:53:12 +0000 Message-ID: <20200102075315.22652-3-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20200102075315.22652-1-sblbir@amazon.com> References: <20200102075315.22652-1-sblbir@amazon.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org block/genhd provides disk_set_capacity() for sending RESIZE notifications via uevents. Signed-off-by: Balbir Singh --- drivers/block/virtio_blk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index fbbf18ac1d5d..9848c94a7eb4 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -479,18 +479,16 @@ static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize) cap_str_10, cap_str_2); - set_capacity(vblk->disk, capacity); + disk_set_capacity(vblk->disk, capacity); } static void virtblk_config_changed_work(struct work_struct *work) { struct virtio_blk *vblk = container_of(work, struct virtio_blk, config_work); - char *envp[] = { "RESIZE=1", NULL }; virtblk_update_capacity(vblk, true); revalidate_disk(vblk->disk); - kobject_uevent_env(&disk_to_dev(vblk->disk)->kobj, KOBJ_CHANGE, envp); } static void virtblk_config_changed(struct virtio_device *vdev) From patchwork Thu Jan 2 07:53:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Balbir" X-Patchwork-Id: 11315429 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EECD5138D for ; Thu, 2 Jan 2020 07:53:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD89C20866 for ; Thu, 2 Jan 2020 07:53:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="EClBXzcb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727721AbgABHx2 (ORCPT ); Thu, 2 Jan 2020 02:53:28 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:60261 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726145AbgABHx1 (ORCPT ); Thu, 2 Jan 2020 02:53:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577951607; x=1609487607; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=Lu5wUxicX2nqy1FtOE1ySeTvkT4l5dpgfpukGpnD/kE=; b=EClBXzcbr2dv3hrI54y1oRkaFHJvD3xrwDa1T3IhOJffQJvMczJr9P/U TGZoNSuM/aWNSn7pGz5FfswAI9meZCW496ZU90UTMVv8AKZOY5CmZAm1I jzJGAoy0UUjFkUBGxzywFU0xX13RMSAfglkUs6U3WYgpBeMNb9dg4iUku I=; IronPort-SDR: F+UfTDX7e6DI5Y0hnnkPGHSJNSsLUL5ST+80JyH2hyUDVkICXF/Vb8r+IexeFcg9wbkNgDJqdx jSPWiT2OsRlw== X-IronPort-AV: E=Sophos;i="5.69,386,1571702400"; d="scan'208";a="10648269" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-98acfc19.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 02 Jan 2020 07:53:25 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-98acfc19.us-east-1.amazon.com (Postfix) with ESMTPS id 51581A22C7; Thu, 2 Jan 2020 07:53:22 +0000 (UTC) Received: from EX13D11UWC002.ant.amazon.com (10.43.162.174) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:22 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D11UWC002.ant.amazon.com (10.43.162.174) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:21 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 07:53:20 +0000 From: Balbir Singh To: , , CC: , , , , , , Balbir Singh Subject: [resend v1 3/5] drivers/block/xen-blkfront.c: Convert to use disk_set_capacity Date: Thu, 2 Jan 2020 07:53:13 +0000 Message-ID: <20200102075315.22652-4-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20200102075315.22652-1-sblbir@amazon.com> References: <20200102075315.22652-1-sblbir@amazon.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org block/genhd provides disk_set_capacity() for sending RESIZE notifications via uevents. Signed-off-by: Balbir Singh --- drivers/block/xen-blkfront.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 23c86350a5ab..bed7050a697d 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2337,7 +2337,6 @@ static void blkfront_connect(struct blkfront_info *info) unsigned long sector_size; unsigned int physical_sector_size; unsigned int binfo; - char *envp[] = { "RESIZE=1", NULL }; int err, i; switch (info->connected) { @@ -2352,10 +2351,8 @@ static void blkfront_connect(struct blkfront_info *info) return; printk(KERN_INFO "Setting capacity to %Lu\n", sectors); - set_capacity(info->gd, sectors); + disk_set_capacity(info->gd, sectors); revalidate_disk(info->gd); - kobject_uevent_env(&disk_to_dev(info->gd)->kobj, - KOBJ_CHANGE, envp); return; case BLKIF_STATE_SUSPENDED: From patchwork Thu Jan 2 07:53:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Balbir" X-Patchwork-Id: 11315439 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12E0F109A for ; Thu, 2 Jan 2020 07:54:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC2B021734 for ; Thu, 2 Jan 2020 07:53:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="Vg4tM9Ws" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727822AbgABHx7 (ORCPT ); Thu, 2 Jan 2020 02:53:59 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:19249 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbgABHx7 (ORCPT ); Thu, 2 Jan 2020 02:53:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577951638; x=1609487638; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=RlibLQQganA2BZ89ch7dSkDd5ROuDmDBz+7MfRKKRsw=; b=Vg4tM9WsSJ5EkkuakHUyAMxgZ2+Mbja2rMcFU/ET9tFFwx9FxI1MLjFD yiNG59A+gCAPJeOwkcY0+D6/pl+qPTqicV8llmCYKAVFkhrYlyCcKs+wT G+YC55SCupAwkyA31x4uJ3P6183zzknphFLdGWS31Z1GESQqlj0vSFRPD 4=; IronPort-SDR: PPLhSY4jNtRBa2o7qMz8aHt3QgFdThFlbslEB5/L+ZcMKItPHVxhHM7qn/Q5Y0LGcfjtOs8+LX D3R9mD+FVJHA== X-IronPort-AV: E=Sophos;i="5.69,385,1571702400"; d="scan'208";a="11240006" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1e-a70de69e.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 02 Jan 2020 07:53:57 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-a70de69e.us-east-1.amazon.com (Postfix) with ESMTPS id 93F49A1F00; Thu, 2 Jan 2020 07:53:54 +0000 (UTC) Received: from EX13D01UWA003.ant.amazon.com (10.43.160.107) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:23 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13d01UWA003.ant.amazon.com (10.43.160.107) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:23 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 07:53:22 +0000 From: Balbir Singh To: , , CC: , , , , , , Balbir Singh Subject: [resend v1 4/5] drivers/nvme/host/core.c: Convert to use disk_set_capacity Date: Thu, 2 Jan 2020 07:53:14 +0000 Message-ID: <20200102075315.22652-5-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20200102075315.22652-1-sblbir@amazon.com> References: <20200102075315.22652-1-sblbir@amazon.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org block/genhd provides disk_set_capacity() for sending RESIZE notifications via uevents. This notification is newly added to NVME devices Signed-off-by: Balbir Singh --- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 667f18f465be..cb214e914fc2 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -1808,7 +1808,7 @@ static void nvme_update_disk_info(struct gendisk *disk, ns->lba_shift > PAGE_SHIFT) capacity = 0; - set_capacity(disk, capacity); + disk_set_capacity(disk, capacity); nvme_config_discard(disk, ns); nvme_config_write_zeroes(disk, ns); From patchwork Thu Jan 2 07:53:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Singh, Balbir" X-Patchwork-Id: 11315433 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5BFF6109A for ; Thu, 2 Jan 2020 07:53:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3ACA520866 for ; Thu, 2 Jan 2020 07:53:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="pddTFLYH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbgABHxg (ORCPT ); Thu, 2 Jan 2020 02:53:36 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:13891 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727781AbgABHxf (ORCPT ); Thu, 2 Jan 2020 02:53:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577951616; x=1609487616; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=x51IhYE1QyMmY3UHAvxQPb23Eyep04ViD2uP480XSao=; b=pddTFLYHv8OvDL5cOTlw+D5UVYQ2nuhETA8VXsShHlEMLzFzyCdKKZ2Y G/CyksK76UQIZKzft3ywUHX863lO03yMdw6LiphOosVa7I5w/fpf+vp4V oShJ6CwpaDO0p+rZ8jFex0XUntpi04kR8qRlrMTIOrAgQ0wNLadlgzVjN 0=; IronPort-SDR: bFnmoTpJxJQMchHcpI9J27Stgt9IouSGesc4w8HXeVrR5wfd4SV+365A1W/FeBqf5BPo8Uu4pc vV0LIyF28eVg== X-IronPort-AV: E=Sophos;i="5.69,385,1571702400"; d="scan'208";a="17779141" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 02 Jan 2020 07:53:30 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-5dd976cd.us-east-1.amazon.com (Postfix) with ESMTPS id D7E14A1DD2; Thu, 2 Jan 2020 07:53:26 +0000 (UTC) Received: from EX13D11UWC004.ant.amazon.com (10.43.162.101) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:25 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D11UWC004.ant.amazon.com (10.43.162.101) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 2 Jan 2020 07:53:24 +0000 Received: from localhost (172.23.204.141) by mail-relay.amazon.com (10.43.61.243) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 2 Jan 2020 07:53:23 +0000 From: Balbir Singh To: , , CC: , , , , , , Balbir Singh Subject: [resend v1 5/5] drivers/scsi/sd.c: Convert to use disk_set_capacity Date: Thu, 2 Jan 2020 07:53:15 +0000 Message-ID: <20200102075315.22652-6-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20200102075315.22652-1-sblbir@amazon.com> References: <20200102075315.22652-1-sblbir@amazon.com> MIME-Version: 1.0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org block/genhd provides disk_set_capacity() for sending RESIZE notifications via uevents. This notification is newly added to scsi sd. Signed-off-by: Balbir Singh --- drivers/scsi/sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 5afb0046b12a..1a3be30b6b78 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3184,7 +3184,7 @@ static int sd_revalidate_disk(struct gendisk *disk) sdkp->first_scan = 0; - set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); + disk_set_capacity(disk, logical_to_sectors(sdp, sdkp->capacity)); sd_config_write_same(sdkp); kfree(buffer);