Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp820000imu; Fri, 21 Dec 2018 07:55:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6bwXDuCcJZey5cJMRaDtvZqk7Tvbiacqo6tQTlSfZAu4BiSeU7BXSKTvTPamaHGmRRJU6r X-Received: by 2002:a63:c00b:: with SMTP id h11mr2946052pgg.429.1545407705174; Fri, 21 Dec 2018 07:55:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545407705; cv=none; d=google.com; s=arc-20160816; b=IIMJv3ee3o2mOb7+uX/pEqsFomhhWUBaRr3j8HZnWg5KQe3oSVCSVWrKiuUU8UWxNH cKTDkkSEGreDaGeu2vdZJM2z8wPtIqTjTFz4/sbVO8c/5HbPoYClYz6MeFTIaZcK9UrQ MrX0Y8Ol3meyfXmXzfGsY+r80oUXukcaGDSsmEi5ETzcUm0xxS7IH3cZPsv3cRHEjo2F 6Krs41tsNBadI53ZtDeh70uJ7hpvofpGJZ/PgaC6s1K2a/plxufk9YvjpeEW3YaNJWty DtOOU7VLP/ovG5Q5xgLqSm0Z3vWq4tWjn7LL2VlfGYs8i6IixJKK8nsDsmBkESkReZ26 mC8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bInkCh3vUiFCq9C3gpAc0IBU3JBsd9a1+6vvSMxsWLE=; b=rhfOmXYzfogim+D8wORrZ86YeUJKXx+6g9teOiJlmFII0kU0HdcRJaI68tsI6TQKzu USAO4vQSmkKhrWCv7A3yRk6c2/63TtV4SWa7Kkxawffi5l0/lwrl43eKOv7MRwQxD/Z7 pYoC7cB3bEciCJGUqISIUXfga3vJW+7Kfu2o0eSGV2W0FQCvjDa56mdYcmyGY7XzXqiJ bgPI4UubwFnz5iz0C7YF741nXCwU79gNnPWcbVtDG6pt9Kb3G6o8Qzn02Cb8U4Q3isN5 oJD8K3/BTwxhh1O7a3N2tlzptVkLEl6VZOHIsBQIjhSjE8LL6vfSscYpPMXvFXHm72EG E5xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Hyoizdan; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 88si21436185plb.288.2018.12.21.07.54.49; Fri, 21 Dec 2018 07:55:05 -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=@gmail.com header.s=20161025 header.b=Hyoizdan; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732540AbeLUJ2x (ORCPT + 99 others); Fri, 21 Dec 2018 04:28:53 -0500 Received: from mail-it1-f196.google.com ([209.85.166.196]:35094 "EHLO mail-it1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732235AbeLUJ2w (ORCPT ); Fri, 21 Dec 2018 04:28:52 -0500 Received: by mail-it1-f196.google.com with SMTP id p197so5727438itp.0 for ; Fri, 21 Dec 2018 01:28:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bInkCh3vUiFCq9C3gpAc0IBU3JBsd9a1+6vvSMxsWLE=; b=Hyoizdan++QLb4u6jryHrJmbtlifz4QZrUstzmmZR0SQ4VuRPXQo/zNOtHEo4IDeGz lLDAJ6c70AdbKpSMIJzI8n0Kx7G7VGi1rNwKYdXbAVBHGikyRP7sqc9u2fICHYrvzMq1 wZz6fUsxfy9CKBPLWEI8nEChoqTSYwXUI3V/Et1kSg3OdIfmFHFAZN1QnX6JISQOdHKg Bt+Xr8Zxw3oN5jzDUBJfES3DzQ+XnJkMPPynlPlId8m0TJONOoL0EgB1ekVeQPNEB2W2 TpeMSiucsUU5c0t00t2tsSqI6OwZFuRufE9dQ1Djka0C/K/Kz046CcmZUUGYVAajPe8B MiiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bInkCh3vUiFCq9C3gpAc0IBU3JBsd9a1+6vvSMxsWLE=; b=jgnI8Edr25SFNwMFL9NGrrnpcXRYxm2+RUUUQxn62fLpkVO3m5OMvqrpBAvdRTfXEM TeO4vhdVrVoOVcmRBpUPyzcfl357sLLVHzg6EVMNNF6x9UqivPSn2Vmj5Ui9R/yWU1Si 93SxomQFuuGPxJE5UrxWy+5mDdcoSIu3xnBAZ4DkiKkVMTpbaobHEmyC5Itm/PGnWkzq /2LLZFKVIEhCHk+bz4h9BlAQO4DLoftw1lZQXQl5byuc5eOs9s+jmG5fExx85T9uyqSk lTAbrBlmH/yI2uHyPZIdVraqENkLrp0dRIlMmJOK6MPRffs6Gri6/C5uGSqAGJhQPbSh GOvg== X-Gm-Message-State: AJcUukftLayxc6O1KNaf0usb5RcDZG0/FlILpsh5FAOt/bYz1mw2Rqpd ZAGH/IFZBD202rXKuUea2rtWoLgMeC5ilWhtN6c= X-Received: by 2002:a24:d745:: with SMTP id y66mr1268966itg.18.1545384531764; Fri, 21 Dec 2018 01:28:51 -0800 (PST) MIME-Version: 1.0 References: <20181221075442.17109-1-gregkh@linuxfoundation.org> <20181221075442.17109-7-gregkh@linuxfoundation.org> In-Reply-To: <20181221075442.17109-7-gregkh@linuxfoundation.org> From: Ilya Dryomov Date: Fri, 21 Dec 2018 10:28:48 +0100 Message-ID: Subject: Re: [PATCH 06/10] block: rbd: convert to use BUS_ATTR_WO and RO To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Sage Weil , Alex Elder , Jens Axboe Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 21, 2018 at 8:55 AM Greg Kroah-Hartman wrote: > > 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); > } Acked-by: Ilya Dryomov Thanks, Ilya