def METHOD_NAME(subvol: Subvol) -> RenderedTree:
    # Determine the original ro/rw state of the subvol so we can put it back
    # the way it was after rendering.
    was_readonly = (
        subvol.run_as_root(
            ["btrfs", "property", "get", "-ts", subvol.path(), "ro"],
            text=True,
            stdout=subprocess.PIPE,
        ).stdout.strip()
        == "ro=true"
    )
    try:
        return render_sendstream(subvol.mark_readonly_and_get_sendstream())
    finally:
        subvol.set_readonly(was_readonly)