---
name: "freeze_bdev"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/freeze_bdev"
---

# freeze\_bdev(9)

\- lock a filesystem and force it into a consistent state

## NAME

freeze\_bdev - - lock a filesystem and force it into a consistent state

## SYNOPSIS

**struct super\_block \* freeze\_bdev(struct block\_device \*** *bdev***);**

## ARGUMENTS

*bdev*

blockdevice to lock

## DESCRIPTION

If a superblock is found on this device, we take the s\_umount semaphore on it to make sure nobody unmounts until the snapshot creation is done. The reference counter (bd\_fsfreeze\_count) guarantees that only the last unfreeze process can unfreeze the frozen filesystem actually when multiple freeze requests arrive simultaneously. It counts up in **freeze\_bdev** and count down in **thaw\_bdev**. When it becomes 0, **thaw\_bdev** will unfreeze actually.

## COPYRIGHT
