Linux Kernel
3.7.1
|
#include <linux/init.h>
#include <linux/mm.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <linux/kmod.h>
#include <linux/major.h>
#include <linux/device_cgroup.h>
#include <linux/highmem.h>
#include <linux/blkdev.h>
#include <linux/module.h>
#include <linux/blkpg.h>
#include <linux/magic.h>
#include <linux/buffer_head.h>
#include <linux/swap.h>
#include <linux/pagevec.h>
#include <linux/writeback.h>
#include <linux/mpage.h>
#include <linux/mount.h>
#include <linux/uio.h>
#include <linux/namei.h>
#include <linux/log2.h>
#include <linux/cleancache.h>
#include <asm/uaccess.h>
#include "internal.h"
Go to the source code of this file.
Data Structures | |
struct | bdev_inode |
Variables | |
struct file_operations | def_blk_fops |
int __invalidate_device | ( | struct block_device * | bdev, |
bool | kill_dirty | ||
) |
Definition at line 1659 of file block_dev.c.
int __sync_blockdev | ( | struct block_device * | bdev, |
int | wait | ||
) |
Definition at line 170 of file block_dev.c.
Definition at line 614 of file block_dev.c.
void bd_set_size | ( | struct block_device * | bdev, |
loff_t | size | ||
) |
Definition at line 1031 of file block_dev.c.
Definition at line 468 of file block_dev.c.
|
read |
Definition at line 509 of file block_dev.c.
|
read |
bdgrab – Grab a reference to an already referenced block device : Block device to grab a reference to.
Definition at line 549 of file block_dev.c.
void bdput | ( | struct block_device * | bdev | ) |
Definition at line 567 of file block_dev.c.
ssize_t blkdev_aio_write | ( | struct kiocb * | iocb, |
const struct iovec * | iov, | ||
unsigned long | nr_segs, | ||
loff_t | pos | ||
) |
Definition at line 1524 of file block_dev.c.
Definition at line 356 of file block_dev.c.
int blkdev_get | ( | struct block_device * | bdev, |
fmode_t | mode, | ||
void * | holder | ||
) |
blkdev_get - open a block device : block_device to open : FMODE_* mask : exclusive holder identifier
Open with . If includes FMODE_EXCL, is open with exclusive access. Specifying FMODE_EXCL with NULL is invalid. Exclusive opens may nest for the same .
On success, the reference count of is unchanged. On failure, is put.
CONTEXT: Might sleep.
RETURNS: 0 on success, -errno on failure.
Definition at line 1228 of file block_dev.c.
|
read |
blkdev_get_by_dev - open a block device by device number : device number of block device to open : FMODE_* mask : exclusive holder identifier
Open the blockdevice described by device number . and are identical to blkdev_get().
Use it ONLY if you really do not have anything better - i.e. when you are behind a truly sucky interface and all you are given is a device number. Never to be used for internal purposes. If you ever need it - reconsider your API.
On success, the returned block_device has reference count of one.
CONTEXT: Might sleep.
RETURNS: Pointer to block_device on success, ERR_PTR(-errno) on failure.
Definition at line 1356 of file block_dev.c.
blkdev_get_by_path - open a block device by name : path to the block device to open : FMODE_* mask : exclusive holder identifier
Open the blockdevice described by the device file at . and are identical to blkdev_get().
On success, the returned block_device has reference count of one.
CONTEXT: Might sleep.
RETURNS: Pointer to block_device on success, ERR_PTR(-errno) on failure.
Definition at line 1311 of file block_dev.c.
int blkdev_put | ( | struct block_device * | bdev, |
fmode_t | mode | ||
) |
Definition at line 1445 of file block_dev.c.
int check_disk_change | ( | struct block_device * | bdev | ) |
Definition at line 1012 of file block_dev.c.
void check_disk_size_change | ( | struct gendisk * | disk, |
struct block_device * | bdev | ||
) |
check_disk_size_change - checks for disk size change and adjusts bdev size. : struct gendisk to check : struct bdev to adjust.
This routine checks to see if the bdev size does not match the disk size and adjusts it if it differs.
Definition at line 956 of file block_dev.c.
EXPORT_SYMBOL | ( | I_BDEV | ) |
EXPORT_SYMBOL | ( | kill_bdev | ) |
EXPORT_SYMBOL | ( | invalidate_bdev | ) |
EXPORT_SYMBOL | ( | set_blocksize | ) |
EXPORT_SYMBOL | ( | sb_set_blocksize | ) |
EXPORT_SYMBOL | ( | sb_min_blocksize | ) |
EXPORT_SYMBOL | ( | sync_blockdev | ) |
EXPORT_SYMBOL | ( | fsync_bdev | ) |
EXPORT_SYMBOL | ( | freeze_bdev | ) |
EXPORT_SYMBOL | ( | thaw_bdev | ) |
EXPORT_SYMBOL | ( | blkdev_fsync | ) |
EXPORT_SYMBOL | ( | bdget | ) |
EXPORT_SYMBOL | ( | bdput | ) |
EXPORT_SYMBOL | ( | check_disk_size_change | ) |
EXPORT_SYMBOL | ( | revalidate_disk | ) |
EXPORT_SYMBOL | ( | check_disk_change | ) |
EXPORT_SYMBOL | ( | bd_set_size | ) |
EXPORT_SYMBOL | ( | blkdev_get | ) |
EXPORT_SYMBOL | ( | blkdev_get_by_path | ) |
EXPORT_SYMBOL | ( | blkdev_get_by_dev | ) |
EXPORT_SYMBOL | ( | blkdev_put | ) |
EXPORT_SYMBOL | ( | ioctl_by_bdev | ) |
EXPORT_SYMBOL | ( | lookup_bdev | ) |
EXPORT_SYMBOL | ( | __invalidate_device | ) |
EXPORT_SYMBOL_GPL | ( | blkdev_aio_write | ) |
|
read |
freeze_bdev – lock a filesystem and force it into a consistent state : blockdevice to lock
If a superblock is found on this device, we take the s_umount semaphore on it to make sure nobody unmounts until the snapshot creation is done. The reference counter (bd_fsfreeze_count) guarantees that only the last unfreeze process can unfreeze the frozen filesystem actually when multiple freeze requests arrive simultaneously. It counts up in freeze_bdev() and count down in thaw_bdev(). When it becomes 0, thaw_bdev() will unfreeze actually.
Definition at line 218 of file block_dev.c.
int fsync_bdev | ( | struct block_device * | bdev | ) |
Definition at line 194 of file block_dev.c.
|
read |
Definition at line 45 of file block_dev.c.
void invalidate_bdev | ( | struct block_device * | bdev | ) |
Definition at line 87 of file block_dev.c.
int ioctl_by_bdev | ( | struct block_device * | bdev, |
unsigned | cmd, | ||
unsigned long | arg | ||
) |
Definition at line 1605 of file block_dev.c.
Definition at line 1680 of file block_dev.c.
void kill_bdev | ( | struct block_device * | bdev | ) |
Definition at line 74 of file block_dev.c.
|
read |
lookup_bdev - lookup a struct block_device by name : special file representing the block device
Get a reference to the blockdevice at in the current namespace if possible and return it. Return ERR_PTR(error) otherwise.
Definition at line 1625 of file block_dev.c.
Definition at line 555 of file block_dev.c.
revalidate_disk - wrapper for lower-level driver's revalidate_disk call-back : struct gendisk to be revalidated
This routine is a wrapper for lower-level driver's revalidate_disk call-backs. It is used to do common pre and post operations needed for all revalidate_disk operations.
Definition at line 983 of file block_dev.c.
int sb_min_blocksize | ( | struct super_block * | sb, |
int | size | ||
) |
Definition at line 139 of file block_dev.c.
int sb_set_blocksize | ( | struct super_block * | sb, |
int | size | ||
) |
Definition at line 126 of file block_dev.c.
int set_blocksize | ( | struct block_device * | bdev, |
int | size | ||
) |
Definition at line 104 of file block_dev.c.
int sync_blockdev | ( | struct block_device * | bdev | ) |
Definition at line 183 of file block_dev.c.
int thaw_bdev | ( | struct block_device * | bdev, |
struct super_block * | sb | ||
) |
thaw_bdev – unlock filesystem : blockdevice to unlock : associated superblock
Unlocks the filesystem and marks it writeable again after freeze_bdev().
Definition at line 261 of file block_dev.c.
struct file_operations def_blk_fops |
Definition at line 1587 of file block_dev.c.