diff options
author | Jeff Mahoney <jeffm@suse.com> | 2016-06-09 16:22:11 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-07-26 07:53:15 -0400 |
commit | cb001095ca705dcd95f57fe98867e38a4889916d (patch) | |
tree | 14a4d7643bf5b4a436f085615fbafd2575a09108 /fs/btrfs/async-thread.h | |
parent | 9f8d49095b86d3494ee184f6ede4a5b179d5dc5c (diff) |
btrfs: plumb fs_info into btrfs_work
In order to provide an fsid for trace events, we'll need a btrfs_fs_info
pointer. The most lightweight way to do that for btrfs_work structures
is to associate it with the __btrfs_workqueue structure. Each queued
btrfs_work structure has a workqueue associated with it, so that's
a natural fit. It's a privately defined structures, so we add accessors
to retrieve the fs_info pointer.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/async-thread.h')
-rw-r--r-- | fs/btrfs/async-thread.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/async-thread.h b/fs/btrfs/async-thread.h index ad4d0647d1a6..8e52484cd461 100644 --- a/fs/btrfs/async-thread.h +++ b/fs/btrfs/async-thread.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define __BTRFS_ASYNC_THREAD_ | 21 | #define __BTRFS_ASYNC_THREAD_ |
22 | #include <linux/workqueue.h> | 22 | #include <linux/workqueue.h> |
23 | 23 | ||
24 | struct btrfs_fs_info; | ||
24 | struct btrfs_workqueue; | 25 | struct btrfs_workqueue; |
25 | /* Internal use only */ | 26 | /* Internal use only */ |
26 | struct __btrfs_workqueue; | 27 | struct __btrfs_workqueue; |
@@ -67,7 +68,8 @@ BTRFS_WORK_HELPER_PROTO(scrubnc_helper); | |||
67 | BTRFS_WORK_HELPER_PROTO(scrubparity_helper); | 68 | BTRFS_WORK_HELPER_PROTO(scrubparity_helper); |
68 | 69 | ||
69 | 70 | ||
70 | struct btrfs_workqueue *btrfs_alloc_workqueue(const char *name, | 71 | struct btrfs_workqueue *btrfs_alloc_workqueue(struct btrfs_fs_info *fs_info, |
72 | const char *name, | ||
71 | unsigned int flags, | 73 | unsigned int flags, |
72 | int limit_active, | 74 | int limit_active, |
73 | int thresh); | 75 | int thresh); |
@@ -80,4 +82,6 @@ void btrfs_queue_work(struct btrfs_workqueue *wq, | |||
80 | void btrfs_destroy_workqueue(struct btrfs_workqueue *wq); | 82 | void btrfs_destroy_workqueue(struct btrfs_workqueue *wq); |
81 | void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int max); | 83 | void btrfs_workqueue_set_max(struct btrfs_workqueue *wq, int max); |
82 | void btrfs_set_work_high_priority(struct btrfs_work *work); | 84 | void btrfs_set_work_high_priority(struct btrfs_work *work); |
85 | struct btrfs_fs_info *btrfs_work_owner(struct btrfs_work *work); | ||
86 | struct btrfs_fs_info *btrfs_workqueue_owner(struct __btrfs_workqueue *wq); | ||
83 | #endif | 87 | #endif |