From: Dongbo Cao <cdbdyx@163.com>
To: colyli@suse.de
Cc: kent.overstreet@gmail.com, linux-bcache@vger.kernel.org,
linux-kernel@vger.kernel.org, Dongbo Cao <cdbdyx@163.com>
Subject: [PATCH] use STORE_LOCKED instead of STORE macro
Date: Thu, 27 Sep 2018 13:31:42 +0800 [thread overview]
Message-ID: <20180927053142.4529-1-cdbdyx@163.com> (raw)
merge sysfs_writeback_running attr and sysfs_writeback_percent attr together with other attrs of cached_dev.
Signed-off-by: Dongbo Cao <cdbdyx@163.com>
---
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
next reply other threads:[~2018-09-27 5:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-27 5:31 Dongbo Cao [this message]
2018-09-27 15:44 ` [PATCH] use STORE_LOCKED instead of STORE macro Coly Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180927053142.4529-1-cdbdyx@163.com \
--to=cdbdyx@163.com \
--cc=colyli@suse.de \
--cc=kent.overstreet@gmail.com \
--cc=linux-bcache@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox