| @@ -348,7 +348,7 @@ static int __blk_trace_remove(struct request_queue *q) · 347 unmodified lines |
| 348 | 348 | struct blk_trace *bt; |
| 349 | 349 | |
| 350 | 350 | bt = rcu_replace_pointer(q->blk_trace, NULL, |
| 351 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 351 | + lockdep_is_held(&q->debugfs_mutex)); |
| 352 | 352 | if (!bt) |
| 353 | 353 | return -EINVAL; |
| 354 | 354 | |
| @@ -362,9 +362,9 @@ int blk_trace_remove(struct request_queue *q) · 7 unmodified lines |
| 362 | 362 | { |
| 363 | 363 | int ret; |
| 364 | 364 | |
| 365 | | − mutex_lock(&q->blk_trace_mutex); |
| 365 | + mutex_lock(&q->debugfs_mutex); |
| 366 | 366 | ret = __blk_trace_remove(q); |
| 367 | | − mutex_unlock(&q->blk_trace_mutex); |
| 367 | + mutex_unlock(&q->debugfs_mutex); |
| 368 | 368 | |
| 369 | 369 | return ret; |
| 370 | 370 | } |
| @@ -483,14 +483,11 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, · 112 unmodified lines |
| 483 | 483 | struct dentry *dir = NULL; |
| 484 | 484 | int ret; |
| 485 | 485 | |
| 486 | | − lockdep_assert_held(&q->blk_trace_mutex); |
| 486 | + lockdep_assert_held(&q->debugfs_mutex); |
| 487 | 487 | |
| 488 | 488 | if (!buts->buf_size || !buts->buf_nr) |
| 489 | 489 | return -EINVAL; |
| 490 | 490 | |
| 491 | | − if (!blk_debugfs_root) |
| 492 | | − return -ENOENT; |
| 493 | | − |
| 494 | 491 | strncpy(buts->name, name, BLKTRACE_BDEV_SIZE); |
| 495 | 492 | buts->name[BLKTRACE_BDEV_SIZE - 1] = '\0'; |
| 496 | 493 | |
| @@ -505,7 +502,7 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, · 8 unmodified lines |
| 505 | 502 | * we can be. |
| 506 | 503 | */ |
| 507 | 504 | if (rcu_dereference_protected(q->blk_trace, |
| 508 | | − lockdep_is_held(&q->blk_trace_mutex))) { |
| 505 | + lockdep_is_held(&q->debugfs_mutex))) { |
| 509 | 506 | pr_warn("Concurrent blktraces are not allowed on %s\n", |
| 510 | 507 | buts->name); |
| 511 | 508 | return -EBUSY; |
| @@ -524,18 +521,15 @@ static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev, · 12 unmodified lines |
| 524 | 521 | if (!bt->msg_data) |
| 525 | 522 | goto err; |
| 526 | 523 | |
| 527 | | −#ifdef CONFIG_BLK_DEBUG_FS |
| 528 | 524 | /* |
| 529 | | − * When tracing whole make_request drivers (multiqueue) block devices, |
| 530 | | − * reuse the existing debugfs directory created by the block layer on |
| 531 | | − * init. For request-based block devices, all partitions block devices, |
| 525 | + * When tracing the whole disk reuse the existing debugfs directory |
| 526 | + * created by the block layer on init. For partitions block devices, |
| 532 | 527 | * and scsi-generic block devices we create a temporary new debugfs |
| 533 | 528 | * directory that will be removed once the trace ends. |
| 534 | 529 | */ |
| 535 | | − if (queue_is_mq(q) && bdev && bdev == bdev->bd_contains) |
| 530 | + if (bdev && bdev == bdev->bd_contains) |
| 536 | 531 | dir = q->debugfs_dir; |
| 537 | 532 | else |
| 538 | | −#endif |
| 539 | 533 | bt->dir = dir = debugfs_create_dir(buts->name, blk_debugfs_root); |
| 540 | 534 | |
| 541 | 535 | /* |
| @@ -617,9 +611,9 @@ int blk_trace_setup(struct request_queue *q, char *name, dev_t dev, · 75 unmodified lines |
| 617 | 611 | { |
| 618 | 612 | int ret; |
| 619 | 613 | |
| 620 | | − mutex_lock(&q->blk_trace_mutex); |
| 614 | + mutex_lock(&q->debugfs_mutex); |
| 621 | 615 | ret = __blk_trace_setup(q, name, dev, bdev, arg); |
| 622 | | − mutex_unlock(&q->blk_trace_mutex); |
| 616 | + mutex_unlock(&q->debugfs_mutex); |
| 623 | 617 | |
| 624 | 618 | return ret; |
| 625 | 619 | } |
| @@ -665,7 +659,7 @@ static int __blk_trace_startstop(struct request_queue *q, int start) · 39 unmodified lines |
| 665 | 659 | struct blk_trace *bt; |
| 666 | 660 | |
| 667 | 661 | bt = rcu_dereference_protected(q->blk_trace, |
| 668 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 662 | + lockdep_is_held(&q->debugfs_mutex)); |
| 669 | 663 | if (bt == NULL) |
| 670 | 664 | return -EINVAL; |
| 671 | 665 | |
| @@ -705,9 +699,9 @@ int blk_trace_startstop(struct request_queue *q, int start) · 33 unmodified lines |
| 705 | 699 | { |
| 706 | 700 | int ret; |
| 707 | 701 | |
| 708 | | − mutex_lock(&q->blk_trace_mutex); |
| 702 | + mutex_lock(&q->debugfs_mutex); |
| 709 | 703 | ret = __blk_trace_startstop(q, start); |
| 710 | | − mutex_unlock(&q->blk_trace_mutex); |
| 704 | + mutex_unlock(&q->debugfs_mutex); |
| 711 | 705 | |
| 712 | 706 | return ret; |
| 713 | 707 | } |
| @@ -736,7 +730,7 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) · 22 unmodified lines |
| 736 | 730 | if (!q) |
| 737 | 731 | return -ENXIO; |
| 738 | 732 | |
| 739 | | − mutex_lock(&q->blk_trace_mutex); |
| 733 | + mutex_lock(&q->debugfs_mutex); |
| 740 | 734 | |
| 741 | 735 | switch (cmd) { |
| 742 | 736 | case BLKTRACESETUP: |
| @@ -763,7 +757,7 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) · 20 unmodified lines |
| 763 | 757 | break; |
| 764 | 758 | } |
| 765 | 759 | |
| 766 | | − mutex_unlock(&q->blk_trace_mutex); |
| 760 | + mutex_unlock(&q->debugfs_mutex); |
| 767 | 761 | return ret; |
| 768 | 762 | } |
| 769 | 763 | |
| @@ -774,14 +768,14 @@ int blk_trace_ioctl(struct block_device *bdev, unsigned cmd, char __user *arg) · 4 unmodified lines |
| 774 | 768 | **/ |
| 775 | 769 | void blk_trace_shutdown(struct request_queue *q) |
| 776 | 770 | { |
| 777 | | − mutex_lock(&q->blk_trace_mutex); |
| 771 | + mutex_lock(&q->debugfs_mutex); |
| 778 | 772 | if (rcu_dereference_protected(q->blk_trace, |
| 779 | | − lockdep_is_held(&q->blk_trace_mutex))) { |
| 773 | + lockdep_is_held(&q->debugfs_mutex))) { |
| 780 | 774 | __blk_trace_startstop(q, 0); |
| 781 | 775 | __blk_trace_remove(q); |
| 782 | 776 | } |
| 783 | 777 | |
| 784 | | − mutex_unlock(&q->blk_trace_mutex); |
| 778 | + mutex_unlock(&q->debugfs_mutex); |
| 785 | 779 | } |
| 786 | 780 | |
| 787 | 781 | #ifdef CONFIG_BLK_CGROUP |
| @@ -1662,7 +1656,7 @@ static int blk_trace_remove_queue(struct request_queue *q) · 874 unmodified lines |
| 1662 | 1656 | struct blk_trace *bt; |
| 1663 | 1657 | |
| 1664 | 1658 | bt = rcu_replace_pointer(q->blk_trace, NULL, |
| 1665 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 1659 | + lockdep_is_held(&q->debugfs_mutex)); |
| 1666 | 1660 | if (bt == NULL) |
| 1667 | 1661 | return -EINVAL; |
| 1668 | 1662 | |
| @@ -1837,10 +1831,10 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev, · 168 unmodified lines |
| 1837 | 1831 | if (q == NULL) |
| 1838 | 1832 | goto out_bdput; |
| 1839 | 1833 | |
| 1840 | | − mutex_lock(&q->blk_trace_mutex); |
| 1834 | + mutex_lock(&q->debugfs_mutex); |
| 1841 | 1835 | |
| 1842 | 1836 | bt = rcu_dereference_protected(q->blk_trace, |
| 1843 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 1837 | + lockdep_is_held(&q->debugfs_mutex)); |
| 1844 | 1838 | if (attr == &dev_attr_enable) { |
| 1845 | 1839 | ret = sprintf(buf, "%u\n", !!bt); |
| 1846 | 1840 | goto out_unlock_bdev; |
| @@ -1858,7 +1852,7 @@ static ssize_t sysfs_blk_trace_attr_show(struct device *dev, · 11 unmodified lines |
| 1858 | 1852 | ret = sprintf(buf, "%llu\n", bt->end_lba); |
| 1859 | 1853 | |
| 1860 | 1854 | out_unlock_bdev: |
| 1861 | | − mutex_unlock(&q->blk_trace_mutex); |
| 1855 | + mutex_unlock(&q->debugfs_mutex); |
| 1862 | 1856 | out_bdput: |
| 1863 | 1857 | bdput(bdev); |
| 1864 | 1858 | out: |
| @@ -1901,10 +1895,10 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, · 36 unmodified lines |
| 1901 | 1895 | if (q == NULL) |
| 1902 | 1896 | goto out_bdput; |
| 1903 | 1897 | |
| 1904 | | − mutex_lock(&q->blk_trace_mutex); |
| 1898 | + mutex_lock(&q->debugfs_mutex); |
| 1905 | 1899 | |
| 1906 | 1900 | bt = rcu_dereference_protected(q->blk_trace, |
| 1907 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 1901 | + lockdep_is_held(&q->debugfs_mutex)); |
| 1908 | 1902 | if (attr == &dev_attr_enable) { |
| 1909 | 1903 | if (!!value == !!bt) { |
| 1910 | 1904 | ret = 0; |
| @@ -1921,7 +1915,7 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, · 10 unmodified lines |
| 1921 | 1915 | if (bt == NULL) { |
| 1922 | 1916 | ret = blk_trace_setup_queue(q, bdev); |
| 1923 | 1917 | bt = rcu_dereference_protected(q->blk_trace, |
| 1924 | | − lockdep_is_held(&q->blk_trace_mutex)); |
| 1918 | + lockdep_is_held(&q->debugfs_mutex)); |
| 1925 | 1919 | } |
| 1926 | 1920 | |
| 1927 | 1921 | if (ret == 0) { |
| @@ -1936,7 +1930,7 @@ static ssize_t sysfs_blk_trace_attr_store(struct device *dev, · 8 unmodified lines |
| 1936 | 1930 | } |
| 1937 | 1931 | |
| 1938 | 1932 | out_unlock_bdev: |
| 1939 | | − mutex_unlock(&q->blk_trace_mutex); |
| 1933 | + mutex_unlock(&q->debugfs_mutex); |
| 1940 | 1934 | out_bdput: |
| 1941 | 1935 | bdput(bdev); |
| 1942 | 1936 | out: |