diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-03-22 18:52:55 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-19 10:58:07 -0400 |
commit | e2a07812e93d4a51b1b1a6f15145a1634948db47 (patch) | |
tree | 2d13997492891384df9cbbd472296f2cb17f18d7 /fs/xfs/linux-2.6 | |
parent | fda168c24586ab8e01b0eb68028d78fe3e4fb71a (diff) |
xfs: add blockdev name to kthreads
This allows to see in `ps` and similar tools which kthreads are
allotted to which block device/filesystem, similar to what jbd2
does. As the process name is a fixed 16-char array, no extra
space is needed in tasks.
PID TTY STAT TIME COMMAND
2 ? S 0:00 [kthreadd]
197 ? S 0:00 \_ [jbd2/sda2-8]
198 ? S 0:00 \_ [ext4-dio-unwrit]
204 ? S 0:00 \_ [flush-8:0]
2647 ? S 0:00 \_ [xfs_mru_cache]
2648 ? S 0:00 \_ [xfslogd/0]
2649 ? S 0:00 \_ [xfsdatad/0]
2650 ? S 0:00 \_ [xfsconvertd/0]
2651 ? S 0:00 \_ [xfsbufd/ram0]
2652 ? S 0:00 \_ [xfsaild/ram0]
2653 ? S 0:00 \_ [xfssyncd/ram0]
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.c | 10 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_buf.h | 2 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 9 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_sync.c | 2 |
4 files changed, 13 insertions, 10 deletions
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 44c2b0ef9a41..f7ecc44cbbd3 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
@@ -1614,7 +1614,8 @@ xfs_mapping_buftarg( | |||
1614 | 1614 | ||
1615 | STATIC int | 1615 | STATIC int |
1616 | xfs_alloc_delwrite_queue( | 1616 | xfs_alloc_delwrite_queue( |
1617 | xfs_buftarg_t *btp) | 1617 | xfs_buftarg_t *btp, |
1618 | const char *fsname) | ||
1618 | { | 1619 | { |
1619 | int error = 0; | 1620 | int error = 0; |
1620 | 1621 | ||
@@ -1622,7 +1623,7 @@ xfs_alloc_delwrite_queue( | |||
1622 | INIT_LIST_HEAD(&btp->bt_delwrite_queue); | 1623 | INIT_LIST_HEAD(&btp->bt_delwrite_queue); |
1623 | spin_lock_init(&btp->bt_delwrite_lock); | 1624 | spin_lock_init(&btp->bt_delwrite_lock); |
1624 | btp->bt_flags = 0; | 1625 | btp->bt_flags = 0; |
1625 | btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd"); | 1626 | btp->bt_task = kthread_run(xfsbufd, btp, "xfsbufd/%s", fsname); |
1626 | if (IS_ERR(btp->bt_task)) { | 1627 | if (IS_ERR(btp->bt_task)) { |
1627 | error = PTR_ERR(btp->bt_task); | 1628 | error = PTR_ERR(btp->bt_task); |
1628 | goto out_error; | 1629 | goto out_error; |
@@ -1635,7 +1636,8 @@ out_error: | |||
1635 | xfs_buftarg_t * | 1636 | xfs_buftarg_t * |
1636 | xfs_alloc_buftarg( | 1637 | xfs_alloc_buftarg( |
1637 | struct block_device *bdev, | 1638 | struct block_device *bdev, |
1638 | int external) | 1639 | int external, |
1640 | const char *fsname) | ||
1639 | { | 1641 | { |
1640 | xfs_buftarg_t *btp; | 1642 | xfs_buftarg_t *btp; |
1641 | 1643 | ||
@@ -1647,7 +1649,7 @@ xfs_alloc_buftarg( | |||
1647 | goto error; | 1649 | goto error; |
1648 | if (xfs_mapping_buftarg(btp, bdev)) | 1650 | if (xfs_mapping_buftarg(btp, bdev)) |
1649 | goto error; | 1651 | goto error; |
1650 | if (xfs_alloc_delwrite_queue(btp)) | 1652 | if (xfs_alloc_delwrite_queue(btp, fsname)) |
1651 | goto error; | 1653 | goto error; |
1652 | xfs_alloc_bufhash(btp, external); | 1654 | xfs_alloc_bufhash(btp, external); |
1653 | return btp; | 1655 | return btp; |
diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 386e7361e50e..5fbecefa5dfd 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h | |||
@@ -390,7 +390,7 @@ static inline void xfs_buf_relse(xfs_buf_t *bp) | |||
390 | /* | 390 | /* |
391 | * Handling of buftargs. | 391 | * Handling of buftargs. |
392 | */ | 392 | */ |
393 | extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int); | 393 | extern xfs_buftarg_t *xfs_alloc_buftarg(struct block_device *, int, const char *); |
394 | extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *); | 394 | extern void xfs_free_buftarg(struct xfs_mount *, struct xfs_buftarg *); |
395 | extern void xfs_wait_buftarg(xfs_buftarg_t *); | 395 | extern void xfs_wait_buftarg(xfs_buftarg_t *); |
396 | extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); | 396 | extern int xfs_setsize_buftarg(xfs_buftarg_t *, unsigned int, unsigned int); |
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 29f1edca76de..e8ad6dd2c10c 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -789,18 +789,18 @@ xfs_open_devices( | |||
789 | * Setup xfs_mount buffer target pointers | 789 | * Setup xfs_mount buffer target pointers |
790 | */ | 790 | */ |
791 | error = ENOMEM; | 791 | error = ENOMEM; |
792 | mp->m_ddev_targp = xfs_alloc_buftarg(ddev, 0); | 792 | mp->m_ddev_targp = xfs_alloc_buftarg(ddev, 0, mp->m_fsname); |
793 | if (!mp->m_ddev_targp) | 793 | if (!mp->m_ddev_targp) |
794 | goto out_close_rtdev; | 794 | goto out_close_rtdev; |
795 | 795 | ||
796 | if (rtdev) { | 796 | if (rtdev) { |
797 | mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev, 1); | 797 | mp->m_rtdev_targp = xfs_alloc_buftarg(rtdev, 1, mp->m_fsname); |
798 | if (!mp->m_rtdev_targp) | 798 | if (!mp->m_rtdev_targp) |
799 | goto out_free_ddev_targ; | 799 | goto out_free_ddev_targ; |
800 | } | 800 | } |
801 | 801 | ||
802 | if (logdev && logdev != ddev) { | 802 | if (logdev && logdev != ddev) { |
803 | mp->m_logdev_targp = xfs_alloc_buftarg(logdev, 1); | 803 | mp->m_logdev_targp = xfs_alloc_buftarg(logdev, 1, mp->m_fsname); |
804 | if (!mp->m_logdev_targp) | 804 | if (!mp->m_logdev_targp) |
805 | goto out_free_rtdev_targ; | 805 | goto out_free_rtdev_targ; |
806 | } else { | 806 | } else { |
@@ -902,7 +902,8 @@ xfsaild_start( | |||
902 | struct xfs_ail *ailp) | 902 | struct xfs_ail *ailp) |
903 | { | 903 | { |
904 | ailp->xa_target = 0; | 904 | ailp->xa_target = 0; |
905 | ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild"); | 905 | ailp->xa_task = kthread_run(xfsaild, ailp, "xfsaild/%s", |
906 | ailp->xa_mount->m_fsname); | ||
906 | if (IS_ERR(ailp->xa_task)) | 907 | if (IS_ERR(ailp->xa_task)) |
907 | return -PTR_ERR(ailp->xa_task); | 908 | return -PTR_ERR(ailp->xa_task); |
908 | return 0; | 909 | return 0; |
diff --git a/fs/xfs/linux-2.6/xfs_sync.c b/fs/xfs/linux-2.6/xfs_sync.c index a427c638d909..a7ba355c21b6 100644 --- a/fs/xfs/linux-2.6/xfs_sync.c +++ b/fs/xfs/linux-2.6/xfs_sync.c | |||
@@ -660,7 +660,7 @@ xfs_syncd_init( | |||
660 | mp->m_sync_work.w_syncer = xfs_sync_worker; | 660 | mp->m_sync_work.w_syncer = xfs_sync_worker; |
661 | mp->m_sync_work.w_mount = mp; | 661 | mp->m_sync_work.w_mount = mp; |
662 | mp->m_sync_work.w_completion = NULL; | 662 | mp->m_sync_work.w_completion = NULL; |
663 | mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd"); | 663 | mp->m_sync_task = kthread_run(xfssyncd, mp, "xfssyncd/%s", mp->m_fsname); |
664 | if (IS_ERR(mp->m_sync_task)) | 664 | if (IS_ERR(mp->m_sync_task)) |
665 | return -PTR_ERR(mp->m_sync_task); | 665 | return -PTR_ERR(mp->m_sync_task); |
666 | return 0; | 666 | return 0; |