target: move sync_cache to struct spc_ops
[deliverable/linux.git] / drivers / target / target_core_iblock.c
1 /*******************************************************************************
2 * Filename: target_core_iblock.c
3 *
4 * This file contains the Storage Engine <-> Linux BlockIO transport
5 * specific functions.
6 *
7 * Copyright (c) 2003, 2004, 2005 PyX Technologies, Inc.
8 * Copyright (c) 2005, 2006, 2007 SBE, Inc.
9 * Copyright (c) 2007-2010 Rising Tide Systems
10 * Copyright (c) 2008-2010 Linux-iSCSI.org
11 *
12 * Nicholas A. Bellinger <nab@kernel.org>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
27 *
28 ******************************************************************************/
29
30 #include <linux/string.h>
31 #include <linux/parser.h>
32 #include <linux/timer.h>
33 #include <linux/fs.h>
34 #include <linux/blkdev.h>
35 #include <linux/slab.h>
36 #include <linux/spinlock.h>
37 #include <linux/bio.h>
38 #include <linux/genhd.h>
39 #include <linux/file.h>
40 #include <linux/module.h>
41 #include <scsi/scsi.h>
42 #include <scsi/scsi_host.h>
43
44 #include <target/target_core_base.h>
45 #include <target/target_core_backend.h>
46
47 #include "target_core_iblock.h"
48
49 #define IBLOCK_MAX_BIO_PER_TASK 32 /* max # of bios to submit at a time */
50 #define IBLOCK_BIO_POOL_SIZE 128
51
52 static struct se_subsystem_api iblock_template;
53
54 static void iblock_bio_done(struct bio *, int);
55
56 /* iblock_attach_hba(): (Part of se_subsystem_api_t template)
57 *
58 *
59 */
60 static int iblock_attach_hba(struct se_hba *hba, u32 host_id)
61 {
62 pr_debug("CORE_HBA[%d] - TCM iBlock HBA Driver %s on"
63 " Generic Target Core Stack %s\n", hba->hba_id,
64 IBLOCK_VERSION, TARGET_CORE_MOD_VERSION);
65 return 0;
66 }
67
68 static void iblock_detach_hba(struct se_hba *hba)
69 {
70 }
71
72 static void *iblock_allocate_virtdevice(struct se_hba *hba, const char *name)
73 {
74 struct iblock_dev *ib_dev = NULL;
75
76 ib_dev = kzalloc(sizeof(struct iblock_dev), GFP_KERNEL);
77 if (!ib_dev) {
78 pr_err("Unable to allocate struct iblock_dev\n");
79 return NULL;
80 }
81
82 pr_debug( "IBLOCK: Allocated ib_dev for %s\n", name);
83
84 return ib_dev;
85 }
86
87 static struct se_device *iblock_create_virtdevice(
88 struct se_hba *hba,
89 struct se_subsystem_dev *se_dev,
90 void *p)
91 {
92 struct iblock_dev *ib_dev = p;
93 struct se_device *dev;
94 struct se_dev_limits dev_limits;
95 struct block_device *bd = NULL;
96 struct request_queue *q;
97 struct queue_limits *limits;
98 u32 dev_flags = 0;
99 fmode_t mode;
100 int ret = -EINVAL;
101
102 if (!ib_dev) {
103 pr_err("Unable to locate struct iblock_dev parameter\n");
104 return ERR_PTR(ret);
105 }
106 memset(&dev_limits, 0, sizeof(struct se_dev_limits));
107
108 ib_dev->ibd_bio_set = bioset_create(IBLOCK_BIO_POOL_SIZE, 0);
109 if (!ib_dev->ibd_bio_set) {
110 pr_err("IBLOCK: Unable to create bioset()\n");
111 return ERR_PTR(-ENOMEM);
112 }
113 pr_debug("IBLOCK: Created bio_set()\n");
114 /*
115 * iblock_check_configfs_dev_params() ensures that ib_dev->ibd_udev_path
116 * must already have been set in order for echo 1 > $HBA/$DEV/enable to run.
117 */
118 pr_debug( "IBLOCK: Claiming struct block_device: %s\n",
119 ib_dev->ibd_udev_path);
120
121 mode = FMODE_READ|FMODE_EXCL;
122 if (!ib_dev->ibd_readonly)
123 mode |= FMODE_WRITE;
124
125 bd = blkdev_get_by_path(ib_dev->ibd_udev_path, mode, ib_dev);
126 if (IS_ERR(bd)) {
127 ret = PTR_ERR(bd);
128 goto failed;
129 }
130 /*
131 * Setup the local scope queue_limits from struct request_queue->limits
132 * to pass into transport_add_device_to_core_hba() as struct se_dev_limits.
133 */
134 q = bdev_get_queue(bd);
135 limits = &dev_limits.limits;
136 limits->logical_block_size = bdev_logical_block_size(bd);
137 limits->max_hw_sectors = UINT_MAX;
138 limits->max_sectors = UINT_MAX;
139 dev_limits.hw_queue_depth = q->nr_requests;
140 dev_limits.queue_depth = q->nr_requests;
141
142 ib_dev->ibd_bd = bd;
143
144 dev = transport_add_device_to_core_hba(hba,
145 &iblock_template, se_dev, dev_flags, ib_dev,
146 &dev_limits, "IBLOCK", IBLOCK_VERSION);
147 if (!dev)
148 goto failed;
149
150 /*
151 * Check if the underlying struct block_device request_queue supports
152 * the QUEUE_FLAG_DISCARD bit for UNMAP/WRITE_SAME in SCSI + TRIM
153 * in ATA and we need to set TPE=1
154 */
155 if (blk_queue_discard(q)) {
156 dev->se_sub_dev->se_dev_attrib.max_unmap_lba_count =
157 q->limits.max_discard_sectors;
158 /*
159 * Currently hardcoded to 1 in Linux/SCSI code..
160 */
161 dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1;
162 dev->se_sub_dev->se_dev_attrib.unmap_granularity =
163 q->limits.discard_granularity >> 9;
164 dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment =
165 q->limits.discard_alignment;
166
167 pr_debug("IBLOCK: BLOCK Discard support available,"
168 " disabled by default\n");
169 }
170
171 if (blk_queue_nonrot(q))
172 dev->se_sub_dev->se_dev_attrib.is_nonrot = 1;
173
174 return dev;
175
176 failed:
177 if (ib_dev->ibd_bio_set) {
178 bioset_free(ib_dev->ibd_bio_set);
179 ib_dev->ibd_bio_set = NULL;
180 }
181 ib_dev->ibd_bd = NULL;
182 return ERR_PTR(ret);
183 }
184
185 static void iblock_free_device(void *p)
186 {
187 struct iblock_dev *ib_dev = p;
188
189 if (ib_dev->ibd_bd != NULL)
190 blkdev_put(ib_dev->ibd_bd, FMODE_WRITE|FMODE_READ|FMODE_EXCL);
191 if (ib_dev->ibd_bio_set != NULL)
192 bioset_free(ib_dev->ibd_bio_set);
193 kfree(ib_dev);
194 }
195
196 static unsigned long long iblock_emulate_read_cap_with_block_size(
197 struct se_device *dev,
198 struct block_device *bd,
199 struct request_queue *q)
200 {
201 unsigned long long blocks_long = (div_u64(i_size_read(bd->bd_inode),
202 bdev_logical_block_size(bd)) - 1);
203 u32 block_size = bdev_logical_block_size(bd);
204
205 if (block_size == dev->se_sub_dev->se_dev_attrib.block_size)
206 return blocks_long;
207
208 switch (block_size) {
209 case 4096:
210 switch (dev->se_sub_dev->se_dev_attrib.block_size) {
211 case 2048:
212 blocks_long <<= 1;
213 break;
214 case 1024:
215 blocks_long <<= 2;
216 break;
217 case 512:
218 blocks_long <<= 3;
219 default:
220 break;
221 }
222 break;
223 case 2048:
224 switch (dev->se_sub_dev->se_dev_attrib.block_size) {
225 case 4096:
226 blocks_long >>= 1;
227 break;
228 case 1024:
229 blocks_long <<= 1;
230 break;
231 case 512:
232 blocks_long <<= 2;
233 break;
234 default:
235 break;
236 }
237 break;
238 case 1024:
239 switch (dev->se_sub_dev->se_dev_attrib.block_size) {
240 case 4096:
241 blocks_long >>= 2;
242 break;
243 case 2048:
244 blocks_long >>= 1;
245 break;
246 case 512:
247 blocks_long <<= 1;
248 break;
249 default:
250 break;
251 }
252 break;
253 case 512:
254 switch (dev->se_sub_dev->se_dev_attrib.block_size) {
255 case 4096:
256 blocks_long >>= 3;
257 break;
258 case 2048:
259 blocks_long >>= 2;
260 break;
261 case 1024:
262 blocks_long >>= 1;
263 break;
264 default:
265 break;
266 }
267 break;
268 default:
269 break;
270 }
271
272 return blocks_long;
273 }
274
275 static void iblock_end_io_flush(struct bio *bio, int err)
276 {
277 struct se_cmd *cmd = bio->bi_private;
278
279 if (err)
280 pr_err("IBLOCK: cache flush failed: %d\n", err);
281
282 if (cmd) {
283 if (err) {
284 cmd->scsi_sense_reason =
285 TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
286 target_complete_cmd(cmd, SAM_STAT_CHECK_CONDITION);
287 } else {
288 target_complete_cmd(cmd, SAM_STAT_GOOD);
289 }
290 }
291
292 bio_put(bio);
293 }
294
295 /*
296 * Implement SYCHRONIZE CACHE. Note that we can't handle lba ranges and must
297 * always flush the whole cache.
298 */
299 static int iblock_execute_sync_cache(struct se_cmd *cmd)
300 {
301 struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr;
302 int immed = (cmd->t_task_cdb[1] & 0x2);
303 struct bio *bio;
304
305 /*
306 * If the Immediate bit is set, queue up the GOOD response
307 * for this SYNCHRONIZE_CACHE op.
308 */
309 if (immed)
310 target_complete_cmd(cmd, SAM_STAT_GOOD);
311
312 bio = bio_alloc(GFP_KERNEL, 0);
313 bio->bi_end_io = iblock_end_io_flush;
314 bio->bi_bdev = ib_dev->ibd_bd;
315 if (!immed)
316 bio->bi_private = cmd;
317 submit_bio(WRITE_FLUSH, bio);
318 return 0;
319 }
320
321 static int iblock_do_discard(struct se_device *dev, sector_t lba, u32 range)
322 {
323 struct iblock_dev *ibd = dev->dev_ptr;
324 struct block_device *bd = ibd->ibd_bd;
325 int barrier = 0;
326
327 return blkdev_issue_discard(bd, lba, range, GFP_KERNEL, barrier);
328 }
329
330 enum {
331 Opt_udev_path, Opt_readonly, Opt_force, Opt_err
332 };
333
334 static match_table_t tokens = {
335 {Opt_udev_path, "udev_path=%s"},
336 {Opt_readonly, "readonly=%d"},
337 {Opt_force, "force=%d"},
338 {Opt_err, NULL}
339 };
340
341 static ssize_t iblock_set_configfs_dev_params(struct se_hba *hba,
342 struct se_subsystem_dev *se_dev,
343 const char *page, ssize_t count)
344 {
345 struct iblock_dev *ib_dev = se_dev->se_dev_su_ptr;
346 char *orig, *ptr, *arg_p, *opts;
347 substring_t args[MAX_OPT_ARGS];
348 int ret = 0, token;
349 unsigned long tmp_readonly;
350
351 opts = kstrdup(page, GFP_KERNEL);
352 if (!opts)
353 return -ENOMEM;
354
355 orig = opts;
356
357 while ((ptr = strsep(&opts, ",\n")) != NULL) {
358 if (!*ptr)
359 continue;
360
361 token = match_token(ptr, tokens, args);
362 switch (token) {
363 case Opt_udev_path:
364 if (ib_dev->ibd_bd) {
365 pr_err("Unable to set udev_path= while"
366 " ib_dev->ibd_bd exists\n");
367 ret = -EEXIST;
368 goto out;
369 }
370 arg_p = match_strdup(&args[0]);
371 if (!arg_p) {
372 ret = -ENOMEM;
373 break;
374 }
375 snprintf(ib_dev->ibd_udev_path, SE_UDEV_PATH_LEN,
376 "%s", arg_p);
377 kfree(arg_p);
378 pr_debug("IBLOCK: Referencing UDEV path: %s\n",
379 ib_dev->ibd_udev_path);
380 ib_dev->ibd_flags |= IBDF_HAS_UDEV_PATH;
381 break;
382 case Opt_readonly:
383 arg_p = match_strdup(&args[0]);
384 if (!arg_p) {
385 ret = -ENOMEM;
386 break;
387 }
388 ret = strict_strtoul(arg_p, 0, &tmp_readonly);
389 kfree(arg_p);
390 if (ret < 0) {
391 pr_err("strict_strtoul() failed for"
392 " readonly=\n");
393 goto out;
394 }
395 ib_dev->ibd_readonly = tmp_readonly;
396 pr_debug("IBLOCK: readonly: %d\n", ib_dev->ibd_readonly);
397 break;
398 case Opt_force:
399 break;
400 default:
401 break;
402 }
403 }
404
405 out:
406 kfree(orig);
407 return (!ret) ? count : ret;
408 }
409
410 static ssize_t iblock_check_configfs_dev_params(
411 struct se_hba *hba,
412 struct se_subsystem_dev *se_dev)
413 {
414 struct iblock_dev *ibd = se_dev->se_dev_su_ptr;
415
416 if (!(ibd->ibd_flags & IBDF_HAS_UDEV_PATH)) {
417 pr_err("Missing udev_path= parameters for IBLOCK\n");
418 return -EINVAL;
419 }
420
421 return 0;
422 }
423
424 static ssize_t iblock_show_configfs_dev_params(
425 struct se_hba *hba,
426 struct se_subsystem_dev *se_dev,
427 char *b)
428 {
429 struct iblock_dev *ibd = se_dev->se_dev_su_ptr;
430 struct block_device *bd = ibd->ibd_bd;
431 char buf[BDEVNAME_SIZE];
432 ssize_t bl = 0;
433
434 if (bd)
435 bl += sprintf(b + bl, "iBlock device: %s",
436 bdevname(bd, buf));
437 if (ibd->ibd_flags & IBDF_HAS_UDEV_PATH)
438 bl += sprintf(b + bl, " UDEV PATH: %s",
439 ibd->ibd_udev_path);
440 bl += sprintf(b + bl, " readonly: %d\n", ibd->ibd_readonly);
441
442 bl += sprintf(b + bl, " ");
443 if (bd) {
444 bl += sprintf(b + bl, "Major: %d Minor: %d %s\n",
445 MAJOR(bd->bd_dev), MINOR(bd->bd_dev), (!bd->bd_contains) ?
446 "" : (bd->bd_holder == ibd) ?
447 "CLAIMED: IBLOCK" : "CLAIMED: OS");
448 } else {
449 bl += sprintf(b + bl, "Major: 0 Minor: 0\n");
450 }
451
452 return bl;
453 }
454
455 static void iblock_complete_cmd(struct se_cmd *cmd)
456 {
457 struct iblock_req *ibr = cmd->priv;
458 u8 status;
459
460 if (!atomic_dec_and_test(&ibr->pending))
461 return;
462
463 if (atomic_read(&ibr->ib_bio_err_cnt))
464 status = SAM_STAT_CHECK_CONDITION;
465 else
466 status = SAM_STAT_GOOD;
467
468 target_complete_cmd(cmd, status);
469 kfree(ibr);
470 }
471
472 static void iblock_bio_destructor(struct bio *bio)
473 {
474 struct se_cmd *cmd = bio->bi_private;
475 struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr;
476
477 bio_free(bio, ib_dev->ibd_bio_set);
478 }
479
480 static struct bio *
481 iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num)
482 {
483 struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr;
484 struct bio *bio;
485
486 /*
487 * Only allocate as many vector entries as the bio code allows us to,
488 * we'll loop later on until we have handled the whole request.
489 */
490 if (sg_num > BIO_MAX_PAGES)
491 sg_num = BIO_MAX_PAGES;
492
493 bio = bio_alloc_bioset(GFP_NOIO, sg_num, ib_dev->ibd_bio_set);
494 if (!bio) {
495 pr_err("Unable to allocate memory for bio\n");
496 return NULL;
497 }
498
499 bio->bi_bdev = ib_dev->ibd_bd;
500 bio->bi_private = cmd;
501 bio->bi_destructor = iblock_bio_destructor;
502 bio->bi_end_io = &iblock_bio_done;
503 bio->bi_sector = lba;
504 return bio;
505 }
506
507 static void iblock_submit_bios(struct bio_list *list, int rw)
508 {
509 struct blk_plug plug;
510 struct bio *bio;
511
512 blk_start_plug(&plug);
513 while ((bio = bio_list_pop(list)))
514 submit_bio(rw, bio);
515 blk_finish_plug(&plug);
516 }
517
518 static int iblock_execute_rw(struct se_cmd *cmd)
519 {
520 struct scatterlist *sgl = cmd->t_data_sg;
521 u32 sgl_nents = cmd->t_data_nents;
522 enum dma_data_direction data_direction = cmd->data_direction;
523 struct se_device *dev = cmd->se_dev;
524 struct iblock_req *ibr;
525 struct bio *bio;
526 struct bio_list list;
527 struct scatterlist *sg;
528 u32 sg_num = sgl_nents;
529 sector_t block_lba;
530 unsigned bio_cnt;
531 int rw;
532 int i;
533
534 if (data_direction == DMA_TO_DEVICE) {
535 /*
536 * Force data to disk if we pretend to not have a volatile
537 * write cache, or the initiator set the Force Unit Access bit.
538 */
539 if (dev->se_sub_dev->se_dev_attrib.emulate_write_cache == 0 ||
540 (dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 &&
541 (cmd->se_cmd_flags & SCF_FUA)))
542 rw = WRITE_FUA;
543 else
544 rw = WRITE;
545 } else {
546 rw = READ;
547 }
548
549 /*
550 * Convert the blocksize advertised to the initiator to the 512 byte
551 * units unconditionally used by the Linux block layer.
552 */
553 if (dev->se_sub_dev->se_dev_attrib.block_size == 4096)
554 block_lba = (cmd->t_task_lba << 3);
555 else if (dev->se_sub_dev->se_dev_attrib.block_size == 2048)
556 block_lba = (cmd->t_task_lba << 2);
557 else if (dev->se_sub_dev->se_dev_attrib.block_size == 1024)
558 block_lba = (cmd->t_task_lba << 1);
559 else if (dev->se_sub_dev->se_dev_attrib.block_size == 512)
560 block_lba = cmd->t_task_lba;
561 else {
562 pr_err("Unsupported SCSI -> BLOCK LBA conversion:"
563 " %u\n", dev->se_sub_dev->se_dev_attrib.block_size);
564 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
565 return -ENOSYS;
566 }
567
568 ibr = kzalloc(sizeof(struct iblock_req), GFP_KERNEL);
569 if (!ibr)
570 goto fail;
571 cmd->priv = ibr;
572
573 bio = iblock_get_bio(cmd, block_lba, sgl_nents);
574 if (!bio)
575 goto fail_free_ibr;
576
577 bio_list_init(&list);
578 bio_list_add(&list, bio);
579
580 atomic_set(&ibr->pending, 2);
581 bio_cnt = 1;
582
583 for_each_sg(sgl, sg, sgl_nents, i) {
584 /*
585 * XXX: if the length the device accepts is shorter than the
586 * length of the S/G list entry this will cause and
587 * endless loop. Better hope no driver uses huge pages.
588 */
589 while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset)
590 != sg->length) {
591 if (bio_cnt >= IBLOCK_MAX_BIO_PER_TASK) {
592 iblock_submit_bios(&list, rw);
593 bio_cnt = 0;
594 }
595
596 bio = iblock_get_bio(cmd, block_lba, sg_num);
597 if (!bio)
598 goto fail_put_bios;
599
600 atomic_inc(&ibr->pending);
601 bio_list_add(&list, bio);
602 bio_cnt++;
603 }
604
605 /* Always in 512 byte units for Linux/Block */
606 block_lba += sg->length >> IBLOCK_LBA_SHIFT;
607 sg_num--;
608 }
609
610 iblock_submit_bios(&list, rw);
611 iblock_complete_cmd(cmd);
612 return 0;
613
614 fail_put_bios:
615 while ((bio = bio_list_pop(&list)))
616 bio_put(bio);
617 fail_free_ibr:
618 kfree(ibr);
619 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
620 fail:
621 return -ENOMEM;
622 }
623
624 static u32 iblock_get_device_rev(struct se_device *dev)
625 {
626 return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */
627 }
628
629 static u32 iblock_get_device_type(struct se_device *dev)
630 {
631 return TYPE_DISK;
632 }
633
634 static sector_t iblock_get_blocks(struct se_device *dev)
635 {
636 struct iblock_dev *ibd = dev->dev_ptr;
637 struct block_device *bd = ibd->ibd_bd;
638 struct request_queue *q = bdev_get_queue(bd);
639
640 return iblock_emulate_read_cap_with_block_size(dev, bd, q);
641 }
642
643 static void iblock_bio_done(struct bio *bio, int err)
644 {
645 struct se_cmd *cmd = bio->bi_private;
646 struct iblock_req *ibr = cmd->priv;
647
648 /*
649 * Set -EIO if !BIO_UPTODATE and the passed is still err=0
650 */
651 if (!test_bit(BIO_UPTODATE, &bio->bi_flags) && !err)
652 err = -EIO;
653
654 if (err != 0) {
655 pr_err("test_bit(BIO_UPTODATE) failed for bio: %p,"
656 " err: %d\n", bio, err);
657 /*
658 * Bump the ib_bio_err_cnt and release bio.
659 */
660 atomic_inc(&ibr->ib_bio_err_cnt);
661 smp_mb__after_atomic_inc();
662 }
663
664 bio_put(bio);
665
666 iblock_complete_cmd(cmd);
667 }
668
669 static struct spc_ops iblock_spc_ops = {
670 .execute_rw = iblock_execute_rw,
671 .execute_sync_cache = iblock_execute_sync_cache,
672 };
673
674 static int iblock_parse_cdb(struct se_cmd *cmd)
675 {
676 return sbc_parse_cdb(cmd, &iblock_spc_ops);
677 }
678
679 static struct se_subsystem_api iblock_template = {
680 .name = "iblock",
681 .owner = THIS_MODULE,
682 .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV,
683 .write_cache_emulated = 1,
684 .fua_write_emulated = 1,
685 .attach_hba = iblock_attach_hba,
686 .detach_hba = iblock_detach_hba,
687 .allocate_virtdevice = iblock_allocate_virtdevice,
688 .create_virtdevice = iblock_create_virtdevice,
689 .free_device = iblock_free_device,
690 .parse_cdb = iblock_parse_cdb,
691 .do_discard = iblock_do_discard,
692 .check_configfs_dev_params = iblock_check_configfs_dev_params,
693 .set_configfs_dev_params = iblock_set_configfs_dev_params,
694 .show_configfs_dev_params = iblock_show_configfs_dev_params,
695 .get_device_rev = iblock_get_device_rev,
696 .get_device_type = iblock_get_device_type,
697 .get_blocks = iblock_get_blocks,
698 };
699
700 static int __init iblock_module_init(void)
701 {
702 return transport_subsystem_register(&iblock_template);
703 }
704
705 static void iblock_module_exit(void)
706 {
707 transport_subsystem_release(&iblock_template);
708 }
709
710 MODULE_DESCRIPTION("TCM IBLOCK subsystem plugin");
711 MODULE_AUTHOR("nab@Linux-iSCSI.org");
712 MODULE_LICENSE("GPL");
713
714 module_init(iblock_module_init);
715 module_exit(iblock_module_exit);
This page took 0.047843 seconds and 6 git commands to generate.