Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
Merge branch 'tracepoint-updates-4.10' of git://git.kernel.org/pub/sc…
Browse files Browse the repository at this point in the history
…m/linux/kernel/git/kdave/linux into for-linus-4.10
  • Loading branch information
masoncl committed Jan 11, 2017
2 parents 3dda13a + 562a7a0 commit 0bf70ae
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 72 deletions.
15 changes: 11 additions & 4 deletions fs/btrfs/async-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ static void run_ordered_work(struct __btrfs_workqueue *wq)
unsigned long flags;

while (1) {
void *wtag;

spin_lock_irqsave(lock, flags);
if (list_empty(list))
break;
Expand All @@ -299,18 +301,21 @@ static void run_ordered_work(struct __btrfs_workqueue *wq)
spin_unlock_irqrestore(lock, flags);

/*
* we don't want to call the ordered free functions
* with the lock held though
* We don't want to call the ordered free functions with the
* 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);
trace_btrfs_all_work_done(work);
trace_btrfs_all_work_done(wq->fs_info, wtag);
}
spin_unlock_irqrestore(lock, flags);
}

static void normal_work_helper(struct btrfs_work *work)
{
struct __btrfs_workqueue *wq;
void *wtag;
int need_order = 0;

/*
Expand All @@ -324,6 +329,8 @@ static void normal_work_helper(struct btrfs_work *work)
if (work->ordered_func)
need_order = 1;
wq = work->wq;
/* Safe for tracepoints in case work gets freed by the callback */
wtag = work;

trace_btrfs_work_sched(work);
thresh_exec_hook(wq);
Expand All @@ -333,7 +340,7 @@ static void normal_work_helper(struct btrfs_work *work)
run_ordered_work(wq);
}
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,
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -7059,7 +7059,7 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
write_unlock(&em_tree->lock);
out:

trace_btrfs_get_extent(root, em);
trace_btrfs_get_extent(root, inode, em);

btrfs_free_path(path);
if (trans) {
Expand Down
Loading

0 comments on commit 0bf70ae

Please sign in to comment.