aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r--drivers/md/dm-ioctl.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 3edb3477f987..d13bb15a8a02 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include <linux/devfs_fs_kernel.h>
17#include <linux/dm-ioctl.h> 16#include <linux/dm-ioctl.h>
18#include <linux/hdreg.h> 17#include <linux/hdreg.h>
19 18
@@ -68,14 +67,12 @@ static int dm_hash_init(void)
68{ 67{
69 init_buckets(_name_buckets); 68 init_buckets(_name_buckets);
70 init_buckets(_uuid_buckets); 69 init_buckets(_uuid_buckets);
71 devfs_mk_dir(DM_DIR);
72 return 0; 70 return 0;
73} 71}
74 72
75static void dm_hash_exit(void) 73static void dm_hash_exit(void)
76{ 74{
77 dm_hash_remove_all(0); 75 dm_hash_remove_all(0);
78 devfs_remove(DM_DIR);
79} 76}
80 77
81/*----------------------------------------------------------------- 78/*-----------------------------------------------------------------
@@ -172,25 +169,6 @@ static void free_cell(struct hash_cell *hc)
172} 169}
173 170
174/* 171/*
175 * devfs stuff.
176 */
177static int register_with_devfs(struct hash_cell *hc)
178{
179 struct gendisk *disk = dm_disk(hc->md);
180
181 devfs_mk_bdev(MKDEV(disk->major, disk->first_minor),
182 S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP,
183 DM_DIR "/%s", hc->name);
184 return 0;
185}
186
187static int unregister_with_devfs(struct hash_cell *hc)
188{
189 devfs_remove(DM_DIR"/%s", hc->name);
190 return 0;
191}
192
193/*
194 * The kdev_t and uuid of a device can never change once it is 172 * The kdev_t and uuid of a device can never change once it is
195 * initially inserted. 173 * initially inserted.
196 */ 174 */
@@ -226,7 +204,6 @@ static int dm_hash_insert(const char *name, const char *uuid, struct mapped_devi
226 } 204 }
227 list_add(&cell->uuid_list, _uuid_buckets + hash_str(uuid)); 205 list_add(&cell->uuid_list, _uuid_buckets + hash_str(uuid));
228 } 206 }
229 register_with_devfs(cell);
230 dm_get(md); 207 dm_get(md);
231 dm_set_mdptr(md, cell); 208 dm_set_mdptr(md, cell);
232 up_write(&_hash_lock); 209 up_write(&_hash_lock);
@@ -246,7 +223,6 @@ static void __hash_remove(struct hash_cell *hc)
246 /* remove from the dev hash */ 223 /* remove from the dev hash */
247 list_del(&hc->uuid_list); 224 list_del(&hc->uuid_list);
248 list_del(&hc->name_list); 225 list_del(&hc->name_list);
249 unregister_with_devfs(hc);
250 dm_set_mdptr(hc->md, NULL); 226 dm_set_mdptr(hc->md, NULL);
251 227
252 table = dm_get_table(hc->md); 228 table = dm_get_table(hc->md);
@@ -342,16 +318,11 @@ static int dm_hash_rename(const char *old, const char *new)
342 /* 318 /*
343 * rename and move the name cell. 319 * rename and move the name cell.
344 */ 320 */
345 unregister_with_devfs(hc);
346
347 list_del(&hc->name_list); 321 list_del(&hc->name_list);
348 old_name = hc->name; 322 old_name = hc->name;
349 hc->name = new_name; 323 hc->name = new_name;
350 list_add(&hc->name_list, _name_buckets + hash_str(new_name)); 324 list_add(&hc->name_list, _name_buckets + hash_str(new_name));
351 325
352 /* rename the device node in devfs */
353 register_with_devfs(hc);
354
355 /* 326 /*
356 * Wake up any dm event waiters. 327 * Wake up any dm event waiters.
357 */ 328 */
@@ -1501,7 +1472,6 @@ static struct file_operations _ctl_fops = {
1501static struct miscdevice _dm_misc = { 1472static struct miscdevice _dm_misc = {
1502 .minor = MISC_DYNAMIC_MINOR, 1473 .minor = MISC_DYNAMIC_MINOR,
1503 .name = DM_NAME, 1474 .name = DM_NAME,
1504 .devfs_name = "mapper/control",
1505 .fops = &_ctl_fops 1475 .fops = &_ctl_fops
1506}; 1476};
1507 1477