aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-linear.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /drivers/md/dm-linear.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'drivers/md/dm-linear.c')
-rw-r--r--drivers/md/dm-linear.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/md/dm-linear.c b/drivers/md/dm-linear.c
index 328cad5617a..3921e3bb43c 100644
--- a/drivers/md/dm-linear.c
+++ b/drivers/md/dm-linear.c
@@ -29,7 +29,6 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
29{ 29{
30 struct linear_c *lc; 30 struct linear_c *lc;
31 unsigned long long tmp; 31 unsigned long long tmp;
32 char dummy;
33 32
34 if (argc != 2) { 33 if (argc != 2) {
35 ti->error = "Invalid argument count"; 34 ti->error = "Invalid argument count";
@@ -42,7 +41,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
42 return -ENOMEM; 41 return -ENOMEM;
43 } 42 }
44 43
45 if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1) { 44 if (sscanf(argv[1], "%llu", &tmp) != 1) {
46 ti->error = "dm-linear: Invalid device sector"; 45 ti->error = "dm-linear: Invalid device sector";
47 goto bad; 46 goto bad;
48 } 47 }
@@ -55,7 +54,6 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
55 54
56 ti->num_flush_requests = 1; 55 ti->num_flush_requests = 1;
57 ti->num_discard_requests = 1; 56 ti->num_discard_requests = 1;
58 ti->num_write_same_requests = 1;
59 ti->private = lc; 57 ti->private = lc;
60 return 0; 58 return 0;
61 59
@@ -88,7 +86,8 @@ static void linear_map_bio(struct dm_target *ti, struct bio *bio)
88 bio->bi_sector = linear_map_sector(ti, bio->bi_sector); 86 bio->bi_sector = linear_map_sector(ti, bio->bi_sector);
89} 87}
90 88
91static int linear_map(struct dm_target *ti, struct bio *bio) 89static int linear_map(struct dm_target *ti, struct bio *bio,
90 union map_info *map_context)
92{ 91{
93 linear_map_bio(ti, bio); 92 linear_map_bio(ti, bio);
94 93
@@ -96,7 +95,7 @@ static int linear_map(struct dm_target *ti, struct bio *bio)
96} 95}
97 96
98static int linear_status(struct dm_target *ti, status_type_t type, 97static int linear_status(struct dm_target *ti, status_type_t type,
99 unsigned status_flags, char *result, unsigned maxlen) 98 char *result, unsigned int maxlen)
100{ 99{
101 struct linear_c *lc = (struct linear_c *) ti->private; 100 struct linear_c *lc = (struct linear_c *) ti->private;
102 101
@@ -117,17 +116,7 @@ static int linear_ioctl(struct dm_target *ti, unsigned int cmd,
117 unsigned long arg) 116 unsigned long arg)
118{ 117{
119 struct linear_c *lc = (struct linear_c *) ti->private; 118 struct linear_c *lc = (struct linear_c *) ti->private;
120 struct dm_dev *dev = lc->dev; 119 return __blkdev_driver_ioctl(lc->dev->bdev, lc->dev->mode, cmd, arg);
121 int r = 0;
122
123 /*
124 * Only pass ioctls through if the device sizes match exactly.
125 */
126 if (lc->start ||
127 ti->len != i_size_read(dev->bdev->bd_inode) >> SECTOR_SHIFT)
128 r = scsi_verify_blk_ioctl(NULL, cmd);
129
130 return r ? : __blkdev_driver_ioctl(dev->bdev, dev->mode, cmd, arg);
131} 120}
132 121
133static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm, 122static int linear_merge(struct dm_target *ti, struct bvec_merge_data *bvm,
@@ -155,7 +144,7 @@ static int linear_iterate_devices(struct dm_target *ti,
155 144
156static struct target_type linear_target = { 145static struct target_type linear_target = {
157 .name = "linear", 146 .name = "linear",
158 .version = {1, 2, 0}, 147 .version = {1, 1, 0},
159 .module = THIS_MODULE, 148 .module = THIS_MODULE,
160 .ctr = linear_ctr, 149 .ctr = linear_ctr,
161 .dtr = linear_dtr, 150 .dtr = linear_dtr,