summaryrefslogtreecommitdiffstats
path: root/linux-2.4.x/drivers/mtd/mtd_blkdevs-24.c
blob: 688028b7f583840f3314911ed6bac2585a58cf7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
/*
 * $Id: mtd_blkdevs-24.c,v 1.18 2005/11/07 11:14:20 gleixner Exp $
 *
 * (C) 2003 David Woodhouse <dwmw2@infradead.org>
 *
 * Interface to Linux 2.4 block layer for MTD 'translation layers'.
 *
 */

#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/list.h>
#include <linux/fs.h>
#include <linux/mtd/blktrans.h>
#include <linux/mtd/mtd.h>
#include <linux/blkdev.h>
#include <linux/blk.h>
#include <linux/blkpg.h>
#include <linux/spinlock.h>
#include <linux/hdreg.h>
#include <linux/init.h>
#include <asm/semaphore.h>
#include <asm/uaccess.h>

static LIST_HEAD(blktrans_majors);

extern struct semaphore mtd_table_mutex;
extern struct mtd_info *mtd_table[];

struct mtd_blkcore_priv {
	devfs_handle_t devfs_dir_handle;
	int blksizes[256];
	int sizes[256];
	struct hd_struct part_table[256];
	struct gendisk gd;
	spinlock_t devs_lock; /* See comment in _request function */
	struct completion thread_dead;
	int exiting;
	wait_queue_head_t thread_wq;
};

static inline struct mtd_blktrans_dev *tr_get_dev(struct mtd_blktrans_ops *tr,
					   int devnum)
{
	struct list_head *this;
	struct mtd_blktrans_dev *d;

	list_for_each(this, &tr->devs) {
		d = list_entry(this, struct mtd_blktrans_dev, list);

		if (d->devnum == devnum)
			return d;
	}
	return NULL;
}

static inline struct mtd_blktrans_ops *get_tr(int major)
{
	struct list_head *this;
	struct mtd_blktrans_ops *t;

	list_for_each(this, &blktrans_majors) {
		t = list_entry(this, struct mtd_blktrans_ops, list);

		if (t->major == major)
			return t;
	}
	return NULL;
}

static int do_blktrans_request(struct mtd_blktrans_ops *tr,
			       struct mtd_blktrans_dev *dev,
			       struct request *req)
{
	unsigned long block, nsect;
	char *buf;
	int minor;

	minor = MINOR(req->rq_dev);
	block = req->sector;
	nsect = req->current_nr_sectors;
	buf = req->buffer;

	if (block + nsect > tr->blkcore_priv->part_table[minor].nr_sects) {
		printk(KERN_WARNING "Access beyond end of device.\n");
		return 0;
	}
	block += tr->blkcore_priv->part_table[minor].start_sect;

	switch(req->cmd) {
	case READ:
		for (; nsect > 0; nsect--, block++, buf += 512)
			if (tr->readsect(dev, block, buf))
				return 0;
		return 1;

	case WRITE:
		if (!tr->writesect)
			return 0;

		for (; nsect > 0; nsect--, block++, buf += 512)
			if (tr->writesect(dev, block, buf))
				return 0;
		return 1;

	default:
		printk(KERN_NOTICE "Unknown request cmd %d\n", req->cmd);
		return 0;
	}
}

