!atomic_read(&fs_info->nocow_write_inflight));
if (!pending)
return 0;
+ atomic64_inc(&fs_info->stripe_run_stats.nocow_ro_drains);
ret = btrfs_start_delalloc_roots(fs_info, LONG_MAX, false);
if (ret < 0)
return ret;
atomic64_t strand_scan_bytes;
/* rescans requested by a freed run to credit its stripes back */
atomic64_t strand_rescan_marks;
+ /* read-only transitions that flushed pending NOCOW writes first */
+ atomic64_t nocow_ro_drains;
} stripe_run_stats;
/* BTRFS_STRIPE_RMW_* masks; see btrfs_stripe_allow_rmw(). */
u32 stripe_rmw_opt;
"nocow_run_opened %lld\n"
"claim_refused_live_run %lld\n"
"strand_scan_bytes %lld\n"
- "strand_rescan_marks %lld\n",
+ "strand_rescan_marks %lld\n"
+ "nocow_ro_drains %lld\n",
atomic64_read(&fs_info->stripe_run_stats.nocow_run_opened),
atomic64_read(&fs_info->stripe_run_stats.claim_refused_live_run),
atomic64_read(&fs_info->stripe_run_stats.strand_scan_bytes),
- atomic64_read(&fs_info->stripe_run_stats.strand_rescan_marks));
+ atomic64_read(&fs_info->stripe_run_stats.strand_rescan_marks),
+ atomic64_read(&fs_info->stripe_run_stats.nocow_ro_drains));
}
BTRFS_ATTR(, stripe_run_stats, btrfs_stripe_run_stats_show);