Coly Li
e4db37fb69
bcache: add sysfs_strtoul_bool() for setting bit-field variables
...
When setting bool values via sysfs interface, e.g. writeback_metadata,
if writing 1 into writeback_metadata file, dc->writeback_metadata is
set to 1, but if writing 2 into the file, dc->writeback_metadata is
0. This is misleading, a better result should be 1 for all non-zero
input value.
It is because dc->writeback_metadata is a bit-field variable, and
current code simply use d_strtoul() to convert a string into integer
and takes the lowest bit value. To fix such error, we need a routine
to convert the input string into unsigned integer, and set target
variable to 1 if the converted integer is non-zero.
This patch introduces a new macro called sysfs_strtoul_bool(), it can
be used to convert input string into bool value, we can use it to set
bool value for bit-field vairables.
Signed-off-by: Coly Li <colyli@suse.de >
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2019-02-09 07:18:32 -07:00
..
2019-02-09 07:18:32 -07:00
2018-08-01 15:49:38 -07:00
2018-06-08 11:53:14 -04:00
2017-06-09 09:27:32 -06:00
2018-06-08 11:53:14 -04:00
2017-03-07 11:30:16 -05:00
2017-08-23 12:49:55 -06:00
2018-12-28 16:55:46 -08:00
2017-11-02 11:10:55 +01:00
2018-04-30 15:40:40 -04:00
2017-03-07 13:28:31 -05:00
2016-12-16 00:13:41 +02:00
2018-12-07 16:04:09 -05:00
2017-03-07 13:28:31 -05:00
2017-03-07 13:28:31 -05:00
2018-10-16 14:34:59 -04:00
2017-03-07 13:28:31 -05:00
2018-10-09 13:53:03 -04:00
2018-12-19 09:13:34 -07:00
2019-01-10 15:17:33 -05:00
2018-12-18 09:02:26 -05:00
2018-04-03 15:04:10 -04:00
2015-11-04 21:19:53 -08:00
2016-01-08 20:03:05 -05:00
2018-12-18 09:02:27 -05:00
2018-12-28 16:55:46 -08:00
2018-06-05 08:47:43 -06:00
2018-10-18 11:54:07 -04:00
2018-12-18 09:02:26 -05:00
2018-12-18 09:02:26 -05:00
2018-05-30 15:33:32 -06:00
2015-04-15 12:10:20 -04:00
2018-05-22 23:18:31 -07:00
2016-11-01 09:43:26 -06:00
2018-12-18 09:02:25 -05:00
2016-02-22 22:34:42 -05:00
2018-01-29 13:44:58 -05:00
2018-12-18 09:02:26 -05:00
2018-12-18 13:48:35 -05:00
2018-06-12 18:28:00 -07:00
2017-02-17 00:54:09 -05:00
2018-12-18 09:02:27 -05:00
2018-10-11 11:36:09 -04:00
2018-01-29 13:44:58 -05:00
2018-04-03 15:04:23 -04:00
2016-01-08 20:03:05 -05:00
2018-12-18 09:02:26 -05:00
2018-12-28 12:11:47 -08:00
2017-11-02 11:10:55 +01:00
2018-05-22 23:18:31 -07:00
2018-06-12 16:19:22 -07:00
2018-10-11 11:36:09 -04:00
2018-12-18 14:23:41 -05:00
2018-04-03 15:04:15 -04:00
2019-01-15 16:10:41 -05:00
2019-01-15 16:10:41 -05:00
2019-01-15 16:10:41 -05:00
2018-12-18 09:02:26 -05:00
2018-09-14 14:08:52 +08:00
2018-05-30 15:33:32 -06:00
2018-12-18 09:02:27 -05:00
2018-04-03 15:04:29 -04:00
2018-12-18 09:02:26 -05:00
2017-06-09 09:27:32 -06:00
2018-10-18 15:17:03 -04:00
2018-07-31 17:33:21 -04:00
2018-12-07 16:04:31 -05:00
2017-06-19 11:05:20 -04:00
2019-01-22 13:41:48 -05:00
2018-10-11 11:36:09 -04:00
2018-10-11 11:36:09 -04:00
2018-06-08 11:59:51 -04:00
2018-10-10 11:03:34 -07:00
2018-08-01 15:49:39 -07:00
2018-10-18 09:41:25 -07:00
2018-10-18 09:36:35 -07:00
2018-05-30 15:33:32 -06:00
2019-02-04 10:37:11 -08:00
2017-11-14 16:07:26 -08:00
2018-06-12 16:19:22 -07:00
2018-05-30 15:33:32 -06:00
2019-01-14 06:31:56 -07:00
2018-10-18 09:34:56 -07:00
2018-12-07 22:26:37 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2019-02-04 10:37:11 -08:00
2018-05-30 15:33:32 -06:00
2018-10-10 10:45:15 -07:00
2018-08-31 17:38:09 -07:00
2018-05-30 15:33:32 -06:00
2018-09-28 11:13:15 -07:00
2018-06-09 12:01:36 -07:00
2018-12-20 08:53:24 -08:00
2018-05-30 15:33:32 -06:00