static int mtd_blktrans_thread(void *arg)
{
	struct mtd_blktrans_ops *tr = arg;
	struct request_queue *rq = BLK_DEFAULT_QUEUE(tr->major);

	/* we might get involved when memory gets low, so use PF_MEMALLOC */
	current->flags |= PF_MEMALLOC;

	snprintf(current->comm, sizeof(current->comm), "%sd", tr->name);

	/* daemonize() doesn't do this for us since some kernel threads
	   actually want to deal with signals. We can't just call
	   exit_sighand() since that'll cause an oops when we finally
	   do exit. */
	spin_lock_irq(&current->sigmask_lock);
	sigfillset(&current->blocked);
	recalc_sigpending();
	spin_unlock_irq(&current->sigmask_lock);

	daemonize("%sd", tr->name);

	while (!tr->blkcore_priv->exiting) {
		struct request *req;
		struct mtd_blktrans_dev *dev;
		int devnum;
		int res = 0;
		DECLARE_WAITQUEUE(wait, current);

		spin_lock_irq(&io_request_lock);

		if (list_empty(&rq->queue_head)) {

			add_wait_queue(&tr->blkcore_priv->thread_wq, &wait);
			set_current_state(TASK_INTERRUPTIBLE);

			spin_unlock_irq(&io_request_lock);

			schedule();
			remove_wait_queue(&tr->blkcore_priv->thread_wq, &wait);

			continue;
		}

		req = blkdev_entry_next_request(&rq->queue_head);

		devnum = MINOR(req->rq_dev) >> tr->part_bits;

		/* The ll_rw_blk code knows not to touch the request
		   at the head of the queue */
		spin_unlock_irq(&io_request_lock);

		/* FIXME: Where can we store the dev, on which
		   we already have a refcount anyway? We need to
		   lock against concurrent addition/removal of devices,
		   but if we use the mtd_table_mutex we deadlock when
		   grok_partitions is called from the registration
		   callbacks. */
		spin_lock(&tr->blkcore_priv->devs_lock);
		dev = tr_get_dev(tr, devnum);
		spin_unlock(&tr->blkcore_priv->devs_lock);

		BUG_ON(!dev);

		/* Ensure serialisation of requests */
		down(&dev->sem);

		res = do_blktrans_request(tr, dev, req);
		up(&dev->sem);

		if (!end_that_request_first(req, res, tr->name)) {
			spin_lock_irq(&io_request_lock);
			blkdev_dequeue_request(req);
			end_that_request_last(req);
			spin_unlock_irq(&io_request_lock);
		}
	}
	complete_and_exit(&tr->blkcore_priv->thread_dead, 0);
}

static void mtd_blktrans_request(struct request_queue *rq)
{
	struct mtd_blktrans_ops *tr = rq->queuedata;
	wake_up(&tr->blkcore_priv->thread_wq);
}

int blktrans_open(struct inode *i, struct file *f)
{
	struct mtd_blktrans_ops *tr = NULL;
	struct mtd_blktrans_dev *dev = NULL;
	int major_nr = MAJOR(i->i_rdev);
	int minor_nr = MINOR(i->i_rdev);
	int devnum;
	int ret = -ENODEV;

	if (is_read_only(i->i_rdev) && (f->f_mode & FMODE_WRITE))
		return -EROFS;

	down(&mtd_table_mutex);

	tr = get_tr(major_nr);

	if (!tr)
		goto out;

	devnum = minor_nr >> tr->part_bits;

	dev = tr_get_dev(tr, devnum);

	if (!dev)
		goto out;

	if (!tr->blkcore_priv->part_table[minor_nr].nr_sects) {
		ret = -ENODEV;
		goto out;
	}

	if (!try_inc_mod_count(dev->mtd->owner))
		goto out;

	if (!try_inc_mod_count(tr->owner))
		goto out_tr;

	dev->mtd->usecount++;

	ret = 0;
	if (tr->open && (ret = tr->open(dev))) {
		dev->mtd->usecount--;
		if (dev->mtd->owner)
			__MOD_DEC_USE_COUNT(dev->mtd->owner);
	out_tr:
		if (tr->owner)
			__MOD_DEC_USE_COUNT(tr->owner);
	}
 out:
	up(&mtd_table_mutex);

	return ret;
}

int blktrans_release(struct inode *i, struct file *f)
{
	struct mtd_blktrans_dev *dev;
	struct mtd_blktrans_ops *tr;
	int ret = 0;
	int devnum;

	down(&mtd_table_mutex);

	tr = get_tr(MAJOR(i->i_rdev));
	if (!tr) {
		up(&mtd_table_mutex);
		return -ENODEV;
	}

	devnum = MINOR(i->i_rdev) >> tr->part_bits;
	dev = tr_get_dev(tr, devnum);

	if (!dev) {
		up(&mtd_table_mutex);
		return -ENODEV;
	}

	if (tr->release)
		ret = tr->release(dev);

	if (!ret) {
		dev->mtd->usecount--;
		if (dev->mtd->owner)
			__MOD_DEC_USE_COUNT(dev->mtd->owner);
		if (tr->owner)
			__MOD_DEC_USE_COUNT(tr->owner);
	}

	up(&mtd_table_mutex);

	return ret;
}

static int mtd_blktrans_rrpart(kdev_t rdev, struct mtd_blktrans_ops *tr,
			       struct mtd_blktrans_dev *dev)
{
	struct gendisk *gd = &(tr->blkcore_priv->gd);
	int i;
	int minor = MINOR(rdev);

	if (minor & ((1<<tr->part_bits)-1) || !tr->part_bits) {
		/* BLKRRPART on a partition. Go away. */
		return -ENOTTY;
	}

