Commit fe66286
block: get rid of request queue ->sysfs_dir_lock
The request queue uses ->sysfs_dir_lock for protecting the addition/
deletion of kobject entries under sysfs while we register/unregister
blk-mq. However kobject addition/deletion is already protected with
kernfs/sysfs internal synchronization primitives. So use of q->sysfs_
dir_lock seems redundant.
Moreover, q->sysfs_dir_lock is also used at few other callsites along
with q->sysfs_lock for protecting the addition/deletion of kojects.
One such example is when we register with sysfs a set of independent
access ranges for a disk. Here as well we could get rid off q->sysfs_
dir_lock and only use q->sysfs_lock.
The only variable which q->sysfs_dir_lock appears to protect is q->
mq_sysfs_init_done which is set/unset while registering/unregistering
blk-mq with sysfs. But use of q->mq_sysfs_init_done could be easily
replaced using queue registered bit QUEUE_FLAG_REGISTERED.
So with this patch we remove q->sysfs_dir_lock from each callsite
and replace q->mq_sysfs_init_done using QUEUE_FLAG_REGISTERED.
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Nilay Shroff <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>1 parent 5aa21b0 commit fe66286
File tree
5 files changed
+5
-31
lines changed- block
- include/linux
5 files changed
+5
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
434 | 433 | | |
435 | 434 | | |
436 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
158 | | - | |
159 | 157 | | |
160 | 158 | | |
161 | 159 | | |
| |||
289 | 287 | | |
290 | 288 | | |
291 | 289 | | |
292 | | - | |
293 | 290 | | |
294 | 291 | | |
295 | 292 | | |
| |||
313 | 310 | | |
314 | 311 | | |
315 | 312 | | |
316 | | - | |
317 | 313 | | |
318 | 314 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
226 | | - | |
227 | | - | |
228 | 226 | | |
229 | 227 | | |
230 | 228 | | |
| |||
237 | 235 | | |
238 | 236 | | |
239 | 237 | | |
240 | | - | |
241 | 238 | | |
242 | 239 | | |
243 | 240 | | |
| |||
259 | 256 | | |
260 | 257 | | |
261 | 258 | | |
262 | | - | |
263 | 259 | | |
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
267 | 263 | | |
268 | 264 | | |
269 | | - | |
270 | | - | |
271 | 265 | | |
272 | 266 | | |
273 | 267 | | |
274 | 268 | | |
275 | 269 | | |
276 | 270 | | |
277 | 271 | | |
278 | | - | |
279 | | - | |
280 | | - | |
| 272 | + | |
| 273 | + | |
281 | 274 | | |
282 | 275 | | |
283 | 276 | | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | 277 | | |
288 | 278 | | |
289 | 279 | | |
| |||
292 | 282 | | |
293 | 283 | | |
294 | 284 | | |
295 | | - | |
296 | | - | |
297 | | - | |
| 285 | + | |
| 286 | + | |
298 | 287 | | |
299 | 288 | | |
300 | 289 | | |
301 | 290 | | |
302 | 291 | | |
303 | 292 | | |
304 | 293 | | |
305 | | - | |
306 | | - | |
307 | | - | |
| 294 | + | |
308 | 295 | | |
309 | 296 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
768 | 767 | | |
769 | 768 | | |
770 | 769 | | |
| |||
805 | 804 | | |
806 | 805 | | |
807 | 806 | | |
808 | | - | |
809 | 807 | | |
810 | 808 | | |
811 | 809 | | |
| |||
830 | 828 | | |
831 | 829 | | |
832 | 830 | | |
833 | | - | |
834 | 831 | | |
835 | 832 | | |
836 | 833 | | |
| |||
861 | 858 | | |
862 | 859 | | |
863 | 860 | | |
864 | | - | |
865 | 861 | | |
866 | 862 | | |
867 | 863 | | |
| |||
878 | 874 | | |
879 | 875 | | |
880 | 876 | | |
881 | | - | |
882 | 877 | | |
883 | 878 | | |
884 | 879 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
565 | 564 | | |
566 | 565 | | |
567 | 566 | | |
| |||
605 | 604 | | |
606 | 605 | | |
607 | 606 | | |
608 | | - | |
609 | | - | |
610 | 607 | | |
611 | 608 | | |
612 | 609 | | |
| |||
0 commit comments