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

# get\_bbt\_block(9)

Get the first valid eraseblock suitable to store a BBT

## NAME

get\_bbt\_block - Get the first valid eraseblock suitable to store a BBT

## SYNOPSIS

**int get\_bbt\_block(struct nand\_chip \*** *this***, struct nand\_bbt\_descr \*** *td***, struct nand\_bbt\_descr \*** *md***, int** *chip***);**

## ARGUMENTS

*this*

the NAND device

*td*

the BBT description

*md*

the mirror BBT descriptor

*chip*

the CHIP selector

## DESCRIPTION

This functions returns a positive block number pointing a valid eraseblock suitable to store a BBT (i.e. in the range reserved for BBT), or -ENOSPC if all blocks are already used of marked bad. If td-\>pages\[chip\] was already pointing to a valid block we re-use it, otherwise we search for the next valid one.

## AUTHOR

**Thomas Gleixner** \<tglx@linutronix.de\>

Author.

## COPYRIGHT
