diff options
author | Dean Hildebrand <dhildebz@umich.edu> | 2010-10-20 00:18:00 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-10-24 18:07:10 -0400 |
commit | 7ab672ce312133ee4a5d85b71447b2b334403681 (patch) | |
tree | de35b863e3d1762ca89c6e330246134abc7f5f4e | |
parent | 02c35fca7cf4ea2dfdc6db279e230cacbbf4b870 (diff) |
NFSv4.1: pnfs: filelayout: introduce minimal file layout driver
This driver just registers itself and supplies trivial mount/umount functions.
Signed-off-by: Dean Hildebrand <dhildebz@umich.edu>
Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Fred Isaman <iisaman@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/Makefile | 3 | ||||
-rw-r--r-- | fs/nfs/nfs4filelayout.c | 78 | ||||
-rw-r--r-- | include/linux/nfs_fs.h | 1 |
3 files changed, 82 insertions, 0 deletions
diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile index bb9e773d4312..08a8889c5149 100644 --- a/fs/nfs/Makefile +++ b/fs/nfs/Makefile | |||
@@ -18,3 +18,6 @@ nfs-$(CONFIG_NFS_V4) += nfs4proc.o nfs4xdr.o nfs4state.o nfs4renewd.o \ | |||
18 | nfs-$(CONFIG_NFS_V4_1) += pnfs.o | 18 | nfs-$(CONFIG_NFS_V4_1) += pnfs.o |
19 | nfs-$(CONFIG_SYSCTL) += sysctl.o | 19 | nfs-$(CONFIG_SYSCTL) += sysctl.o |
20 | nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o | 20 | nfs-$(CONFIG_NFS_FSCACHE) += fscache.o fscache-index.o |
21 | |||
22 | obj-$(CONFIG_PNFS_FILE_LAYOUT) += nfs_layout_nfsv41_files.o | ||
23 | nfs_layout_nfsv41_files-y := nfs4filelayout.o | ||
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c new file mode 100644 index 000000000000..696e283c2632 --- /dev/null +++ b/fs/nfs/nfs4filelayout.c | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * Module for the pnfs nfs4 file layout driver. | ||
3 | * Defines all I/O and Policy interface operations, plus code | ||
4 | * to register itself with the pNFS client. | ||
5 | * | ||
6 | * Copyright (c) 2002 | ||
7 | * The Regents of the University of Michigan | ||
8 | * All Rights Reserved | ||
9 | * | ||
10 | * Dean Hildebrand <dhildebz@umich.edu> | ||
11 | * | ||
12 | * Permission is granted to use, copy, create derivative works, and | ||
13 | * redistribute this software and such derivative works for any purpose, | ||
14 | * so long as the name of the University of Michigan is not used in | ||
15 | * any advertising or publicity pertaining to the use or distribution | ||
16 | * of this software without specific, written prior authorization. If | ||
17 | * the above copyright notice or any other identification of the | ||
18 | * University of Michigan is included in any copy of any portion of | ||
19 | * this software, then the disclaimer below must also be included. | ||
20 | * | ||
21 | * This software is provided as is, without representation or warranty | ||
22 | * of any kind either express or implied, including without limitation | ||
23 | * the implied warranties of merchantability, fitness for a particular | ||
24 | * purpose, or noninfringement. The Regents of the University of | ||
25 | * Michigan shall not be liable for any damages, including special, | ||
26 | * indirect, incidental, or consequential damages, with respect to any | ||
27 | * claim arising out of or in connection with the use of the software, | ||
28 | * even if it has been or is hereafter advised of the possibility of | ||
29 | * such damages. | ||
30 | */ | ||
31 | |||
32 | #include <linux/nfs_fs.h> | ||
33 | #include "pnfs.h" | ||
34 | |||
35 | #define NFSDBG_FACILITY NFSDBG_PNFS_LD | ||
36 | |||
37 | MODULE_LICENSE("GPL"); | ||
38 | MODULE_AUTHOR("Dean Hildebrand <dhildebz@umich.edu>"); | ||
39 | MODULE_DESCRIPTION("The NFSv4 file layout driver"); | ||
40 | |||
41 | int | ||
42 | filelayout_initialize_mountpoint(struct nfs_server *nfss) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | int | ||
48 | filelayout_uninitialize_mountpoint(struct nfs_server *nfss) | ||
49 | { | ||
50 | dprintk("--> %s\n", __func__); | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | static struct pnfs_layoutdriver_type filelayout_type = { | ||
56 | .id = LAYOUT_NFSV4_1_FILES, | ||
57 | .name = "LAYOUT_NFSV4_1_FILES", | ||
58 | .owner = THIS_MODULE, | ||
59 | .initialize_mountpoint = filelayout_initialize_mountpoint, | ||
60 | .uninitialize_mountpoint = filelayout_uninitialize_mountpoint, | ||
61 | }; | ||
62 | |||
63 | static int __init nfs4filelayout_init(void) | ||
64 | { | ||
65 | printk(KERN_INFO "%s: NFSv4 File Layout Driver Registering...\n", | ||
66 | __func__); | ||
67 | return pnfs_register_layoutdriver(&filelayout_type); | ||
68 | } | ||
69 | |||
70 | static void __exit nfs4filelayout_exit(void) | ||
71 | { | ||
72 | printk(KERN_INFO "%s: NFSv4 File Layout Driver Unregistering...\n", | ||
73 | __func__); | ||
74 | pnfs_unregister_layoutdriver(&filelayout_type); | ||
75 | } | ||
76 | |||
77 | module_init(nfs4filelayout_init); | ||
78 | module_exit(nfs4filelayout_exit); | ||
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index aba3da2a6227..499872fa895c 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -616,6 +616,7 @@ nfs_fileid_to_ino_t(u64 fileid) | |||
616 | #define NFSDBG_MOUNT 0x0400 | 616 | #define NFSDBG_MOUNT 0x0400 |
617 | #define NFSDBG_FSCACHE 0x0800 | 617 | #define NFSDBG_FSCACHE 0x0800 |
618 | #define NFSDBG_PNFS 0x1000 | 618 | #define NFSDBG_PNFS 0x1000 |
619 | #define NFSDBG_PNFS_LD 0x2000 | ||
619 | #define NFSDBG_ALL 0xFFFF | 620 | #define NFSDBG_ALL 0xFFFF |
620 | 621 | ||
621 | #ifdef __KERNEL__ | 622 | #ifdef __KERNEL__ |