	if (!capable(CAP_SYS_ADMIN))
	    return -EACCES;

	/* We are required to prevent simultaneous open() ourselves.
	   The core doesn't do that for us. Did I ever mention how
	   much the Linux block layer sucks? Sledgehammer approach... */
	down(&mtd_table_mutex);

	for (i=0; i < (1<<tr->part_bits); i++) {
		invalidate_device(MKDEV(tr->major, minor+i), 1);
		gd->part[minor + i].start_sect = 0;
		gd->part[minor + i].nr_sects = 0;
	}

	grok_partitions(gd, minor, 1 << tr->part_bits,
                        dev->size);
	up(&mtd_table_mutex);

	return 0;
}

static int blktrans_ioctl(struct inode *inode, struct file *file,
			      unsigned int cmd, unsigned long arg)
{
	struct mtd_blktrans_dev *dev;
	struct mtd_blktrans_ops *tr;
	int devnum;

	switch(cmd) {
	case BLKGETSIZE:
        case BLKGETSIZE64:
        case BLKBSZSET:
        case BLKBSZGET:
        case BLKROSET:
        case BLKROGET:
        case BLKRASET:
        case BLKRAGET:
        case BLKPG:
        case BLKELVGET:
        case BLKELVSET:
		return blk_ioctl(inode->i_rdev, cmd, arg);
	}

	down(&mtd_table_mutex);

	tr = get_tr(MAJOR(inode->i_rdev));
	if (!tr) {
		up(&mtd_table_mutex);
		return -ENODEV;
	}

	devnum = MINOR(inode->i_rdev) >> tr->part_bits;
	dev = tr_get_dev(tr, devnum);

	up(&mtd_table_mutex);

	if (!dev)
		return -ENODEV;

	switch(cmd) {
	case BLKRRPART:
		return mtd_blktrans_rrpart(inode->i_rdev, tr, dev);

        case BLKFLSBUF:
		blk_ioctl(inode->i_rdev, cmd, arg);
		if (tr->flush)
			return tr->flush(dev);
		/* The core code did the work, we had nothing to do. */
		return 0;

	case HDIO_GETGEO:
		if (tr->getgeo) {
			struct hd_geometry g;
			struct gendisk *gd = &(tr->blkcore_priv->gd);
			int ret;

			memset(&g, 0, sizeof(g));
			ret = tr->getgeo(dev, &g);
			if (ret)
				return ret;

			g.start = gd->part[MINOR(inode->i_rdev)].start_sect;
			if (copy_to_user((void *)arg, &g, sizeof(g)))
				return -EFAULT;
			return 0;
		} /* else */
	default:
		return -ENOTTY;
	}
}

struct block_device_operations mtd_blktrans_ops = {
	.owner		= THIS_MODULE,
	.open		= blktrans_open,
	.release	= blktrans_release,
	.ioctl		= blktrans_ioctl,
};

