diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-14 17:44:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-14 17:44:04 -0500 |
commit | abc36be236358162202e86ad88616ff95a755101 (patch) | |
tree | cbb14c01e837fa2c82fb271337e333a5e393b850 /fs | |
parent | f14fc0ccee5521e5b38cdd1df4385d32c6e1805b (diff) | |
parent | 6ace4f6bbcfde70278a33c11443ecda3ed0ec1b6 (diff) |
Merge tag 'configfs-for-4.15' of git://git.infradead.org/users/hch/configfs
Pull configfs updates from Christoph Hellwig:
"A couple of configfs cleanups:
- proper use of the bool type (Thomas Meyer)
- constification of struct config_item_type (Bhumika Goyal)"
* tag 'configfs-for-4.15' of git://git.infradead.org/users/hch/configfs:
RDMA/cma: make config_item_type const
stm class: make config_item_type const
ACPI: configfs: make config_item_type const
nvmet: make config_item_type const
usb: gadget: configfs: make config_item_type const
PCI: endpoint: make config_item_type const
iio: make function argument and some structures const
usb: gadget: make config_item_type structures const
dlm: make config_item_type const
netconsole: make config_item_type const
nullb: make config_item_type const
ocfs2/cluster: make config_item_type const
target: make config_item_type const
configfs: make ci_type field, some pointers and function arguments const
configfs: make config_item_type const
configfs: Fix bool initialization/comparison
Diffstat (limited to 'fs')
-rw-r--r-- | fs/configfs/dir.c | 10 | ||||
-rw-r--r-- | fs/configfs/file.c | 12 | ||||
-rw-r--r-- | fs/configfs/item.c | 6 | ||||
-rw-r--r-- | fs/configfs/symlink.c | 4 | ||||
-rw-r--r-- | fs/dlm/config.c | 16 | ||||
-rw-r--r-- | fs/ocfs2/cluster/heartbeat.c | 4 | ||||
-rw-r--r-- | fs/ocfs2/cluster/nodemanager.c | 8 |
7 files changed, 30 insertions, 30 deletions
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 56fb26127fef..577cff24707b 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -584,7 +584,7 @@ static void detach_attrs(struct config_item * item) | |||
584 | 584 | ||
585 | static int populate_attrs(struct config_item *item) | 585 | static int populate_attrs(struct config_item *item) |
586 | { | 586 | { |
587 | struct config_item_type *t = item->ci_type; | 587 | const struct config_item_type *t = item->ci_type; |
588 | struct configfs_attribute *attr; | 588 | struct configfs_attribute *attr; |
589 | struct configfs_bin_attribute *bin_attr; | 589 | struct configfs_bin_attribute *bin_attr; |
590 | int error = 0; | 590 | int error = 0; |
@@ -901,7 +901,7 @@ static void configfs_detach_group(struct config_item *item) | |||
901 | static void client_disconnect_notify(struct config_item *parent_item, | 901 | static void client_disconnect_notify(struct config_item *parent_item, |
902 | struct config_item *item) | 902 | struct config_item *item) |
903 | { | 903 | { |
904 | struct config_item_type *type; | 904 | const struct config_item_type *type; |
905 | 905 | ||
906 | type = parent_item->ci_type; | 906 | type = parent_item->ci_type; |
907 | BUG_ON(!type); | 907 | BUG_ON(!type); |
@@ -920,7 +920,7 @@ static void client_disconnect_notify(struct config_item *parent_item, | |||
920 | static void client_drop_item(struct config_item *parent_item, | 920 | static void client_drop_item(struct config_item *parent_item, |
921 | struct config_item *item) | 921 | struct config_item *item) |
922 | { | 922 | { |
923 | struct config_item_type *type; | 923 | const struct config_item_type *type; |
924 | 924 | ||
925 | type = parent_item->ci_type; | 925 | type = parent_item->ci_type; |
926 | BUG_ON(!type); | 926 | BUG_ON(!type); |
@@ -1260,7 +1260,7 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode | |||
1260 | struct config_item *parent_item; | 1260 | struct config_item *parent_item; |
1261 | struct configfs_subsystem *subsys; | 1261 | struct configfs_subsystem *subsys; |
1262 | struct configfs_dirent *sd; | 1262 | struct configfs_dirent *sd; |
1263 | struct config_item_type *type; | 1263 | const struct config_item_type *type; |
1264 | struct module *subsys_owner = NULL, *new_item_owner = NULL; | 1264 | struct module *subsys_owner = NULL, *new_item_owner = NULL; |
1265 | char *name; | 1265 | char *name; |
1266 | 1266 | ||
@@ -1810,7 +1810,7 @@ EXPORT_SYMBOL(configfs_unregister_group); | |||
1810 | struct config_group * | 1810 | struct config_group * |
1811 | configfs_register_default_group(struct config_group *parent_group, | 1811 | configfs_register_default_group(struct config_group *parent_group, |
1812 | const char *name, | 1812 | const char *name, |
1813 | struct config_item_type *item_type) | 1813 | const struct config_item_type *item_type) |
1814 | { | 1814 | { |
1815 | int ret; | 1815 | int ret; |
1816 | struct config_group *group; | 1816 | struct config_group *group; |
diff --git a/fs/configfs/file.c b/fs/configfs/file.c index 39da1103d341..62580dba3552 100644 --- a/fs/configfs/file.c +++ b/fs/configfs/file.c | |||
@@ -166,7 +166,7 @@ configfs_read_bin_file(struct file *file, char __user *buf, | |||
166 | retval = -ETXTBSY; | 166 | retval = -ETXTBSY; |
167 | goto out; | 167 | goto out; |
168 | } | 168 | } |
169 | buffer->read_in_progress = 1; | 169 | buffer->read_in_progress = true; |
170 | 170 | ||
171 | if (buffer->needs_read_fill) { | 171 | if (buffer->needs_read_fill) { |
172 | /* perform first read with buf == NULL to get extent */ | 172 | /* perform first read with buf == NULL to get extent */ |
@@ -325,7 +325,7 @@ configfs_write_bin_file(struct file *file, const char __user *buf, | |||
325 | len = -ETXTBSY; | 325 | len = -ETXTBSY; |
326 | goto out; | 326 | goto out; |
327 | } | 327 | } |
328 | buffer->write_in_progress = 1; | 328 | buffer->write_in_progress = true; |
329 | 329 | ||
330 | /* buffer grows? */ | 330 | /* buffer grows? */ |
331 | if (*ppos + count > buffer->bin_buffer_size) { | 331 | if (*ppos + count > buffer->bin_buffer_size) { |
@@ -429,8 +429,8 @@ static int check_perm(struct inode * inode, struct file * file, int type) | |||
429 | } | 429 | } |
430 | mutex_init(&buffer->mutex); | 430 | mutex_init(&buffer->mutex); |
431 | buffer->needs_read_fill = 1; | 431 | buffer->needs_read_fill = 1; |
432 | buffer->read_in_progress = 0; | 432 | buffer->read_in_progress = false; |
433 | buffer->write_in_progress = 0; | 433 | buffer->write_in_progress = false; |
434 | buffer->ops = ops; | 434 | buffer->ops = ops; |
435 | file->private_data = buffer; | 435 | file->private_data = buffer; |
436 | goto Done; | 436 | goto Done; |
@@ -488,10 +488,10 @@ static int configfs_release_bin_file(struct inode *inode, struct file *filp) | |||
488 | ssize_t len = 0; | 488 | ssize_t len = 0; |
489 | int ret; | 489 | int ret; |
490 | 490 | ||
491 | buffer->read_in_progress = 0; | 491 | buffer->read_in_progress = false; |
492 | 492 | ||
493 | if (buffer->write_in_progress) { | 493 | if (buffer->write_in_progress) { |
494 | buffer->write_in_progress = 0; | 494 | buffer->write_in_progress = false; |
495 | 495 | ||
496 | len = bin_attr->write(item, buffer->bin_buffer, | 496 | len = bin_attr->write(item, buffer->bin_buffer, |
497 | buffer->bin_buffer_size); | 497 | buffer->bin_buffer_size); |
diff --git a/fs/configfs/item.c b/fs/configfs/item.c index a66f6624d899..88f266efc09b 100644 --- a/fs/configfs/item.c +++ b/fs/configfs/item.c | |||
@@ -113,7 +113,7 @@ EXPORT_SYMBOL(config_item_set_name); | |||
113 | 113 | ||
114 | void config_item_init_type_name(struct config_item *item, | 114 | void config_item_init_type_name(struct config_item *item, |
115 | const char *name, | 115 | const char *name, |
116 | struct config_item_type *type) | 116 | const struct config_item_type *type) |
117 | { | 117 | { |
118 | config_item_set_name(item, "%s", name); | 118 | config_item_set_name(item, "%s", name); |
119 | item->ci_type = type; | 119 | item->ci_type = type; |
@@ -122,7 +122,7 @@ void config_item_init_type_name(struct config_item *item, | |||
122 | EXPORT_SYMBOL(config_item_init_type_name); | 122 | EXPORT_SYMBOL(config_item_init_type_name); |
123 | 123 | ||
124 | void config_group_init_type_name(struct config_group *group, const char *name, | 124 | void config_group_init_type_name(struct config_group *group, const char *name, |
125 | struct config_item_type *type) | 125 | const struct config_item_type *type) |
126 | { | 126 | { |
127 | config_item_set_name(&group->cg_item, "%s", name); | 127 | config_item_set_name(&group->cg_item, "%s", name); |
128 | group->cg_item.ci_type = type; | 128 | group->cg_item.ci_type = type; |
@@ -148,7 +148,7 @@ EXPORT_SYMBOL(config_item_get_unless_zero); | |||
148 | 148 | ||
149 | static void config_item_cleanup(struct config_item *item) | 149 | static void config_item_cleanup(struct config_item *item) |
150 | { | 150 | { |
151 | struct config_item_type *t = item->ci_type; | 151 | const struct config_item_type *t = item->ci_type; |
152 | struct config_group *s = item->ci_group; | 152 | struct config_group *s = item->ci_group; |
153 | struct config_item *parent = item->ci_parent; | 153 | struct config_item *parent = item->ci_parent; |
154 | 154 | ||
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c index c8aabba502f6..78ffc2699993 100644 --- a/fs/configfs/symlink.c +++ b/fs/configfs/symlink.c | |||
@@ -138,7 +138,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna | |||
138 | struct configfs_dirent *sd; | 138 | struct configfs_dirent *sd; |
139 | struct config_item *parent_item; | 139 | struct config_item *parent_item; |
140 | struct config_item *target_item = NULL; | 140 | struct config_item *target_item = NULL; |
141 | struct config_item_type *type; | 141 | const struct config_item_type *type; |
142 | 142 | ||
143 | sd = dentry->d_parent->d_fsdata; | 143 | sd = dentry->d_parent->d_fsdata; |
144 | /* | 144 | /* |
@@ -186,7 +186,7 @@ int configfs_unlink(struct inode *dir, struct dentry *dentry) | |||
186 | struct configfs_dirent *sd = dentry->d_fsdata; | 186 | struct configfs_dirent *sd = dentry->d_fsdata; |
187 | struct configfs_symlink *sl; | 187 | struct configfs_symlink *sl; |
188 | struct config_item *parent_item; | 188 | struct config_item *parent_item; |
189 | struct config_item_type *type; | 189 | const struct config_item_type *type; |
190 | int ret; | 190 | int ret; |
191 | 191 | ||
192 | ret = -EPERM; /* What lack-of-symlink returns */ | 192 | ret = -EPERM; /* What lack-of-symlink returns */ |
diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 7211e826d90d..1270551d24e3 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c | |||
@@ -282,44 +282,44 @@ static struct configfs_item_operations node_ops = { | |||
282 | .release = release_node, | 282 | .release = release_node, |
283 | }; | 283 | }; |
284 | 284 | ||
285 | static struct config_item_type clusters_type = { | 285 | static const struct config_item_type clusters_type = { |
286 | .ct_group_ops = &clusters_ops, | 286 | .ct_group_ops = &clusters_ops, |
287 | .ct_owner = THIS_MODULE, | 287 | .ct_owner = THIS_MODULE, |
288 | }; | 288 | }; |
289 | 289 | ||
290 | static struct config_item_type cluster_type = { | 290 | static const struct config_item_type cluster_type = { |
291 | .ct_item_ops = &cluster_ops, | 291 | .ct_item_ops = &cluster_ops, |
292 | .ct_attrs = cluster_attrs, | 292 | .ct_attrs = cluster_attrs, |
293 | .ct_owner = THIS_MODULE, | 293 | .ct_owner = THIS_MODULE, |
294 | }; | 294 | }; |
295 | 295 | ||
296 | static struct config_item_type spaces_type = { | 296 | static const struct config_item_type spaces_type = { |
297 | .ct_group_ops = &spaces_ops, | 297 | .ct_group_ops = &spaces_ops, |
298 | .ct_owner = THIS_MODULE, | 298 | .ct_owner = THIS_MODULE, |
299 | }; | 299 | }; |
300 | 300 | ||
301 | static struct config_item_type space_type = { | 301 | static const struct config_item_type space_type = { |
302 | .ct_item_ops = &space_ops, | 302 | .ct_item_ops = &space_ops, |
303 | .ct_owner = THIS_MODULE, | 303 | .ct_owner = THIS_MODULE, |
304 | }; | 304 | }; |
305 | 305 | ||
306 | static struct config_item_type comms_type = { | 306 | static const struct config_item_type comms_type = { |
307 | .ct_group_ops = &comms_ops, | 307 | .ct_group_ops = &comms_ops, |
308 | .ct_owner = THIS_MODULE, | 308 | .ct_owner = THIS_MODULE, |
309 | }; | 309 | }; |
310 | 310 | ||
311 | static struct config_item_type comm_type = { | 311 | static const struct config_item_type comm_type = { |
312 | .ct_item_ops = &comm_ops, | 312 | .ct_item_ops = &comm_ops, |
313 | .ct_attrs = comm_attrs, | 313 | .ct_attrs = comm_attrs, |
314 | .ct_owner = THIS_MODULE, | 314 | .ct_owner = THIS_MODULE, |
315 | }; | 315 | }; |
316 | 316 | ||
317 | static struct config_item_type nodes_type = { | 317 | static const struct config_item_type nodes_type = { |
318 | .ct_group_ops = &nodes_ops, | 318 | .ct_group_ops = &nodes_ops, |
319 | .ct_owner = THIS_MODULE, | 319 | .ct_owner = THIS_MODULE, |
320 | }; | 320 | }; |
321 | 321 | ||
322 | static struct config_item_type node_type = { | 322 | static const struct config_item_type node_type = { |
323 | .ct_item_ops = &node_ops, | 323 | .ct_item_ops = &node_ops, |
324 | .ct_attrs = node_attrs, | 324 | .ct_attrs = node_attrs, |
325 | .ct_owner = THIS_MODULE, | 325 | .ct_owner = THIS_MODULE, |
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index d0206042d068..ea8c551bcd7e 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -2025,7 +2025,7 @@ static struct configfs_item_operations o2hb_region_item_ops = { | |||
2025 | .release = o2hb_region_release, | 2025 | .release = o2hb_region_release, |
2026 | }; | 2026 | }; |
2027 | 2027 | ||
2028 | static struct config_item_type o2hb_region_type = { | 2028 | static const struct config_item_type o2hb_region_type = { |
2029 | .ct_item_ops = &o2hb_region_item_ops, | 2029 | .ct_item_ops = &o2hb_region_item_ops, |
2030 | .ct_attrs = o2hb_region_attrs, | 2030 | .ct_attrs = o2hb_region_attrs, |
2031 | .ct_owner = THIS_MODULE, | 2031 | .ct_owner = THIS_MODULE, |
@@ -2310,7 +2310,7 @@ static struct configfs_group_operations o2hb_heartbeat_group_group_ops = { | |||
2310 | .drop_item = o2hb_heartbeat_group_drop_item, | 2310 | .drop_item = o2hb_heartbeat_group_drop_item, |
2311 | }; | 2311 | }; |
2312 | 2312 | ||
2313 | static struct config_item_type o2hb_heartbeat_group_type = { | 2313 | static const struct config_item_type o2hb_heartbeat_group_type = { |
2314 | .ct_group_ops = &o2hb_heartbeat_group_group_ops, | 2314 | .ct_group_ops = &o2hb_heartbeat_group_group_ops, |
2315 | .ct_attrs = o2hb_heartbeat_group_attrs, | 2315 | .ct_attrs = o2hb_heartbeat_group_attrs, |
2316 | .ct_owner = THIS_MODULE, | 2316 | .ct_owner = THIS_MODULE, |
diff --git a/fs/ocfs2/cluster/nodemanager.c b/fs/ocfs2/cluster/nodemanager.c index b17d180bdc16..a51200ece93d 100644 --- a/fs/ocfs2/cluster/nodemanager.c +++ b/fs/ocfs2/cluster/nodemanager.c | |||
@@ -378,7 +378,7 @@ static struct configfs_item_operations o2nm_node_item_ops = { | |||
378 | .release = o2nm_node_release, | 378 | .release = o2nm_node_release, |
379 | }; | 379 | }; |
380 | 380 | ||
381 | static struct config_item_type o2nm_node_type = { | 381 | static const struct config_item_type o2nm_node_type = { |
382 | .ct_item_ops = &o2nm_node_item_ops, | 382 | .ct_item_ops = &o2nm_node_item_ops, |
383 | .ct_attrs = o2nm_node_attrs, | 383 | .ct_attrs = o2nm_node_attrs, |
384 | .ct_owner = THIS_MODULE, | 384 | .ct_owner = THIS_MODULE, |
@@ -619,7 +619,7 @@ static struct configfs_group_operations o2nm_node_group_group_ops = { | |||
619 | .drop_item = o2nm_node_group_drop_item, | 619 | .drop_item = o2nm_node_group_drop_item, |
620 | }; | 620 | }; |
621 | 621 | ||
622 | static struct config_item_type o2nm_node_group_type = { | 622 | static const struct config_item_type o2nm_node_group_type = { |
623 | .ct_group_ops = &o2nm_node_group_group_ops, | 623 | .ct_group_ops = &o2nm_node_group_group_ops, |
624 | .ct_owner = THIS_MODULE, | 624 | .ct_owner = THIS_MODULE, |
625 | }; | 625 | }; |
@@ -637,7 +637,7 @@ static struct configfs_item_operations o2nm_cluster_item_ops = { | |||
637 | .release = o2nm_cluster_release, | 637 | .release = o2nm_cluster_release, |
638 | }; | 638 | }; |
639 | 639 | ||
640 | static struct config_item_type o2nm_cluster_type = { | 640 | static const struct config_item_type o2nm_cluster_type = { |
641 | .ct_item_ops = &o2nm_cluster_item_ops, | 641 | .ct_item_ops = &o2nm_cluster_item_ops, |
642 | .ct_attrs = o2nm_cluster_attrs, | 642 | .ct_attrs = o2nm_cluster_attrs, |
643 | .ct_owner = THIS_MODULE, | 643 | .ct_owner = THIS_MODULE, |
@@ -722,7 +722,7 @@ static struct configfs_group_operations o2nm_cluster_group_group_ops = { | |||
722 | .drop_item = o2nm_cluster_group_drop_item, | 722 | .drop_item = o2nm_cluster_group_drop_item, |
723 | }; | 723 | }; |
724 | 724 | ||
725 | static struct config_item_type o2nm_cluster_group_type = { | 725 | static const struct config_item_type o2nm_cluster_group_type = { |
726 | .ct_group_ops = &o2nm_cluster_group_group_ops, | 726 | .ct_group_ops = &o2nm_cluster_group_group_ops, |
727 | .ct_owner = THIS_MODULE, | 727 | .ct_owner = THIS_MODULE, |
728 | }; | 728 | }; |