Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5657a819 authored by Joe Perches's avatar Joe Perches Committed by Jens Axboe
Browse files

block drivers/block: Use octal not symbolic permissions

Convert the S_<FOO> symbolic permissions to their octal equivalents as
using octal and not symbolic permissions is preferred by many as more
readable.

see: https://lkml.org/lkml/2016/8/2/1945



Done with automated conversion via:
$ ./scripts/checkpatch.pl -f --types=SYMBOLIC_PERMS --fix-inplace <files...>

Miscellanea:

o Wrapped modified multi-line calls to a single line where appropriate
o Realign modified multi-line calls to open parenthesis

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e6fc4649
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -333,34 +333,34 @@ static ssize_t integrity_device_show(struct blk_integrity *bi, char *page)
}

static struct integrity_sysfs_entry integrity_format_entry = {
	.attr = { .name = "format", .mode = S_IRUGO },
	.attr = { .name = "format", .mode = 0444 },
	.show = integrity_format_show,
};

static struct integrity_sysfs_entry integrity_tag_size_entry = {
	.attr = { .name = "tag_size", .mode = S_IRUGO },
	.attr = { .name = "tag_size", .mode = 0444 },
	.show = integrity_tag_size_show,
};

static struct integrity_sysfs_entry integrity_interval_entry = {
	.attr = { .name = "protection_interval_bytes", .mode = S_IRUGO },
	.attr = { .name = "protection_interval_bytes", .mode = 0444 },
	.show = integrity_interval_show,
};

static struct integrity_sysfs_entry integrity_verify_entry = {
	.attr = { .name = "read_verify", .mode = S_IRUGO | S_IWUSR },
	.attr = { .name = "read_verify", .mode = 0644 },
	.show = integrity_verify_show,
	.store = integrity_verify_store,
};

static struct integrity_sysfs_entry integrity_generate_entry = {
	.attr = { .name = "write_generate", .mode = S_IRUGO | S_IWUSR },
	.attr = { .name = "write_generate", .mode = 0644 },
	.show = integrity_generate_show,
	.store = integrity_generate_store,
};

static struct integrity_sysfs_entry integrity_device_entry = {
	.attr = { .name = "device_is_integrity_capable", .mode = S_IRUGO },
	.attr = { .name = "device_is_integrity_capable", .mode = 0444 },
	.show = integrity_device_show,
};

+3 −3
Original line number Diff line number Diff line
@@ -166,15 +166,15 @@ static struct attribute *default_ctx_attrs[] = {
};

static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_nr_tags = {
	.attr = {.name = "nr_tags", .mode = S_IRUGO },
	.attr = {.name = "nr_tags", .mode = 0444 },
	.show = blk_mq_hw_sysfs_nr_tags_show,
};
static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_nr_reserved_tags = {
	.attr = {.name = "nr_reserved_tags", .mode = S_IRUGO },
	.attr = {.name = "nr_reserved_tags", .mode = 0444 },
	.show = blk_mq_hw_sysfs_nr_reserved_tags_show,
};
static struct blk_mq_hw_ctx_sysfs_entry blk_mq_hw_sysfs_cpus = {
	.attr = {.name = "cpu_list", .mode = S_IRUGO },
	.attr = {.name = "cpu_list", .mode = 0444 },
	.show = blk_mq_hw_sysfs_cpus_show,
};

+34 −34
Original line number Diff line number Diff line
@@ -502,187 +502,187 @@ static ssize_t queue_dax_show(struct request_queue *q, char *page)
}

static struct queue_sysfs_entry queue_requests_entry = {
	.attr = {.name = "nr_requests", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "nr_requests", .mode = 0644 },
	.show = queue_requests_show,
	.store = queue_requests_store,
};

static struct queue_sysfs_entry queue_ra_entry = {
	.attr = {.name = "read_ahead_kb", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "read_ahead_kb", .mode = 0644 },
	.show = queue_ra_show,
	.store = queue_ra_store,
};

static struct queue_sysfs_entry queue_max_sectors_entry = {
	.attr = {.name = "max_sectors_kb", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "max_sectors_kb", .mode = 0644 },
	.show = queue_max_sectors_show,
	.store = queue_max_sectors_store,
};

static struct queue_sysfs_entry queue_max_hw_sectors_entry = {
	.attr = {.name = "max_hw_sectors_kb", .mode = S_IRUGO },
	.attr = {.name = "max_hw_sectors_kb", .mode = 0444 },
	.show = queue_max_hw_sectors_show,
};