int add_mtd_blktrans_dev(struct mtd_blktrans_dev *new)
{
	struct mtd_blktrans_ops *tr = new->tr;
	struct list_head *this;
	int last_devnum = -1;
	int i;

	if (!down_trylock(&mtd_table_mutex)) {
		up(&mtd_table_mutex);
		BUG();
	}

	spin_lock(&tr->blkcore_priv->devs_lock);

	list_for_each(this, &tr->devs) {
		struct mtd_blktrans_dev *d = list_entry(this, struct mtd_blktrans_dev, list);
		if (new->devnum == -1) {
			/* Use first free number */
			if (d->devnum != last_devnum+1) {
				/* Found a free devnum. Plug it in here */
				new->devnum = last_devnum+1;
				list_add_tail(&new->list, &d->list);
				goto added;
			}
		} else if (d->devnum == new->devnum) {
			/* Required number taken */
			spin_unlock(&tr->blkcore_priv->devs_lock);
			return -EBUSY;
		} else if (d->devnum > new->devnum) {
			/* Required number was free */
			list_add_tail(&new->list, &d->list);
			goto added;
		}
		last_devnum = d->devnum;
	}
	if (new->devnum == -1)
		new->devnum = last_devnum+1;

	if ((new->devnum << tr->part_bits) > 256) {
		spin_unlock(&tr->blkcore_priv->devs_lock);
		return -EBUSY;
	}

	init_MUTEX(&new->sem);
	list_add_tail(&new->list, &tr->devs);
 added:
	spin_unlock(&tr->blkcore_priv->devs_lock);

	if (!tr->writesect)
		new->readonly = 1;

	for (i = new->devnum << tr->part_bits;
	     i < (new->devnum+1) << tr->part_bits;
	     i++) {
		set_device_ro(MKDEV(tr->major, i), new->readonly);
		tr->blkcore_priv->blksizes[i] = new->blksize;
		tr->blkcore_priv->sizes[i] = 0;
		tr->blkcore_priv->part_table[i].nr_sects = 0;
		tr->blkcore_priv->part_table[i].start_sect = 0;
	}

	/*
	  <viro_zzz> dwmw2: BLOCK_SIZE_BITS has nothing to do with block devices
	  <viro> dwmw2: any code which sets blk_size[][] should be
			size >> 10 /+ 2.4 and its dumb units */

	tr->blkcore_priv->sizes[new->devnum << tr->part_bits] =
		(new->size * new->blksize) >> 10; /* 2.4 and its dumb units */

	/* But this is still in device's sectors? $DEITY knows */
	tr->blkcore_priv->part_table[new->devnum << tr->part_bits].nr_sects = new->size;

	if (tr->part_bits) {
		grok_partitions(&tr->blkcore_priv->gd, new->devnum,
				1 << tr->part_bits, new->size);
	}
#ifdef CONFIG_DEVFS_FS
	if (!tr->part_bits) {
		char name[2];

		name[0] = '0' + new->devnum;
		name[1] = 0;

		new->blkcore_priv =
			devfs_register(tr->blkcore_priv->devfs_dir_handle,
				       name, DEVFS_FL_DEFAULT, tr->major,
				       new->devnum, S_IFBLK|S_IRUGO|S_IWUGO,
				       &mtd_blktrans_ops, NULL);
	}
#endif
	return 0;
}

int del_mtd_blktrans_dev(struct mtd_blktrans_dev *old)
{
	struct mtd_blktrans_ops *tr = old->tr;
	int i;

	if (!down_trylock(&mtd_table_mutex)) {
		up(&mtd_table_mutex);
		BUG();
	}

#ifdef CONFIG_DEVFS_FS
	if (!tr->part_bits) {
		devfs_unregister(old->blkcore_priv);
		old->blkcore_priv = NULL;
	} else {
		devfs_register_partitions(&tr->blkcore_priv->gd,
					  old->devnum << tr->part_bits, 1);
	}
#endif
	spin_lock(&tr->blkcore_priv->devs_lock);
	list_del(&old->list);
	spin_unlock(&tr->blkcore_priv->devs_lock);

	for (i = (old->devnum << tr->part_bits);
	     i < ((old->devnum+1) << tr->part_bits); i++) {
		tr->blkcore_priv->sizes[i] = 0;
		tr->blkcore_priv->part_table[i].nr_sects = 0;
		tr->blkcore_priv->part_table[i].start_sect = 0;
	}

	return 0;
}

void blktrans_notify_remove(struct mtd_info *mtd)
{
	struct list_head *this, *this2, *next;

	list_for_each(this, &blktrans_majors) {
		struct mtd_blktrans_ops *tr = list_entry(this, struct mtd_blktrans_ops, list);

		list_for_each_safe(this2, next, &tr->devs) {
			struct mtd_blktrans_dev *dev = list_entry(this2, struct mtd_blktrans_dev, list);

			if (dev->mtd == mtd)
				tr->remove_dev(dev);
		}
	}
}

void blktrans_notify_add(struct mtd_info *mtd)
{
	struct list_head *this;

	if (mtd->type == MTD_ABSENT)
		return;

	list_for_each(this, &blktrans_majors) {
		struct mtd_blktrans_ops *tr = list_entry(this, struct mtd_blktrans_ops, list);

		tr->add_mtd(tr, mtd);
	}

}

static struct mtd_notifier blktrans_notifier = {
	.add = blktrans_notify_add,
	.remove = blktrans_notify_remove,
};

