Skip to content

Commit

Permalink
Matt Ahrens' review comments.
Browse files Browse the repository at this point in the history
Porting Notes:
Man page changes dropped for the moment.  This can be reconsiled
when the final version is merged to OpenZFS.  They are accurate
now, only worded a little differently.

Requires-builders: none
  • Loading branch information
behlendorf committed Feb 1, 2019
1 parent b3850ac commit 9bcd565
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/zfs/metaslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -4520,6 +4520,8 @@ static void
metaslab_trim_add(void *arg, uint64_t offset, uint64_t size)
{
metaslab_t *msp = arg;

ASSERT(MUTEX_HELD(&msp->ms_lock));
ASSERT(msp->ms_cur_ts != NULL);
range_tree_add(msp->ms_cur_ts->ts_tree, offset, size);
if (msp->ms_prev_ts != NULL) {
Expand Down Expand Up @@ -4826,6 +4828,7 @@ static boolean_t metaslab_check_trim_conflict(metaslab_t *msp,
uint64_t new_offset;

ASSERT3U(*offset + size, <=, limit);
ASSERT(MUTEX_HELD(&msp->ms_lock));

if (msp->ms_trimming_ts == NULL)
/* no trim conflict, original offset is OK */
Expand Down
2 changes: 2 additions & 0 deletions module/zfs/range_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,8 @@ uint64_t
range_tree_find_gap(range_tree_t *rt, uint64_t start, uint64_t size)
{
range_seg_t *rs;

ASSERT(MUTEX_HELD(rt->rt_lock));
while ((rs = range_tree_find_impl(rt, start, size)) != NULL)
start = rs->rs_end;
return (start);
Expand Down

0 comments on commit 9bcd565

Please sign in to comment.