Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1606114imm; Wed, 26 Sep 2018 22:48:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV62EhV0yDSoxJAl3KCVjuxfYpvYGA/KbLinG5L7705RdTCLGJ22ikANExmNOV2tpsQLNwoFm X-Received: by 2002:a63:4907:: with SMTP id w7-v6mr8493825pga.123.1538027312625; Wed, 26 Sep 2018 22:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538027312; cv=none; d=google.com; s=arc-20160816; b=LxIkqlBF2Q6VbZTVZ3nVR1o4g+sozqRfrxd/w6oLl6AbXTlmRwUCGxEuG0QpVOBG/R 5jAg+xkWd0KOVmcAcB4EHbY0CZOq8jJ9ShVnbNDLedEQ4xjpA3t8QbZFz4811b5dlJU0 X/q7ZVE2sFuZqqL27Zc8cWMNHbVSR8KuKAyCW0lBTOKyUXS2iZlRTb/AsAFTxsKBxL4n 73RYnczaaGhGwNP1aHZ594xNxev+EhSKl6a+D11jkEmowhvtANrPka6H7jRHe6E8Z+ca mqB2AUnCSInZ03Hlht+WVFRT9DpC2pNsTsMXPpNQlB8BlP9aca8ElUkKeR7HXQu5UmRl BjZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=5jptIBbRoobIYB9XwcoNGKN3nXvvhvJz+7d4p3gMULE=; b=hclBwstPanq+tQhP25QoXEsNFWsWjMwXVXYmgT9sUggmNAAHtK4fTYqwFvbmS9z8Wh LyYxUTsxwHDuCifQvHwC0yXIipNUnwtzcDgbJBswqZvI5qcDswypVJRoqtr2OwqBB08P VUfIHgtfkXatHTZrfVdYiVczkLRPC262/j1FzaBjHgC7ha0F6eSk6j/Mn8/965AnSl3K u9yO+UkUtTfJ2gTQpdNe0gNqH7+wKdMDHUS4fJmiBtl+2kWWwVU9incvbgFHmfWp9ILw 897i1k4K8MeQciy+CkEHm2bpPAKK8eyADdZpdnFf81r5fMo5okEKpO3REzje115Jrn5t 8OEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=hU8AS20U; 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 e62-v6si1286739pfe.31.2018.09.26.22.48.17; Wed, 26 Sep 2018 22:48:32 -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=@163.com header.s=s110527 header.b=hU8AS20U; 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 S1727200AbeI0MEP (ORCPT + 99 others); Thu, 27 Sep 2018 08:04:15 -0400 Received: from m50-132.163.com ([123.125.50.132]:36332 "EHLO m50-132.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726687AbeI0MEP (ORCPT ); Thu, 27 Sep 2018 08:04:15 -0400 X-Greylist: delayed 914 seconds by postgrey-1.27 at vger.kernel.org; Thu, 27 Sep 2018 08:04:13 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=5jptIBbRoobIYB9Xwc oNGKN3nXvvhvJz+7d4p3gMULE=; b=hU8AS20Umv+3J2s9ZKc5o+yPGg9LoYs7x2 sAH6iNiZuTV1gA1Dcog8ODfqapEE0L7Cwi34VsJmdKjOgAQwX3xER1+RkY19UtDQ bM4Q5RU+R5Mvv9TmPaRi56MwZNUe7j7Chlx1vNhYC4NKUKXiYvhN3QYk0JwTvpcl ON25yI4YE= Received: from localhost.localdomain (unknown [117.136.0.186]) by smtp2 (Coremail) with SMTP id DNGowACniYRBa6xb7TQmAA--.140S4; Thu, 27 Sep 2018 13:31:58 +0800 (CST) From: Dongbo Cao To: colyli@suse.de Cc: kent.overstreet@gmail.com, linux-bcache@vger.kernel.org, linux-kernel@vger.kernel.org, Dongbo Cao Subject: [PATCH] use STORE_LOCKED instead of STORE macro Date: Thu, 27 Sep 2018 13:31:42 +0800 Message-Id: <20180927053142.4529-1-cdbdyx@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: DNGowACniYRBa6xb7TQmAA--.140S4 X-Coremail-Antispam: 1Uf129KBjvJXoW7Zr1DZFW3Wr4DXFyxAr4xZwb_yoW8GF48pF ZxWFy7t34vqw40y398CF12gFyrA3yUXasFgw4rA3W09a4kWF17CayUta4FvrW8ArZruayx Ar4UKrs8WF4qkaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UJxhJUUUUU= X-Originating-IP: [117.136.0.186] X-CM-SenderInfo: xfgev5r06rljoofrz/1tbiJR-O3FUMNGb7mQAAsB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org merge sysfs_writeback_running attr and sysfs_writeback_percent attr together with other attrs of cached_dev. Signed-off-by: Dongbo Cao --- 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, -- 2.17.1