Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1324451ybh; Thu, 12 Mar 2020 22:31:18 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtUXgJHTUgKj0+GD0oHqDqr2MY1tCdfHWW8B0TxMtJ8lzyypkbZkg2oJFvZEdg0HcWKUNq0 X-Received: by 2002:a9d:4c98:: with SMTP id m24mr9840989otf.158.1584077478092; Thu, 12 Mar 2020 22:31:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584077478; cv=none; d=google.com; s=arc-20160816; b=hUMWcUdnwqTusCzKWTwAd00bs/m/0Pkx71ytBxWLyhMx5XPvj5JzLADSvaAl7e3HyN o3uq19Q4GvSo0deP8gWrYTSp3dYxipOb0dseZ7OWQ+/RYwLAzbI4O02n/WZR1ZPeFCN2 wUrAJUp64kimb69wOn1Izb9WnqGa2yya/1XvAaL6UDvgXLrY5amCEer1xTZZ/MjcI8NK sXDW+QBLNzfCJKPWcXCp0jfX3dcncJmJrBCbLvzpKXAv05CHW9Bkn796fOmWdqgMWRtg ay4jXdr3NdJX6tqVdrHk+mG4c1AD8TgcBJS7rHUeALfQVZJ7k6Ix+sfxcUqFDeOam+tO /lGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:dkim-signature; bh=+sx6zgKfNvtU+khzgrLABKiu4S2pVtYCOg28mWKSsac=; b=zKDAsxMxCkKszHBMiGmPGFsq46c35eATuCgZ/IvMR0Wy2EGdnW189MvnEjdLNfweF2 8rvHKU/fIZmGsvxGbRTwMqhlrMFr8o7pNtp7rXthroWwoXMd6WdRfuUgMcLzUi3Iu06h m3Zp6Q6TFA9ZmZjoKp9qTyntDxEx4w1/XXzWbc15NTa4st3C/Y5c0xeydTE/C0WgEMkt iWQJb4jOSHmXIXwP1yW9v0by8NwqwWjkZ4XtiCuGXLOiW+m4YqO6VoxSH6ryPULlreKB wR8+hewE/ywjk0iNj0HADitvL4+5vfTvZ9k2LXtAFrec1XXJeRIuqMPkXBM8TXSWlViu PDCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CWYpmQTs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si3770586otl.278.2020.03.12.22.31.05; Thu, 12 Mar 2020 22:31:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=CWYpmQTs; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726477AbgCMFaj (ORCPT + 99 others); Fri, 13 Mar 2020 01:30:39 -0400 Received: from smtp-fw-6002.amazon.com ([52.95.49.90]:40257 "EHLO smtp-fw-6002.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725535AbgCMFaj (ORCPT ); Fri, 13 Mar 2020 01:30:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1584077439; x=1615613439; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=+sx6zgKfNvtU+khzgrLABKiu4S2pVtYCOg28mWKSsac=; b=CWYpmQTs5xvme34qVpgBImdgzi6ynB0J+HSFkGfbb84fm6SKqSI836ZZ F+L/OKhvEllJXbafuwfMQt0oO6oawEQCYqMeRTYXoKaYyFYWoLpxJOKxl PE05Tqj4wDzpyJn6JJKa8/Yoe/PfBbDzTMBKQx5QtILLGwecuWetNzrIb E=; IronPort-SDR: sIRAFgLEzf8PaTIoMhqw3HVzHHRlKL2OjpIMVzinRWe6oGpdDdUYgoSqY1d8b3VGr/H+X3K0u9 Ke2N60Y3NlLA== X-IronPort-AV: E=Sophos;i="5.70,547,1574121600"; d="scan'208";a="20880414" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-out-6002.iad6.amazon.com with ESMTP; 13 Mar 2020 05:30:21 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (Postfix) with ESMTPS id 1B63BA2E92; Fri, 13 Mar 2020 05:30:18 +0000 (UTC) Received: from EX13D01UWA001.ant.amazon.com (10.43.160.60) by EX13MTAUWA001.ant.amazon.com (10.43.160.118) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Fri, 13 Mar 2020 05:30:18 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13d01UWA001.ant.amazon.com (10.43.160.60) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 13 Mar 2020 05:30:18 +0000 Received: from localhost (10.2.75.237) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Fri, 13 Mar 2020 05:30:18 +0000 From: Balbir Singh To: , , CC: , , , "Balbir Singh" Subject: [PATCH v3 2/5] virtio_blk.c: Convert to use set_capacity_revalidate_and_notify Date: Fri, 13 Mar 2020 05:30:06 +0000 Message-ID: <20200313053009.19866-3-sblbir@amazon.com> X-Mailer: git-send-email 2.16.6 In-Reply-To: <20200313053009.19866-1-sblbir@amazon.com> References: <20200313053009.19866-1-sblbir@amazon.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org block/genhd provides set_capacity_revalidate_and_notify() for sending RESIZE notifications via uevents. Signed-off-by: Balbir Singh --- drivers/block/virtio_blk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 0736248999b0..f9b1e70f1b31 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -388,18 +388,15 @@ static void virtblk_update_capacity(struct virtio_blk *vblk, bool resize) cap_str_10, cap_str_2); - set_capacity(vblk->disk, capacity); + set_capacity_revalidate_and_notify(vblk->disk, capacity, true); } 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) -- 2.16.6