target_core_file.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. /*******************************************************************************
  2. * Filename: target_core_file.c
  3. *
  4. * This file contains the Storage Engine <-> FILEIO transport specific functions
  5. *
  6. * Copyright (c) 2005 PyX Technologies, Inc.
  7. * Copyright (c) 2005-2006 SBE, Inc. All Rights Reserved.
  8. * Copyright (c) 2007-2010 Rising Tide Systems
  9. * Copyright (c) 2008-2010 Linux-iSCSI.org
  10. *
  11. * Nicholas A. Bellinger <nab@kernel.org>
  12. *
  13. * This program is free software; you can redistribute it and/or modify
  14. * it under the terms of the GNU General Public License as published by
  15. * the Free Software Foundation; either version 2 of the License, or
  16. * (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU General Public License
  24. * along with this program; if not, write to the Free Software
  25. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  26. *
  27. ******************************************************************************/
  28. #include <linux/string.h>
  29. #include <linux/parser.h>
  30. #include <linux/timer.h>
  31. #include <linux/blkdev.h>
  32. #include <linux/slab.h>
  33. #include <linux/spinlock.h>
  34. #include <linux/module.h>
  35. #include <scsi/scsi.h>
  36. #include <scsi/scsi_host.h>
  37. #include <target/target_core_base.h>
  38. #include <target/target_core_backend.h>
  39. #include "target_core_file.h"
  40. static struct se_subsystem_api fileio_template;
  41. /* fd_attach_hba(): (Part of se_subsystem_api_t template)
  42. *
  43. *
  44. */
  45. static int fd_attach_hba(struct se_hba *hba, u32 host_id)
  46. {
  47. struct fd_host *fd_host;
  48. fd_host = kzalloc(sizeof(struct fd_host), GFP_KERNEL);
  49. if (!fd_host) {
  50. pr_err("Unable to allocate memory for struct fd_host\n");
  51. return -ENOMEM;
  52. }
  53. fd_host->fd_host_id = host_id;
  54. hba->hba_ptr = fd_host;
  55. pr_debug("CORE_HBA[%d] - TCM FILEIO HBA Driver %s on Generic"
  56. " Target Core Stack %s\n", hba->hba_id, FD_VERSION,
  57. TARGET_CORE_MOD_VERSION);
  58. pr_debug("CORE_HBA[%d] - Attached FILEIO HBA: %u to Generic"
  59. " MaxSectors: %u\n",
  60. hba->hba_id, fd_host->fd_host_id, FD_MAX_SECTORS);
  61. return 0;
  62. }
  63. static void fd_detach_hba(struct se_hba *hba)
  64. {
  65. struct fd_host *fd_host = hba->hba_ptr;
  66. pr_debug("CORE_HBA[%d] - Detached FILEIO HBA: %u from Generic"
  67. " Target Core\n", hba->hba_id, fd_host->fd_host_id);
  68. kfree(fd_host);
  69. hba->hba_ptr = NULL;
  70. }
  71. static void *fd_allocate_virtdevice(struct se_hba *hba, const char *name)
  72. {
  73. struct fd_dev *fd_dev;
  74. struct fd_host *fd_host = hba->hba_ptr;
  75. fd_dev = kzalloc(sizeof(struct fd_dev), GFP_KERNEL);
  76. if (!fd_dev) {
  77. pr_err("Unable to allocate memory for struct fd_dev\n");
  78. return NULL;
  79. }
  80. fd_dev->fd_host = fd_host;
  81. pr_debug("FILEIO: Allocated fd_dev for %p\n", name);
  82. return fd_dev;
  83. }
  84. /* fd_create_virtdevice(): (Part of se_subsystem_api_t template)
  85. *
  86. *
  87. */
  88. static struct se_device *fd_create_virtdevice(
  89. struct se_hba *hba,
  90. struct se_subsystem_dev *se_dev,
  91. void *p)
  92. {
  93. struct se_device *dev;
  94. struct se_dev_limits dev_limits;
  95. struct queue_limits *limits;
  96. struct fd_dev *fd_dev = p;
  97. struct fd_host *fd_host = hba->hba_ptr;
  98. struct file *file;
  99. struct inode *inode = NULL;
  100. int dev_flags = 0, flags, ret = -EINVAL;
  101. memset(&dev_limits, 0, sizeof(struct se_dev_limits));
  102. /*
  103. * Use O_DSYNC by default instead of O_SYNC to forgo syncing
  104. * of pure timestamp updates.
  105. */
  106. flags = O_RDWR | O_CREAT | O_LARGEFILE | O_DSYNC;
  107. /*
  108. * Optionally allow fd_buffered_io=1 to be enabled for people
  109. * who want use the fs buffer cache as an WriteCache mechanism.
  110. *
  111. * This means that in event of a hard failure, there is a risk
  112. * of silent data-loss if the SCSI client has *not* performed a
  113. * forced unit access (FUA) write, or issued SYNCHRONIZE_CACHE
  114. * to write-out the entire device cache.
  115. */
  116. if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) {
  117. pr_debug("FILEIO: Disabling O_DSYNC, using buffered FILEIO\n");
  118. flags &= ~O_DSYNC;
  119. }
  120. file = filp_open(fd_dev->fd_dev_name, flags, 0600);
  121. if (IS_ERR(file)) {
  122. pr_err("filp_open(%s) failed\n", fd_dev->fd_dev_name);
  123. ret = PTR_ERR(file);
  124. goto fail;
  125. }
  126. fd_dev->fd_file = file;
  127. /*
  128. * If using a block backend with this struct file, we extract
  129. * fd_dev->fd_[block,dev]_size from struct block_device.
  130. *
  131. * Otherwise, we use the passed fd_size= from configfs
  132. */
  133. inode = file->f_mapping->host;
  134. if (S_ISBLK(inode->i_mode)) {
  135. struct request_queue *q;
  136. unsigned long long dev_size;
  137. /*
  138. * Setup the local scope queue_limits from struct request_queue->limits
  139. * to pass into transport_add_device_to_core_hba() as struct se_dev_limits.
  140. */
  141. q = bdev_get_queue(inode->i_bdev);
  142. limits = &dev_limits.limits;
  143. limits->logical_block_size = bdev_logical_block_size(inode->i_bdev);
  144. limits->max_hw_sectors = queue_max_hw_sectors(q);
  145. limits->max_sectors = queue_max_sectors(q);
  146. /*
  147. * Determine the number of bytes from i_size_read() minus
  148. * one (1) logical sector from underlying struct block_device
  149. */
  150. fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev);
  151. dev_size = (i_size_read(file->f_mapping->host) -
  152. fd_dev->fd_block_size);
  153. pr_debug("FILEIO: Using size: %llu bytes from struct"
  154. " block_device blocks: %llu logical_block_size: %d\n",
  155. dev_size, div_u64(dev_size, fd_dev->fd_block_size),
  156. fd_dev->fd_block_size);
  157. } else {
  158. if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
  159. pr_err("FILEIO: Missing fd_dev_size="
  160. " parameter, and no backing struct"
  161. " block_device\n");
  162. goto fail;
  163. }
  164. limits = &dev_limits.limits;
  165. limits->logical_block_size = FD_BLOCKSIZE;
  166. limits->max_hw_sectors = FD_MAX_SECTORS;
  167. limits->max_sectors = FD_MAX_SECTORS;
  168. fd_dev->fd_block_size = FD_BLOCKSIZE;
  169. }
  170. dev_limits.hw_queue_depth = FD_MAX_DEVICE_QUEUE_DEPTH;
  171. dev_limits.queue_depth = FD_DEVICE_QUEUE_DEPTH;
  172. dev = transport_add_device_to_core_hba(hba, &fileio_template,
  173. se_dev, dev_flags, fd_dev,
  174. &dev_limits, "FILEIO", FD_VERSION);
  175. if (!dev)
  176. goto fail;
  177. if (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) {
  178. pr_debug("FILEIO: Forcing setting of emulate_write_cache=1"
  179. " with FDBD_HAS_BUFFERED_IO_WCE\n");
  180. dev->se_sub_dev->se_dev_attrib.emulate_write_cache = 1;
  181. }
  182. fd_dev->fd_dev_id = fd_host->fd_host_dev_id_count++;
  183. fd_dev->fd_queue_depth = dev->queue_depth;
  184. pr_debug("CORE_FILE[%u] - Added TCM FILEIO Device ID: %u at %s,"
  185. " %llu total bytes\n", fd_host->fd_host_id, fd_dev->fd_dev_id,
  186. fd_dev->fd_dev_name, fd_dev->fd_dev_size);
  187. return dev;
  188. fail:
  189. if (fd_dev->fd_file) {
  190. filp_close(fd_dev->fd_file, NULL);
  191. fd_dev->fd_file = NULL;
  192. }
  193. return ERR_PTR(ret);
  194. }
  195. /* fd_free_device(): (Part of se_subsystem_api_t template)
  196. *
  197. *
  198. */
  199. static void fd_free_device(void *p)
  200. {
  201. struct fd_dev *fd_dev = p;
  202. if (fd_dev->fd_file) {
  203. filp_close(fd_dev->fd_file, NULL);
  204. fd_dev->fd_file = NULL;
  205. }
  206. kfree(fd_dev);
  207. }
  208. static int fd_do_readv(struct se_cmd *cmd, struct scatterlist *sgl,
  209. u32 sgl_nents)
  210. {
  211. struct se_device *se_dev = cmd->se_dev;
  212. struct fd_dev *dev = se_dev->dev_ptr;
  213. struct file *fd = dev->fd_file;
  214. struct scatterlist *sg;
  215. struct iovec *iov;
  216. mm_segment_t old_fs;
  217. loff_t pos = (cmd->t_task_lba *
  218. se_dev->se_sub_dev->se_dev_attrib.block_size);
  219. int ret = 0, i;
  220. iov = kzalloc(sizeof(struct iovec) * sgl_nents, GFP_KERNEL);
  221. if (!iov) {
  222. pr_err("Unable to allocate fd_do_readv iov[]\n");
  223. return -ENOMEM;
  224. }
  225. for_each_sg(sgl, sg, sgl_nents, i) {
  226. iov[i].iov_len = sg->length;
  227. iov[i].iov_base = sg_virt(sg);
  228. }
  229. old_fs = get_fs();
  230. set_fs(get_ds());
  231. ret = vfs_readv(fd, &iov[0], sgl_nents, &pos);
  232. set_fs(old_fs);
  233. kfree(iov);
  234. /*
  235. * Return zeros and GOOD status even if the READ did not return
  236. * the expected virt_size for struct file w/o a backing struct
  237. * block_device.
  238. */
  239. if (S_ISBLK(fd->f_dentry->d_inode->i_mode)) {
  240. if (ret < 0 || ret != cmd->data_length) {
  241. pr_err("vfs_readv() returned %d,"
  242. " expecting %d for S_ISBLK\n", ret,
  243. (int)cmd->data_length);
  244. return (ret < 0 ? ret : -EINVAL);
  245. }
  246. } else {
  247. if (ret < 0) {
  248. pr_err("vfs_readv() returned %d for non"
  249. " S_ISBLK\n", ret);
  250. return ret;
  251. }
  252. }
  253. return 1;
  254. }
  255. static int fd_do_writev(struct se_cmd *cmd, struct scatterlist *sgl,
  256. u32 sgl_nents)
  257. {
  258. struct se_device *se_dev = cmd->se_dev;
  259. struct fd_dev *dev = se_dev->dev_ptr;
  260. struct file *fd = dev->fd_file;
  261. struct scatterlist *sg;
  262. struct iovec *iov;
  263. mm_segment_t old_fs;
  264. loff_t pos = (cmd->t_task_lba *
  265. se_dev->se_sub_dev->se_dev_attrib.block_size);
  266. int ret, i = 0;
  267. iov = kzalloc(sizeof(struct iovec) * sgl_nents, GFP_KERNEL);
  268. if (!iov) {
  269. pr_err("Unable to allocate fd_do_writev iov[]\n");
  270. return -ENOMEM;
  271. }
  272. for_each_sg(sgl, sg, sgl_nents, i) {
  273. iov[i].iov_len = sg->length;
  274. iov[i].iov_base = sg_virt(sg);
  275. }
  276. old_fs = get_fs();
  277. set_fs(get_ds());
  278. ret = vfs_writev(fd, &iov[0], sgl_nents, &pos);
  279. set_fs(old_fs);
  280. kfree(iov);
  281. if (ret < 0 || ret != cmd->data_length) {
  282. pr_err("vfs_writev() returned %d\n", ret);
  283. return (ret < 0 ? ret : -EINVAL);
  284. }
  285. return 1;
  286. }
  287. static int fd_execute_sync_cache(struct se_cmd *cmd)
  288. {
  289. struct se_device *dev = cmd->se_dev;
  290. struct fd_dev *fd_dev = dev->dev_ptr;
  291. int immed = (cmd->t_task_cdb[1] & 0x2);
  292. loff_t start, end;
  293. int ret;
  294. /*
  295. * If the Immediate bit is set, queue up the GOOD response
  296. * for this SYNCHRONIZE_CACHE op
  297. */
  298. if (immed)
  299. target_complete_cmd(cmd, SAM_STAT_GOOD);
  300. /*
  301. * Determine if we will be flushing the entire device.
  302. */
  303. if (cmd->t_task_lba == 0 && cmd->data_length == 0) {
  304. start = 0;
  305. end = LLONG_MAX;
  306. } else {
  307. start = cmd->t_task_lba * dev->se_sub_dev->se_dev_attrib.block_size;
  308. if (cmd->data_length)
  309. end = start + cmd->data_length;
  310. else
  311. end = LLONG_MAX;
  312. }
  313. ret = vfs_fsync_range(fd_dev->fd_file, start, end, 1);
  314. if (ret != 0)
  315. pr_err("FILEIO: vfs_fsync_range() failed: %d\n", ret);
  316. if (immed)
  317. return 0;
  318. if (ret) {
  319. cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
  320. target_complete_cmd(cmd, SAM_STAT_CHECK_CONDITION);
  321. } else {
  322. target_complete_cmd(cmd, SAM_STAT_GOOD);
  323. }
  324. return 0;
  325. }
  326. static int fd_execute_rw(struct se_cmd *cmd)
  327. {
  328. struct scatterlist *sgl = cmd->t_data_sg;
  329. u32 sgl_nents = cmd->t_data_nents;
  330. enum dma_data_direction data_direction = cmd->data_direction;
  331. struct se_device *dev = cmd->se_dev;
  332. int ret = 0;
  333. /*
  334. * Call vectorized fileio functions to map struct scatterlist
  335. * physical memory addresses to struct iovec virtual memory.
  336. */
  337. if (data_direction == DMA_FROM_DEVICE) {
  338. ret = fd_do_readv(cmd, sgl, sgl_nents);
  339. } else {
  340. ret = fd_do_writev(cmd, sgl, sgl_nents);
  341. /*
  342. * Perform implict vfs_fsync_range() for fd_do_writev() ops
  343. * for SCSI WRITEs with Forced Unit Access (FUA) set.
  344. * Allow this to happen independent of WCE=0 setting.
  345. */
  346. if (ret > 0 &&
  347. dev->se_sub_dev->se_dev_attrib.emulate_fua_write > 0 &&
  348. (cmd->se_cmd_flags & SCF_FUA)) {
  349. struct fd_dev *fd_dev = dev->dev_ptr;
  350. loff_t start = cmd->t_task_lba *
  351. dev->se_sub_dev->se_dev_attrib.block_size;
  352. loff_t end = start + cmd->data_length;
  353. vfs_fsync_range(fd_dev->fd_file, start, end, 1);
  354. }
  355. }
  356. if (ret < 0) {
  357. cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
  358. return ret;
  359. }
  360. if (ret)
  361. target_complete_cmd(cmd, SAM_STAT_GOOD);
  362. return 0;
  363. }
  364. enum {
  365. Opt_fd_dev_name, Opt_fd_dev_size, Opt_fd_buffered_io, Opt_err
  366. };
  367. static match_table_t tokens = {
  368. {Opt_fd_dev_name, "fd_dev_name=%s"},
  369. {Opt_fd_dev_size, "fd_dev_size=%s"},
  370. {Opt_fd_buffered_io, "fd_buffered_io=%d"},
  371. {Opt_err, NULL}
  372. };
  373. static ssize_t fd_set_configfs_dev_params(
  374. struct se_hba *hba,
  375. struct se_subsystem_dev *se_dev,
  376. const char *page, ssize_t count)
  377. {
  378. struct fd_dev *fd_dev = se_dev->se_dev_su_ptr;
  379. char *orig, *ptr, *arg_p, *opts;
  380. substring_t args[MAX_OPT_ARGS];
  381. int ret = 0, arg, token;
  382. opts = kstrdup(page, GFP_KERNEL);
  383. if (!opts)
  384. return -ENOMEM;
  385. orig = opts;
  386. while ((ptr = strsep(&opts, ",\n")) != NULL) {
  387. if (!*ptr)
  388. continue;
  389. token = match_token(ptr, tokens, args);
  390. switch (token) {
  391. case Opt_fd_dev_name:
  392. if (match_strlcpy(fd_dev->fd_dev_name, &args[0],
  393. FD_MAX_DEV_NAME) == 0) {
  394. ret = -EINVAL;
  395. break;
  396. }
  397. pr_debug("FILEIO: Referencing Path: %s\n",
  398. fd_dev->fd_dev_name);
  399. fd_dev->fbd_flags |= FBDF_HAS_PATH;
  400. break;
  401. case Opt_fd_dev_size:
  402. arg_p = match_strdup(&args[0]);
  403. if (!arg_p) {
  404. ret = -ENOMEM;
  405. break;
  406. }
  407. ret = strict_strtoull(arg_p, 0, &fd_dev->fd_dev_size);
  408. kfree(arg_p);
  409. if (ret < 0) {
  410. pr_err("strict_strtoull() failed for"
  411. " fd_dev_size=\n");
  412. goto out;
  413. }
  414. pr_debug("FILEIO: Referencing Size: %llu"
  415. " bytes\n", fd_dev->fd_dev_size);
  416. fd_dev->fbd_flags |= FBDF_HAS_SIZE;
  417. break;
  418. case Opt_fd_buffered_io:
  419. match_int(args, &arg);
  420. if (arg != 1) {
  421. pr_err("bogus fd_buffered_io=%d value\n", arg);
  422. ret = -EINVAL;
  423. goto out;
  424. }
  425. pr_debug("FILEIO: Using buffered I/O"
  426. " operations for struct fd_dev\n");
  427. fd_dev->fbd_flags |= FDBD_HAS_BUFFERED_IO_WCE;
  428. break;
  429. default:
  430. break;
  431. }
  432. }
  433. out:
  434. kfree(orig);
  435. return (!ret) ? count : ret;
  436. }
  437. static ssize_t fd_check_configfs_dev_params(struct se_hba *hba, struct se_subsystem_dev *se_dev)
  438. {
  439. struct fd_dev *fd_dev = se_dev->se_dev_su_ptr;
  440. if (!(fd_dev->fbd_flags & FBDF_HAS_PATH)) {
  441. pr_err("Missing fd_dev_name=\n");
  442. return -EINVAL;
  443. }
  444. return 0;
  445. }
  446. static ssize_t fd_show_configfs_dev_params(
  447. struct se_hba *hba,
  448. struct se_subsystem_dev *se_dev,
  449. char *b)
  450. {
  451. struct fd_dev *fd_dev = se_dev->se_dev_su_ptr;
  452. ssize_t bl = 0;
  453. bl = sprintf(b + bl, "TCM FILEIO ID: %u", fd_dev->fd_dev_id);
  454. bl += sprintf(b + bl, " File: %s Size: %llu Mode: %s\n",
  455. fd_dev->fd_dev_name, fd_dev->fd_dev_size,
  456. (fd_dev->fbd_flags & FDBD_HAS_BUFFERED_IO_WCE) ?
  457. "Buffered-WCE" : "O_DSYNC");
  458. return bl;
  459. }
  460. /* fd_get_device_rev(): (Part of se_subsystem_api_t template)
  461. *
  462. *
  463. */
  464. static u32 fd_get_device_rev(struct se_device *dev)
  465. {
  466. return SCSI_SPC_2; /* Returns SPC-3 in Initiator Data */
  467. }
  468. /* fd_get_device_type(): (Part of se_subsystem_api_t template)
  469. *
  470. *
  471. */
  472. static u32 fd_get_device_type(struct se_device *dev)
  473. {
  474. return TYPE_DISK;
  475. }
  476. static sector_t fd_get_blocks(struct se_device *dev)
  477. {
  478. struct fd_dev *fd_dev = dev->dev_ptr;
  479. struct file *f = fd_dev->fd_file;
  480. struct inode *i = f->f_mapping->host;
  481. unsigned long long dev_size;
  482. /*
  483. * When using a file that references an underlying struct block_device,
  484. * ensure dev_size is always based on the current inode size in order
  485. * to handle underlying block_device resize operations.
  486. */
  487. if (S_ISBLK(i->i_mode))
  488. dev_size = (i_size_read(i) - fd_dev->fd_block_size);
  489. else
  490. dev_size = fd_dev->fd_dev_size;
  491. return div_u64(dev_size, dev->se_sub_dev->se_dev_attrib.block_size);
  492. }
  493. static struct spc_ops fd_spc_ops = {
  494. .execute_rw = fd_execute_rw,
  495. .execute_sync_cache = fd_execute_sync_cache,
  496. };
  497. static int fd_parse_cdb(struct se_cmd *cmd)
  498. {
  499. return sbc_parse_cdb(cmd, &fd_spc_ops);
  500. }
  501. static struct se_subsystem_api fileio_template = {
  502. .name = "fileio",
  503. .owner = THIS_MODULE,
  504. .transport_type = TRANSPORT_PLUGIN_VHBA_PDEV,
  505. .attach_hba = fd_attach_hba,
  506. .detach_hba = fd_detach_hba,
  507. .allocate_virtdevice = fd_allocate_virtdevice,
  508. .create_virtdevice = fd_create_virtdevice,
  509. .free_device = fd_free_device,
  510. .parse_cdb = fd_parse_cdb,
  511. .check_configfs_dev_params = fd_check_configfs_dev_params,
  512. .set_configfs_dev_params = fd_set_configfs_dev_params,
  513. .show_configfs_dev_params = fd_show_configfs_dev_params,
  514. .get_device_rev = fd_get_device_rev,
  515. .get_device_type = fd_get_device_type,
  516. .get_blocks = fd_get_blocks,
  517. };
  518. static int __init fileio_module_init(void)
  519. {
  520. return transport_subsystem_register(&fileio_template);
  521. }
  522. static void fileio_module_exit(void)
  523. {
  524. transport_subsystem_release(&fileio_template);
  525. }
  526. MODULE_DESCRIPTION("TCM FILEIO subsystem plugin");
  527. MODULE_AUTHOR("nab@Linux-iSCSI.org");
  528. MODULE_LICENSE("GPL");
  529. module_init(fileio_module_init);
  530. module_exit(fileio_module_exit);