blkdev_get(9)

blkdev_get9

Open a block device

Usage

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

Overview

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.

Return

0 on success, -errno on failure.

Releases

3 releases since Debian 7 (Wheezy); the text changed 2 times.

  1. 7
  2. 8
  3. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.