Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2187094imm; Thu, 27 Sep 2018 08:44:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV60J81bvQ9X6WTKdd8/BcjCMLzM9YCn4EdA/IbrmZXViW1BhnuxAqOTRuyWZ3S+M8IPjAgvx X-Received: by 2002:a62:57dc:: with SMTP id i89-v6mr12173006pfj.45.1538063084151; Thu, 27 Sep 2018 08:44:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538063084; cv=none; d=google.com; s=arc-20160816; b=Czav2reF4HhPn9/dHaiqrbSvU2I53fG2JggjBi3JqLiPL2Et9lmD1n2kgwzeHdPCf6 yvkBbNautGRQTighkvSIMsmXKMKwYKlHoAfRnfCwzGkFzrATmDaQPknG05dVKY4h0fTo L4+r8g8vIfAwo1PtrjyoDsEaBuYcIP9FuVAFQsbkbHXatpZuf9jTskUhvqWkAFYVPVlq rB/huKaNxRcumvqCZuqkr+z5LhLkUX8xcM1XtV451r9pTT8gJVBGUprnhN146eLHtZ/0 cCHQFMWw96z3PfediZihCqjORekTmAlPxP42xNmqUlSd1TEb+fWiPIxGOFh0z1flCcxF GvUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=nGCr4IcZHynfOhplVjul3syVUKhxBqQWPChue95YQ3U=; b=Ln1Se9O768HXChq6CvbDFwFv3vc2uw9lKrX1kYkXi7XAREj0/el8RqGXOGYtE0oFcG tPQxEru1dG9gwG7N+rqxZJu1Tg/2oZOdL3913sCt0Q3RQua2dQhz4/6VnsJshJMM5wfh 1UQ1OoxewnSO0jrnTXPRLo3d0E/B8ATj1jDwc68mIrZQ4Kr7Qi06LAC+ZSu08VjQytxS SevGJ0MtLfE7SUsY2gZQXLIKjnrKAYJxgsUaHVgY2fuiCpfp2xRr9M8uDzsShWhAMKLc 1zsvfWE++8iPvKkL8EI8ff31XWwOm4O44KIWrlfhKCIoIWjkQRhJjLeC7jvXYlbZG9yc xtAw== ARC-Authentication-Results: i=1; mx.google.com; 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 h5-v6si2428577pfd.112.2018.09.27.08.44.28; Thu, 27 Sep 2018 08:44:44 -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; 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 S1728120AbeI0WDO (ORCPT + 99 others); Thu, 27 Sep 2018 18:03:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:60386 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727212AbeI0WDN (ORCPT ); Thu, 27 Sep 2018 18:03:13 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 56662ACB8; Thu, 27 Sep 2018 15:44:21 +0000 (UTC) Subject: Re: [PATCH] use STORE_LOCKED instead of STORE macro To: Dongbo Cao Cc: kent.overstreet@gmail.com, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180927053142.4529-1-cdbdyx@163.com> From: Coly Li Message-ID: <4e1bb3e5-82f2-51ff-c95b-fa76da4081da@suse.de> Date: Thu, 27 Sep 2018 23:44:16 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180927053142.4529-1-cdbdyx@163.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/27/18 1:31 PM, Dongbo Cao wrote: > merge sysfs_writeback_running attr and sysfs_writeback_percent attr together with other attrs of cached_dev. > > Signed-off-by: Dongbo Cao Could you please to explain more what you want to do, and why you make this change? Thanks. Coly Li > --- > drivers/md/bcache/sysfs.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c > index 26f035a0..14fc9104 100644 > --- a/drivers/md/bcache/sysfs.c > +++ b/drivers/md/bcache/sysfs.c > @@ -245,7 +245,7 @@ SHOW(__bch_cached_dev) > } > SHOW_LOCKED(bch_cached_dev) > > -STORE(__cached_dev) > +STORE(__bch_cached_dev) > { > struct cached_dev *dc = container_of(kobj, struct cached_dev, > disk.kobj); > @@ -373,17 +373,6 @@ STORE(__cached_dev) > if (attr == &sysfs_stop) > bcache_device_stop(&dc->disk); > > - return size; > -} > - > -STORE(bch_cached_dev) > -{ > - struct cached_dev *dc = container_of(kobj, struct cached_dev, > - disk.kobj); > - > - mutex_lock(&bch_register_lock); > - size = __cached_dev_store(kobj, attr, buf, size); > - > if (attr == &sysfs_writeback_running) > bch_writeback_queue(dc); > > @@ -392,9 +381,9 @@ STORE(bch_cached_dev) > schedule_delayed_work(&dc->writeback_rate_update, > dc->writeback_rate_update_seconds * HZ); > > - mutex_unlock(&bch_register_lock); > return size; > } > +STORE_LOCKED(bch_cached_dev) > > static struct attribute *bch_cached_dev_files[] = { > &sysfs_attach,