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

# \_\_mark\_inode\_dirty(9)

internal function

## NAME

\_\_mark\_inode\_dirty - internal function

## SYNOPSIS

**void \_\_mark\_inode\_dirty(struct inode \*** *inode***, int** *flags***);**

## ARGUMENTS

*inode*

inode to mark

*flags*

what kind of dirty (i.e. I\_DIRTY\_SYNC) Mark an inode as dirty. Callers should use mark\_inode\_dirty or mark\_inode\_dirty\_sync.

## DESCRIPTION

Put the inode on the super block's dirty list.

CAREFUL! We mark it dirty unconditionally, but move it onto the dirty list only if it is hashed or if it refers to a blockdev. If it was not hashed, it will never be added to the dirty list even if it is later hashed, as it will have been marked dirty already.

In short, make sure you hash any inodes \_before\_ you start marking them dirty.

Note that for blockdevs, inode-\>dirtied\_when represents the dirtying time of the block-special inode (/dev/hda1) itself. And the -\>dirtied\_when field of the kernel-internal blockdev inode represents the dirtying time of the blockdev's pages. This is why for I\_DIRTY\_PAGES we always use page-\>mapping-\>host, so the page-dirtying time is recorded in the internal blockdev inode.

## COPYRIGHT
