blkdev_get
Prev | Other Functions | Next

## Name

blkdev_get — open a block device

## Synopsis

`int blkdev_get (` | struct block_device * bdev,
| fmode_t mode,
| void * holder`)`;

## Arguments

`bdev`

  block_device to open

`mode`

  FMODE_* mask

`holder`

  exclusive holder identifier

## Description

Open `bdev` with `mode`. If `mode` includes `FMODE_EXCL`, `bdev` is open with exclusive access. Specifying `FMODE_EXCL` with `NULL` `holder` is invalid. Exclusive opens may nest for the same `holder`.

On success, the reference count of `bdev` is unchanged. On failure, `bdev` is put.

## CONTEXT

Might sleep.

## RETURNS

0 on success, -errno on failure.

Prev | Up | Next
revalidate_disk | Home | blkdev_get_by_path