From 0e215343bdaf24f916f93bf68d5e2eb06303a979 Mon Sep 17 00:00:00 2001 From: Dean Hildebrand Date: Wed, 20 Oct 2010 00:18:00 -0400 Subject: [PATCH] --- yaml --- r: 217191 b: refs/heads/master c: 7ab672ce312133ee4a5d85b71447b2b334403681 h: refs/heads/master i: 217189: 78cc061da0ee529c9542cc59bdbee9736ebd6f06 217187: 4eabf66c32d097edaf3f442cefe707fec704efac 217183: 763f3c4ffd506bddf35ae27659a4df2e8d579465 v: v3 --- [refs] | 2 +- trunk/fs/nfs/Makefile | 3 ++ trunk/fs/nfs/nfs4filelayout.c | 78 +++++++++++++++++++++++++++++++++++ trunk/include/linux/nfs_fs.h | 1 + 4 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 trunk/fs/nfs/nfs4filelayout.c diff --git a/[refs] b/[refs] index 7bf78a9ccaa0..6d38732fd2c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 02c35fca7cf4ea2dfdc6db279e230cacbbf4b870 +refs/heads/master: 7ab672ce312133ee4a5d85b71447b2b334403681 diff --git a/trunk/fs/nfs/Makefile b/trunk/fs/nfs/Makefile index bb9e773d4312..08a8889c5149 100644 --- a/trunk/fs/nfs/Makefile +++ b/trunk/fs/nfs/Makefile @@ -18,3 +18,6 @@ nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ nfs-$(CONFIG_NFS_V4_1) += pnfs.o nfs-$(CONFIG_SYSCTL) += sysctl.o nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o + +obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o +nfs_layout_nfsv41_files-y := nfs4filelayout.o diff --git a/trunk/fs/nfs/nfs4filelayout.c b/trunk/fs/nfs/nfs4filelayout.c new file mode 100644 index 000000000000..696e283c2632 --- /dev/null +++ b/trunk/fs/nfs/nfs4filelayout.c @@ -0,0 +1,78 @@ +/* + * Module for the pnfs nfs4 file layout driver. + * Defines all I/O and Policy interface operations, plus code + * to register itself with the pNFS client. + * + * Copyright (c) 2002 + * The Regents of the University of Michigan + * All Rights Reserved + * + * Dean Hildebrand + * + * Permission is granted to use, copy, create derivative works, and + * redistribute this software and such derivative works for any purpose, + * so long as the name of the University of Michigan is not used in + * any advertising or publicity pertaining to the use or distribution + * of this software without specific, written prior authorization. If + * the above copyright notice or any other identification of the + * University of Michigan is included in any copy of any portion of + * this software, then the disclaimer below must also be included. + * + * This software is provided as is, without representation or warranty + * of any kind either express or implied, including without limitation + * the implied warranties of merchantability, fitness for a particular + * purpose, or noninfringement. The Regents of the University of + * Michigan shall not be liable for any damages, including special, + * indirect, incidental, or consequential damages, with respect to any + * claim arising out of or in connection with the use of the software, + * even if it has been or is hereafter advised of the possibility of + * such damages. + */ + +#include +#include "pnfs.h" + +#define NFSDBG_FACILITY NFSDBG_PNFS_LD + +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Dean Hildebrand "); +MODULE_DESCRIPTION("The NFSv4 file layout driver"); + +int +filelayout_initialize_mountpoint(struct nfs_server *nfss) +{ + return 0; +} + +int +filelayout_uninitialize_mountpoint(struct nfs_server *nfss) +{ + dprintk("--> %s\n", __func__); + + return 0; +} + +static struct pnfs_layoutdriver_type filelayout_type = { + .id = LAYOUT_NFSV4_1_FILES, + .name = "LAYOUT_NFSV4_1_FILES", + .owner = THIS_MODULE, + .initialize_mountpoint = filelayout_initialize_mountpoint, + .uninitialize_mountpoint = filelayout_uninitialize_mountpoint, +}; + +static int __init nfs4filelayout_init(void) +{ + printk(KERN_INFO "%s: NFSv4 File Layout Driver Registering...\n", + __func__); + return pnfs_register_layoutdriver(&filelayout_type); +} + +static void __exit nfs4filelayout_exit(void) +{ + printk(KERN_INFO "%s: NFSv4 File Layout Driver Unregistering...\n", + __func__); + pnfs_unregister_layoutdriver(&filelayout_type); +} + +module_init(nfs4filelayout_init); +module_exit(nfs4filelayout_exit); diff --git a/trunk/include/linux/nfs_fs.h b/trunk/include/linux/nfs_fs.h index aba3da2a6227..499872fa895c 100644 --- a/trunk/include/linux/nfs_fs.h +++ b/trunk/include/linux/nfs_fs.h @@ -616,6 +616,7 @@ nfs_fileid_to_ino_t(u64 fileid) #define NFSDBG_MOUNT 0x0400 #define NFSDBG_FSCACHE 0x0800 #define NFSDBG_PNFS 0x1000 +#define NFSDBG_PNFS_LD 0x2000 #define NFSDBG_ALL 0xFFFF #ifdef __KERNEL__