1. NAME

blkdev_get - open a block device

2. SYNOPSIS

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

3. ARGUMENTS

bdev
    block_device to open

mode
    FMODE_* mask

holder
    exclusive holder identifier

4. 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.

5. CONTEXT

Might sleep.

6. RETURNS

0 on success, -errno on failure.

7. COPYRIGHT