dm-linear.c (633a08b81206122469365b4c72eaeb71f04f2cb4) | dm-linear.c (586e80e6ee0d137c7d79fbae183bb37bc60ee97e) |
---|---|
1/* 2 * Copyright (C) 2001-2003 Sistina Software (UK) Limited. 3 * 4 * This file is released under the GPL. 5 */ 6 7#include "dm.h" | 1/* 2 * Copyright (C) 2001-2003 Sistina Software (UK) Limited. 3 * 4 * This file is released under the GPL. 5 */ 6 7#include "dm.h" |
8 | |
9#include <linux/module.h> 10#include <linux/init.h> 11#include <linux/blkdev.h> 12#include <linux/bio.h> 13#include <linux/slab.h> | 8#include <linux/module.h> 9#include <linux/init.h> 10#include <linux/blkdev.h> 11#include <linux/bio.h> 12#include <linux/slab.h> |
13#include <linux/device-mapper.h> |
|
14 15#define DM_MSG_PREFIX "linear" 16 17/* 18 * Linear: maps a linear range of a device. 19 */ 20struct linear_c { 21 struct dm_dev *dev; --- 83 unchanged lines hidden (view full) --- 105 case STATUSTYPE_TABLE: 106 snprintf(result, maxlen, "%s %llu", lc->dev->name, 107 (unsigned long long)lc->start); 108 break; 109 } 110 return 0; 111} 112 | 14 15#define DM_MSG_PREFIX "linear" 16 17/* 18 * Linear: maps a linear range of a device. 19 */ 20struct linear_c { 21 struct dm_dev *dev; --- 83 unchanged lines hidden (view full) --- 105 case STATUSTYPE_TABLE: 106 snprintf(result, maxlen, "%s %llu", lc->dev->name, 107 (unsigned long long)lc->start); 108 break; 109 } 110 return 0; 111} 112 |
113static int linear_ioctl(struct dm_target *ti, unsigned int cmd, | 113static int linear_ioctl(struct dm_target *ti, struct inode *inode, 114 struct file *filp, unsigned int cmd, |
114 unsigned long arg) 115{ 116 struct linear_c *lc = (struct linear_c *) ti->private; | 115 unsigned long arg) 116{ 117 struct linear_c *lc = (struct linear_c *) ti->private; |
117 return __blkdev_driver_ioctl(lc->dev->bdev, lc->dev->mode, cmd, arg); | 118 struct block_device *bdev = lc->dev->bdev; 119 struct file fake_file = {}; 120 struct dentry fake_dentry = {}; 121 122 fake_file.f_mode = lc->dev->mode; 123 fake_file.f_path.dentry = &fake_dentry; 124 fake_dentry.d_inode = bdev->bd_inode; 125 126 return blkdev_driver_ioctl(bdev->bd_inode, &fake_file, bdev->bd_disk, cmd, arg); |
118} 119 120static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm, 121 struct bio_vec *biovec, int max_size) 122{ 123 struct linear_c *lc = ti->private; 124 struct request_queue *q = bdev_get_queue(lc->dev->bdev); 125 --- 38 unchanged lines hidden --- | 127} 128 129static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm, 130 struct bio_vec *biovec, int max_size) 131{ 132 struct linear_c *lc = ti->private; 133 struct request_queue *q = bdev_get_queue(lc->dev->bdev); 134 --- 38 unchanged lines hidden --- |