Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp426438imu; Fri, 21 Dec 2018 01:18:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Tq3QrWbMPl1v+NxYUVgWU7J+gr4YK6JmeenG0PMaxrqmaZtHhMFwAfDP8LcU9QCaoDozh X-Received: by 2002:a63:ce50:: with SMTP id r16mr1601145pgi.217.1545383909464; Fri, 21 Dec 2018 01:18:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545383909; cv=none; d=google.com; s=arc-20160816; b=mthyt/CPim3sSwX25gAyi904lDHiwiiBXcKcj2G9snmYAYweAB6c1600WO9YxU2ybs CcUmpcJFtAoNr1qmzbXsyq8iRyuL1uyLUUYuuSbVTXIRPQnTWVHgb4/UoJPR9v7awFe7 dDLG/8bwib818691k70YbXdP5+A0fty7jEas9wUuBgIYpIcts6lwLbjJ1GffPPvz62NE +gkcYjMCwedFuYG+MZhxRPvnpPqthBvXnHFlTdh/3ITz6HOnING0ctau3AfVvfqMNBFg ABTtGhAxKVjMwhOd2i+FrtZrHmLY/ScOKR/Gh3MTn++xYR+jzYGQMJ9z039NlQMdExvm Is6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kXx9fLc1glBwJ149To2Sc+E/RyNL2szTQIVGLK/D8xg=; b=w+WT4DtEL6orMyzaB+j/jv76a1KyUPPR9T33PW2avTa1TCRCLHYkTgs8zte/u13xm1 yQWpMMmuyw+YPsbYsJJTS7oC5ReP7imSUfPMRCFMn033uBmQcyvSXtnbkz7jctKoZIkR d48Kh38FtBLlfJ1sZ89Z5h3ne/4GUtwRNLyOkwY5aOAnEiYlWmKCCz8iS1MdbH7ZunTr KXGgU+jgmf/hb9TXuutLOdhCNof9Y4WSdDzA6S+lbpKt26KKdT+yOKtVPwcBL3S8AOq/ 2TtFZ8PLaLDzwSSWusbdRFGRdL/+c6iCkrHBcm6TCr1TkEhUULtMaLgt/k0dq9aLJTQO uTJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GOafNGrO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id gn8si19699934plb.264.2018.12.21.01.18.13; Fri, 21 Dec 2018 01:18:29 -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=@kernel.org header.s=default header.b=GOafNGrO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733043AbeLUHzK (ORCPT + 99 others); Fri, 21 Dec 2018 02:55:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:59424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732951AbeLUHzH (ORCPT ); Fri, 21 Dec 2018 02:55:07 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 03DCE21908; Fri, 21 Dec 2018 07:55:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545378906; bh=I36HAMjnO2LdIfKY9tYmV2N1zf7D9RSyuEpNzKq4EYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GOafNGrONb6WpsWqVc9VrZLDNa3fqDnf3DEuglYpkEFotA3Ky3wH1D8/ZlZcV1C+H fCjMbdn30oJx8nzrhCmFwpw5hFxYHetEIKPyqioGBmhOKBGQXrkbXdRiXKGur9O4Eq RzMYmrZ9p9wVyIJRIwTJ9fBm6arHXj7gb6BRUDZs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Ilya Dryomov , Sage Weil , Alex Elder , Jens Axboe Subject: [PATCH 06/10] block: rbd: convert to use BUS_ATTR_WO and RO Date: Fri, 21 Dec 2018 08:54:38 +0100 Message-Id: <20181221075442.17109-7-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181221075442.17109-1-gregkh@linuxfoundation.org> References: <20181221075442.17109-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are trying to get rid of BUS_ATTR() and the usage of that in rbd.c can be trivially converted to use BUS_ATTR_WO and RO, so use those macros instead. Cc: Ilya Dryomov Cc: Sage Weil Cc: Alex Elder Cc: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/block/rbd.c | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8e5140bbf241..d871d364fdcf 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -428,14 +428,13 @@ static bool single_major = true; module_param(single_major, bool, 0444); MODULE_PARM_DESC(single_major, "Use a single major number for all rbd devices (default: true)"); -static ssize_t rbd_add(struct bus_type *bus, const char *buf, - size_t count); -static ssize_t rbd_remove(struct bus_type *bus, const char *buf, - size_t count); -static ssize_t rbd_add_single_major(struct bus_type *bus, const char *buf, - size_t count); -static ssize_t rbd_remove_single_major(struct bus_type *bus, const char *buf, - size_t count); +static ssize_t add_store(struct bus_type *bus, const char *buf, size_t count); +static ssize_t remove_store(struct bus_type *bus, const char *buf, + size_t count); +static ssize_t add_single_major_store(struct bus_type *bus, const char *buf, + size_t count); +static ssize_t remove_single_major_store(struct bus_type *bus, const char *buf, + size_t count); static int rbd_dev_image_probe(struct rbd_device *rbd_dev, int depth); static int rbd_dev_id_to_minor(int dev_id) @@ -464,16 +463,16 @@ static bool rbd_is_lock_owner(struct rbd_device *rbd_dev) return is_lock_owner; } -static ssize_t rbd_supported_features_show(struct bus_type *bus, char *buf) +static ssize_t supported_features_show(struct bus_type *bus, char *buf) { return sprintf(buf, "0x%llx\n", RBD_FEATURES_SUPPORTED); } -static BUS_ATTR(add, 0200, NULL, rbd_add); -static BUS_ATTR(remove, 0200, NULL, rbd_remove); -static BUS_ATTR(add_single_major, 0200, NULL, rbd_add_single_major); -static BUS_ATTR(remove_single_major, 0200, NULL, rbd_remove_single_major); -static BUS_ATTR(supported_features, 0444, rbd_supported_features_show, NULL); +static BUS_ATTR_WO(add); +static BUS_ATTR_WO(remove); +static BUS_ATTR_WO(add_single_major); +static BUS_ATTR_WO(remove_single_major); +static BUS_ATTR_RO(supported_features); static struct attribute *rbd_bus_attrs[] = { &bus_attr_add.attr, @@ -5934,9 +5933,7 @@ static ssize_t do_rbd_add(struct bus_type *bus, goto out; } -static ssize_t rbd_add(struct bus_type *bus, - const char *buf, - size_t count) +static ssize_t add_store(struct bus_type *bus, const char *buf, size_t count) { if (single_major) return -EINVAL; @@ -5944,9 +5941,8 @@ static ssize_t rbd_add(struct bus_type *bus, return do_rbd_add(bus, buf, count); } -static ssize_t rbd_add_single_major(struct bus_type *bus, - const char *buf, - size_t count) +static ssize_t add_single_major_store(struct bus_type *bus, const char *buf, + size_t count) { return do_rbd_add(bus, buf, count); } @@ -6050,9 +6046,7 @@ static ssize_t do_rbd_remove(struct bus_type *bus, return count; } -static ssize_t rbd_remove(struct bus_type *bus, - const char *buf, - size_t count) +static ssize_t remove_store(struct bus_type *bus, const char *buf, size_t count) { if (single_major) return -EINVAL; @@ -6060,9 +6054,8 @@ static ssize_t rbd_remove(struct bus_type *bus, return do_rbd_remove(bus, buf, count); } -static ssize_t rbd_remove_single_major(struct bus_type *bus, - const char *buf, - size_t count) +static ssize_t remove_single_major_store(struct bus_type *bus, const char *buf, + size_t count) { return do_rbd_remove(bus, buf, count); } -- 2.20.1