int register_mtd_blktrans(struct mtd_blktrans_ops *tr)
{
	int ret, i;

	/* Register the notifier if/when the first device type is
	   registered, to prevent the link/init ordering from fucking
	   us over. */
	if (!blktrans_notifier.list.next)
		register_mtd_user(&blktrans_notifier);

	tr->blkcore_priv = kmalloc(sizeof(*tr->blkcore_priv), GFP_KERNEL);
	if (!tr->blkcore_priv)
		return -ENOMEM;

	memset(tr->blkcore_priv, 0, sizeof(*tr->blkcore_priv));

	down(&mtd_table_mutex);

	ret = devfs_register_blkdev(tr->major, tr->name, &mtd_blktrans_ops);
	if (ret) {
		printk(KERN_WARNING "Unable to register %s block device on major %d: %d\n",
		       tr->name, tr->major, ret);
		kfree(tr->blkcore_priv);
		up(&mtd_table_mutex);
		return ret;
	}

	blk_init_queue(BLK_DEFAULT_QUEUE(tr->major), &mtd_blktrans_request);
	(BLK_DEFAULT_QUEUE(tr->major))->queuedata = tr;

	init_completion(&tr->blkcore_priv->thread_dead);
	init_waitqueue_head(&tr->blkcore_priv->thread_wq);

	ret = kernel_thread(mtd_blktrans_thread, tr,
			  CLONE_FS|CLONE_FILES|CLONE_SIGHAND);
	if (ret < 0) {
		blk_cleanup_queue(BLK_DEFAULT_QUEUE(tr->major));
		devfs_unregister_blkdev(tr->major, tr->name);
		kfree(tr->blkcore_priv);
		up(&mtd_table_mutex);
		return ret;
	}

	tr->blkcore_priv->devfs_dir_handle =
			devfs_mk_dir(NULL, tr->name, NULL);

	blksize_size[tr->major] = tr->blkcore_priv->blksizes;
	blk_size[tr->major] = tr->blkcore_priv->sizes;

	tr->blkcore_priv->gd.major = tr->major;
	tr->blkcore_priv->gd.major_name = tr->name;
	tr->blkcore_priv->gd.minor_shift = tr->part_bits;
	tr->blkcore_priv->gd.max_p = (1<<tr->part_bits) - 1;
	tr->blkcore_priv->gd.part = tr->blkcore_priv->part_table;
	tr->blkcore_priv->gd.sizes = tr->blkcore_priv->sizes;
	tr->blkcore_priv->gd.nr_real = 256 >> tr->part_bits;

	spin_lock_init(&tr->blkcore_priv->devs_lock);

	add_gendisk(&tr->blkcore_priv->gd);

	INIT_LIST_HEAD(&tr->devs);
	list_add(&tr->list, &blktrans_majors);

	for (i=0; i<MAX_MTD_DEVICES; i++) {
		if (mtd_table[i] && mtd_table[i]->type != MTD_ABSENT)
			tr->add_mtd(tr, mtd_table[i]);
	}
	up(&mtd_table_mutex);

	return 0;
}

int deregister_mtd_blktrans(struct mtd_blktrans_ops *tr)
{
	struct list_head *this, *next;

	down(&mtd_table_mutex);

	/* Clean up the kernel thread */
	tr->blkcore_priv->exiting = 1;
	wake_up(&tr->blkcore_priv->thread_wq);
	wait_for_completion(&tr->blkcore_priv->thread_dead);

	/* Remove it from the list of active majors */
	list_del(&tr->list);

	/* Remove each of its devices */
	list_for_each_safe(this, next, &tr->devs) {
		struct mtd_blktrans_dev *dev = list_entry(this, struct mtd_blktrans_dev, list);
		tr->remove_dev(dev);
	}

	blksize_size[tr->major] = NULL;
	blk_size[tr->major] = NULL;

	del_gendisk(&tr->blkcore_priv->gd);

	blk_cleanup_queue(BLK_DEFAULT_QUEUE(tr->major));
	devfs_unregister_blkdev(tr->major, tr->name);

	devfs_unregister(tr->blkcore_priv->devfs_dir_handle);

	up(&mtd_table_mutex);

	kfree(tr->blkcore_priv);

	if (!list_empty(&tr->devs))
		BUG();
	return 0;
}

static void __exit mtd_blktrans_exit(void)
{
	/* No race here -- if someone's currently in register_mtd_blktrans
	   we're screwed anyway. */
	if (blktrans_notifier.list.next)
		unregister_mtd_user(&blktrans_notifier);
}

module_exit(mtd_blktrans_exit);

EXPORT_SYMBOL_GPL(register_mtd_blktrans);
EXPORT_SYMBOL_GPL(deregister_mtd_blktrans);
EXPORT_SYMBOL_GPL(add_mtd_blktrans_dev);
EXPORT_SYMBOL_GPL(del_mtd_blktrans_dev);

MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Common interface to block layer for MTD 'translation layers'");