static struct queue_sysfs_entry queue_max_segments_entry = {
	.attr = {.name = "max_segments", .mode = S_IRUGO },
	.attr = {.name = "max_segments", .mode = 0444 },
	.show = queue_max_segments_show,
};

static struct queue_sysfs_entry queue_max_discard_segments_entry = {
	.attr = {.name = "max_discard_segments", .mode = S_IRUGO },
	.attr = {.name = "max_discard_segments", .mode = 0444 },
	.show = queue_max_discard_segments_show,
};

static struct queue_sysfs_entry queue_max_integrity_segments_entry = {
	.attr = {.name = "max_integrity_segments", .mode = S_IRUGO },
	.attr = {.name = "max_integrity_segments", .mode = 0444 },
	.show = queue_max_integrity_segments_show,
};

static struct queue_sysfs_entry queue_max_segment_size_entry = {
	.attr = {.name = "max_segment_size", .mode = S_IRUGO },
	.attr = {.name = "max_segment_size", .mode = 0444 },
	.show = queue_max_segment_size_show,
};

static struct queue_sysfs_entry queue_iosched_entry = {
	.attr = {.name = "scheduler", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "scheduler", .mode = 0644 },
	.show = elv_iosched_show,
	.store = elv_iosched_store,
};

static struct queue_sysfs_entry queue_hw_sector_size_entry = {
	.attr = {.name = "hw_sector_size", .mode = S_IRUGO },
	.attr = {.name = "hw_sector_size", .mode = 0444 },
	.show = queue_logical_block_size_show,
};

static struct queue_sysfs_entry queue_logical_block_size_entry = {
	.attr = {.name = "logical_block_size", .mode = S_IRUGO },
	.attr = {.name = "logical_block_size", .mode = 0444 },
	.show = queue_logical_block_size_show,
};

static struct queue_sysfs_entry queue_physical_block_size_entry = {
	.attr = {.name = "physical_block_size", .mode = S_IRUGO },
	.attr = {.name = "physical_block_size", .mode = 0444 },
	.show = queue_physical_block_size_show,
};

static struct queue_sysfs_entry queue_chunk_sectors_entry = {
	.attr = {.name = "chunk_sectors", .mode = S_IRUGO },
	.attr = {.name = "chunk_sectors", .mode = 0444 },
	.show = queue_chunk_sectors_show,
};

static struct queue_sysfs_entry queue_io_min_entry = {
	.attr = {.name = "minimum_io_size", .mode = S_IRUGO },
	.attr = {.name = "minimum_io_size", .mode = 0444 },
	.show = queue_io_min_show,
};

static struct queue_sysfs_entry queue_io_opt_entry = {
	.attr = {.name = "optimal_io_size", .mode = S_IRUGO },
	.attr = {.name = "optimal_io_size", .mode = 0444 },
	.show = queue_io_opt_show,
};

static struct queue_sysfs_entry queue_discard_granularity_entry = {
	.attr = {.name = "discard_granularity", .mode = S_IRUGO },
	.attr = {.name = "discard_granularity", .mode = 0444 },
	.show = queue_discard_granularity_show,
};

static struct queue_sysfs_entry queue_discard_max_hw_entry = {
	.attr = {.name = "discard_max_hw_bytes", .mode = S_IRUGO },
	.attr = {.name = "discard_max_hw_bytes", .mode = 0444 },
	.show = queue_discard_max_hw_show,
};

static struct queue_sysfs_entry queue_discard_max_entry = {
	.attr = {.name = "discard_max_bytes", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "discard_max_bytes", .mode = 0644 },
	.show = queue_discard_max_show,
	.store = queue_discard_max_store,
};

static struct queue_sysfs_entry queue_discard_zeroes_data_entry = {
	.attr = {.name = "discard_zeroes_data", .mode = S_IRUGO },
	.attr = {.name = "discard_zeroes_data", .mode = 0444 },
	.show = queue_discard_zeroes_data_show,
};

static struct queue_sysfs_entry queue_write_same_max_entry = {
	.attr = {.name = "write_same_max_bytes", .mode = S_IRUGO },
	.attr = {.name = "write_same_max_bytes", .mode = 0444 },
	.show = queue_write_same_max_show,
};

static struct queue_sysfs_entry queue_write_zeroes_max_entry = {
	.attr = {.name = "write_zeroes_max_bytes", .mode = S_IRUGO },
	.attr = {.name = "write_zeroes_max_bytes", .mode = 0444 },
	.show = queue_write_zeroes_max_show,
};

