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

# mpage\_writepages(9)

walk the list of dirty pages of the given address space & writepage all of them

## NAME

mpage\_writepages - walk the list of dirty pages of the given address space & **writepage** all of them

## SYNOPSIS

**int mpage\_writepages(struct address\_space \*** *mapping***, struct writeback\_control \*** *wbc***, get\_block\_t** *get\_block***);**

## ARGUMENTS

*mapping*

address space structure to write

*wbc*

subtract the number of written pages from \**wbc*-\>nr\_to\_write

*get\_block*

the filesystem's block mapper function. If this is NULL then use a\_ops-\>writepage. Otherwise, go direct-to-BIO.

## DESCRIPTION

This is a library function, which implements the **writepages** address\_space\_operation.

If a page is already under I/O, **generic\_writepages** skips it, even if it's dirty. This is desirable behaviour for memory-cleaning writeback, but it is INCORRECT for data-integrity system calls such as **fsync**. **fsync** and **msync** need to guarantee that all the data which was dirty at the time the call was made get new I/O started against them. If wbc-\>sync\_mode is WB\_SYNC\_ALL then we were called for data integrity and we must wait for existing IO to complete.

## COPYRIGHT
