---
name: "sb_start_write"
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/sb_start_write"
---

# sb\_start\_write(9)

get write access to a superblock

## NAME

sb\_start\_write - get write access to a superblock

## SYNOPSIS

**void sb\_start\_write(struct super\_block \*** *sb***);**

## ARGUMENTS

*sb*

the super we write to

## DESCRIPTION

When a process wants to write data or metadata to a file system (i.e. dirty a page or an inode), it should embed the operation in a **sb\_start\_write** - **sb\_end\_write** pair to get exclusion against file system freezing. This function increments number of writers preventing freezing. If the file system is already frozen, the function waits until the file system is thawed.

Since freeze protection behaves as a lock, users have to preserve ordering of freeze protection and other filesystem locks. Generally, freeze protection should be the outermost lock. In particular, we have:

sb\_start\_write -\> i\_mutex (write path, truncate, directory ops, ...) -\> s\_umount (freeze\_super, thaw\_super)

## COPYRIGHT
