Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pnfs-obj: objlayoutdriver module skeleton

* Define the PNFS_OBJLAYOUT Kconfig option in the nfs
master Kconfig file.
* Add the objlayout driver to the Kernel's Kbuild system.
* Add the fs/nfs/objlayout/Kbuild file for building the
objlayoutdriver.ko driver
* Define fs/nfs/objlayout/objio_osd.c, register the driver on module
initialization and unregister on exit.

[pnfs-obj: remove of CONFIG_PNFS fallout]
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
[added "unsure" clause]
[depend on NFS_V4_1]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>

authored by

Benny Halevy and committed by
Boaz Harrosh
c93407d0 ae50c0b5

+93
+10
fs/nfs/Kconfig
··· 87 87 config PNFS_FILE_LAYOUT 88 88 tristate 89 89 90 + config PNFS_OBJLAYOUT 91 + tristate "Provide support for the pNFS Objects Layout Driver for NFSv4.1 pNFS (EXPERIMENTAL)" 92 + depends on NFS_FS && NFS_V4_1 && SCSI_OSD_ULD 93 + help 94 + Say M here if you want your pNFS client to support the Objects Layout Driver. 95 + Requires the SCSI osd initiator library (SCSI_OSD_INITIATOR) and 96 + upper level driver (SCSI_OSD_ULD). 97 + 98 + If unsure, say N. 99 + 90 100 config ROOT_NFS 91 101 bool "Root file system on NFS" 92 102 depends on NFS_FS=y && IP_PNP
+2
fs/nfs/Makefile
··· 21 21 22 22 obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o 23 23 nfs_layout_nfsv41_files-y := nfs4filelayout.o nfs4filelayoutdev.o 24 + 25 + obj-$(CONFIG_PNFS_OBJLAYOUT) += objlayout/
+5
fs/nfs/objlayout/Kbuild
··· 1 + # 2 + # Makefile for the pNFS Objects Layout Driver kernel module 3 + # 4 + objlayoutdriver-y := objio_osd.o 5 + obj-$(CONFIG_PNFS_OBJLAYOUT) += objlayoutdriver.o
+76
fs/nfs/objlayout/objio_osd.c
··· 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 + 40 + #include <linux/module.h> 41 + #include "../pnfs.h" 42 + 43 + static struct pnfs_layoutdriver_type objlayout_type = { 44 + .id = LAYOUT_OSD2_OBJECTS, 45 + .name = "LAYOUT_OSD2_OBJECTS", 46 + }; 47 + 48 + MODULE_DESCRIPTION("pNFS Layout Driver for OSD2 objects"); 49 + MODULE_AUTHOR("Benny Halevy <bhalevy@panasas.com>"); 50 + MODULE_LICENSE("GPL"); 51 + 52 + static int __init 53 + objlayout_init(void) 54 + { 55 + int ret = pnfs_register_layoutdriver(&objlayout_type); 56 + 57 + if (ret) 58 + printk(KERN_INFO 59 + "%s: Registering OSD pNFS Layout Driver failed: error=%d\n", 60 + __func__, ret); 61 + else 62 + printk(KERN_INFO "%s: Registered OSD pNFS Layout Driver\n", 63 + __func__); 64 + return ret; 65 + } 66 + 67 + static void __exit 68 + objlayout_exit(void) 69 + { 70 + pnfs_unregister_layoutdriver(&objlayout_type); 71 + printk(KERN_INFO "%s: Unregistered OSD pNFS Layout Driver\n", 72 + __func__); 73 + } 74 + 75 + module_init(objlayout_init); 76 + module_exit(objlayout_exit);