Commit 0bf70aeb authored by Chris Mason's avatar Chris Mason

Merge branch 'tracepoint-updates-4.10' of...

Merge branch 'tracepoint-updates-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux into for-linus-4.10
parents 3dda13a8 562a7a07
...@@ -273,6 +273,8 @@ static void run_ordered_work(struct __btrfs_workqueue *wq) ...@@ -273,6 +273,8 @@ static void run_ordered_work(struct __btrfs_workqueue *wq)
unsigned long flags; unsigned long flags;
while (1) { while (1) {
void *wtag;
spin_lock_irqsave(lock, flags); spin_lock_irqsave(lock, flags);
if (list_empty(list)) if (list_empty(list))
break; break;
...@@ -299,11 +301,13 @@ static void run_ordered_work(struct __btrfs_workqueue *wq) ...@@ -299,11 +301,13 @@ static void run_ordered_work(struct __btrfs_workqueue *wq)
spin_unlock_irqrestore(lock, flags); spin_unlock_irqrestore(lock, flags);
/* /*
* we don't want to call the ordered free functions * We don't want to call the ordered free functions with the
* with the lock held though * lock held though. Save the work as tag for the trace event,
* because the callback could free the structure.
*/ */
wtag = work;
work->ordered_free(work); work->ordered_free(work);
trace_btrfs_all_work_done(work); trace_btrfs_all_work_done(wq->fs_info, wtag);
} }
spin_unlock_irqrestore(lock, flags); spin_unlock_irqrestore(lock, flags);
} }
...@@ -311,6 +315,7 @@ static void run_ordered_work(struct __btrfs_workqueue *wq) ...@@ -311,6 +315,7 @@ static void run_ordered_work(struct __btrfs_workqueue *wq)
static void normal_work_helper(struct btrfs_work *work) static void normal_work_helper(struct btrfs_work *work)
{ {
struct __btrfs_workqueue *wq; struct __btrfs_workqueue *wq;
void *wtag;
int need_order = 0; int need_order = 0;
/* /*
...@@ -324,6 +329,8 @@ static void normal_work_helper(struct btrfs_work *work) ...@@ -324,6 +329,8 @@ static void normal_work_helper(struct btrfs_work *work)
if (work->ordered_func) if (work->ordered_func)
need_order = 1; need_order = 1;
wq = work->wq; wq = work->wq;
/* Safe for tracepoints in case work gets freed by the callback */
wtag = work;
trace_btrfs_work_sched(work); trace_btrfs_work_sched(work);
thresh_exec_hook(wq); thresh_exec_hook(wq);
...@@ -333,7 +340,7 @@ static void normal_work_helper(struct btrfs_work *work) ...@@ -333,7 +340,7 @@ static void normal_work_helper(struct btrfs_work *work)
run_ordered_work(wq); run_ordered_work(wq);
} }
if (!need_order) if (!need_order)
trace_btrfs_all_work_done(work); trace_btrfs_all_work_done(wq->fs_info, wtag);
} }
void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func, void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func,
......
...@@ -7059,7 +7059,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, ...@@ -7059,7 +7059,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
write_unlock(&em_tree->lock); write_unlock(&em_tree->lock);
out: out:
trace_btrfs_get_extent(root, em); trace_btrfs_get_extent(root, inode, em);
btrfs_free_path(path); btrfs_free_path(path);
if (trans) { if (trans) {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment