objio_osd.c 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * pNFS Objects layout implementation over open-osd initiator library
  3. *
  4. * Copyright (C) 2009 Panasas Inc. [year of first publication]
  5. * All rights reserved.
  6. *
  7. * Benny Halevy <bhalevy@panasas.com>
  8. * Boaz Harrosh <bharrosh@panasas.com>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2
  12. * See the file COPYING included with this distribution for more details.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions
  16. * are met:
  17. *
  18. * 1. Redistributions of source code must retain the above copyright
  19. * notice, this list of conditions and the following disclaimer.
  20. * 2. Redistributions in binary form must reproduce the above copyright
  21. * notice, this list of conditions and the following disclaimer in the
  22. * documentation and/or other materials provided with the distribution.
  23. * 3. Neither the name of the Panasas company nor the names of its
  24. * contributors may be used to endorse or promote products derived
  25. * from this software without specific prior written permission.
  26. *
  27. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  28. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  29. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  30. * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  31. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  32. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  33. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  34. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  35. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  36. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  37. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. */
  39. #include <linux/module.h>
  40. #include "../pnfs.h"
  41. static struct pnfs_layoutdriver_type objlayout_type = {
  42. .id = LAYOUT_OSD2_OBJECTS,
  43. .name = "LAYOUT_OSD2_OBJECTS",
  44. };
  45. MODULE_DESCRIPTION("pNFS Layout Driver for OSD2 objects");
  46. MODULE_AUTHOR("Benny Halevy <bhalevy@panasas.com>");
  47. MODULE_LICENSE("GPL");
  48. static int __init
  49. objlayout_init(void)
  50. {
  51. int ret = pnfs_register_layoutdriver(&objlayout_type);
  52. if (ret)
  53. printk(KERN_INFO
  54. "%s: Registering OSD pNFS Layout Driver failed: error=%d\n",
  55. __func__, ret);
  56. else
  57. printk(KERN_INFO "%s: Registered OSD pNFS Layout Driver\n",
  58. __func__);
  59. return ret;
  60. }
  61. static void __exit
  62. objlayout_exit(void)
  63. {
  64. pnfs_unregister_layoutdriver(&objlayout_type);
  65. printk(KERN_INFO "%s: Unregistered OSD pNFS Layout Driver\n",
  66. __func__);
  67. }
  68. module_init(objlayout_init);
  69. module_exit(objlayout_exit);