static struct queue_sysfs_entry queue_nonrot_entry = {
	.attr = {.name = "rotational", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "rotational", .mode = 0644 },
	.show = queue_show_nonrot,
	.store = queue_store_nonrot,
};

static struct queue_sysfs_entry queue_zoned_entry = {
	.attr = {.name = "zoned", .mode = S_IRUGO },
	.attr = {.name = "zoned", .mode = 0444 },
	.show = queue_zoned_show,
};

static struct queue_sysfs_entry queue_nomerges_entry = {
	.attr = {.name = "nomerges", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "nomerges", .mode = 0644 },
	.show = queue_nomerges_show,
	.store = queue_nomerges_store,
};

static struct queue_sysfs_entry queue_rq_affinity_entry = {
	.attr = {.name = "rq_affinity", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "rq_affinity", .mode = 0644 },
	.show = queue_rq_affinity_show,
	.store = queue_rq_affinity_store,
};

static struct queue_sysfs_entry queue_iostats_entry = {
	.attr = {.name = "iostats", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "iostats", .mode = 0644 },
	.show = queue_show_iostats,
	.store = queue_store_iostats,
};

static struct queue_sysfs_entry queue_random_entry = {
	.attr = {.name = "add_random", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "add_random", .mode = 0644 },
	.show = queue_show_random,
	.store = queue_store_random,
};

static struct queue_sysfs_entry queue_poll_entry = {
	.attr = {.name = "io_poll", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "io_poll", .mode = 0644 },
	.show = queue_poll_show,
	.store = queue_poll_store,
};

static struct queue_sysfs_entry queue_poll_delay_entry = {
	.attr = {.name = "io_poll_delay", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "io_poll_delay", .mode = 0644 },
	.show = queue_poll_delay_show,
	.store = queue_poll_delay_store,
};

static struct queue_sysfs_entry queue_wc_entry = {
	.attr = {.name = "write_cache", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "write_cache", .mode = 0644 },
	.show = queue_wc_show,
	.store = queue_wc_store,
};

static struct queue_sysfs_entry queue_fua_entry = {
	.attr = {.name = "fua", .mode = S_IRUGO },
	.attr = {.name = "fua", .mode = 0444 },
	.show = queue_fua_show,
};

static struct queue_sysfs_entry queue_dax_entry = {
	.attr = {.name = "dax", .mode = S_IRUGO },
	.attr = {.name = "dax", .mode = 0444 },
	.show = queue_dax_show,
};

static struct queue_sysfs_entry queue_wb_lat_entry = {
	.attr = {.name = "wbt_lat_usec", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "wbt_lat_usec", .mode = 0644 },
	.show = queue_wb_lat_show,
	.store = queue_wb_lat_store,
};

#ifdef CONFIG_BLK_DEV_THROTTLING_LOW
static struct queue_sysfs_entry throtl_sample_time_entry = {
	.attr = {.name = "throttle_sample_time", .mode = S_IRUGO | S_IWUSR },
	.attr = {.name = "throttle_sample_time", .mode = 0644 },
	.show = blk_throtl_sample_time_show,
	.store = blk_throtl_sample_time_store,
};
+1 −1
Original line number Diff line number Diff line
@@ -4786,7 +4786,7 @@ USEC_STORE_FUNCTION(cfq_target_latency_us_store, &cfqd->cfq_target_latency, 1, U
#undef USEC_STORE_FUNCTION

#define CFQ_ATTR(name) \
	__ATTR(name, S_IRUGO|S_IWUSR, cfq_##name##_show, cfq_##name##_store)
	__ATTR(name, 0644, cfq_##name##_show, cfq_##name##_store)

static struct elv_fs_entry cfq_attrs[] = {
	CFQ_ATTR(quantum),
+1 −2
Original line number Diff line number Diff line
@@ -512,8 +512,7 @@ STORE_FUNCTION(deadline_fifo_batch_store, &dd->fifo_batch, 0, INT_MAX, 0);
#undef STORE_FUNCTION

#define DD_ATTR(name) \
	__ATTR(name, S_IRUGO|S_IWUSR, deadline_##name##_show, \
				      deadline_##name##_store)
	__ATTR(name, 0644, deadline_##name##_show, deadline_##name##_store)

static struct elv_fs_entry deadline_attrs[] = {
	DD_ATTR(read_expire),
Loading