Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5905112ybl; Sun, 22 Dec 2019 17:42:59 -0800 (PST) X-Google-Smtp-Source: APXvYqxQUYgajHtHAQ+NldxaywAmR0xvtQ3UlF7zQGnzXoEd+hccJTOOO4dUSvp12NlH8X+7mBMQ X-Received: by 2002:a9d:3bc4:: with SMTP id k62mr19000017otc.186.1577065379027; Sun, 22 Dec 2019 17:42:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577065379; cv=none; d=google.com; s=arc-20160816; b=Y3HrEjXrUqRPi9ioHemPuWBsv3RChYnjo6Ea0XoJFrqNs4LnezK+9/aAIvWNh6mKAE jmMw3V7fx7HiEm64dskXFj8TBRjWdZ/ngQZrtS6Y4oPDcgV1v3fox/VeMZpumt6T2UMA alszGLoV+/TVaH5VVgWRI/eb+UykTQjagpC4K9pWkDeuOdOBVii6mIRXfIBqIhvQqn4h dWGlmMZGfuFGizqZfEIXiFwgCCXV0+hhG/vfwHwlPAimX50wbns2InFKE8DrSKtpVrWC j8kyceH8RbRq2s7jfo7ItM9feQ/gwT5T7Zkk42Hr3SWcvdCALRITllTDM+kmVTH2mdtf TA2A== 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=bFqvuHtUJ2uTuBGE5u3MI0p2QpGGNs+AUqkx0RpdLvY=; b=cvUZCUod3BJrMQfVDEPUja+Airs1ugQkV2Wfx5qVKRRf9lW7s2mKEXHUEeG58Itxx8 Ra8OKGOkLqZ/mghOlnuxGKAY30MpQsD7Fl0UipzZBv2pW9zBKcJusyRWwx45eSv8FjZo UAABR+LFIlLHhSCKVdGzFG+PfFZRfLwTWx42POXUM3OVG/pnth74fJMJC+0kE5b1b7zZ VDIjrfemIbjhe+6YNxcRfofudeOGZMaF+kj2DJ2j/9h0h29mPDKKPVSwXuAF4Mm1kPeQ vdlNszGg+TBWyZiBZNkqhUmKEojAWFZ/ictQaYQnv5Z2yWBikytQbzfxduFu+ZhASdC2 IIAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=aonEdzgd; 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 c2si799895oto.207.2019.12.22.17.42.48; Sun, 22 Dec 2019 17:42:59 -0800 (PST) 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=aonEdzgd; 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 S1726691AbfLWBlW (ORCPT + 99 others); Sun, 22 Dec 2019 20:41:22 -0500 Received: from smtp-fw-4101.amazon.com ([72.21.198.25]:59995 "EHLO smtp-fw-4101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbfLWBlV (ORCPT ); Sun, 22 Dec 2019 20:41:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1577065281; x=1608601281; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=bFqvuHtUJ2uTuBGE5u3MI0p2QpGGNs+AUqkx0RpdLvY=; b=aonEdzgdAY43aq2ejaICq1GPsVEWF8g6Oo7qe85toG2yWjL5gCLfrQly H5QrWg5LAmtB32BIDpoPQrmsqPSpjDn8uDWE6gxX4voYMhMl32bXz91KB AxrmGDpVHP/O/YTsuMTNxSoZp0sZZ0f+PLNDd8/7r27OosfEeW4twYxIK c=; IronPort-SDR: BmUYN/KT4CukTWURlMR5RKt7lUs2YeLprQarmys0dgraudtB9gaGwwvDTxZdiHF5m0Wva254iV QviiXeeUmMGg== X-IronPort-AV: E=Sophos;i="5.69,345,1571702400"; d="scan'208";a="9641953" 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; 23 Dec 2019 01:41:20 +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 EB2B8A22BC; Mon, 23 Dec 2019 01:41:16 +0000 (UTC) Received: from EX13D11UWC001.ant.amazon.com (10.43.162.151) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 23 Dec 2019 01:41:16 +0000 Received: from EX13MTAUEA001.ant.amazon.com (10.43.61.82) by EX13D11UWC001.ant.amazon.com (10.43.162.151) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 23 Dec 2019 01:41:15 +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; Mon, 23 Dec 2019 01:41:14 +0000 From: Balbir Singh To: <=linux-block@vger.kernel.org>, , CC: , , , , , Balbir Singh Subject: [RFC PATCH 2/5] drivers/block/virtio_blk.c: Convert to use disk_set_capacity Date: Mon, 23 Dec 2019 01:40:53 +0000 Message-ID: <20191223014056.17318-2-sblbir@amazon.com> X-Mailer: git-send-email 2.16.5 In-Reply-To: <20191223014056.17318-1-sblbir@amazon.com> References: <20191223014056.17318-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 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) -- 2.16.5