diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2016-07-08 09:53:20 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-07-15 15:31:29 -0400 |
commit | 15d66ac20927e00ac0e65af6707eff60b92e61b8 (patch) | |
tree | ae81c4129572c2b431b425fe2380970506fa9bbb | |
parent | f4a4906e563522aa2eab61cf080460d13b85725c (diff) |
xfs: abstract block export operations from nfsd layouts
Instead of creeping pnfs layout configuration into filesystems, move the
definition of block-based export operations under a more abstract
configuration.
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/Kconfig | 6 | ||||
-rw-r--r-- | fs/nfsd/Kconfig | 2 | ||||
-rw-r--r-- | fs/xfs/Makefile | 3 | ||||
-rw-r--r-- | fs/xfs/xfs_export.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_pnfs.h | 4 |
5 files changed, 12 insertions, 5 deletions
diff --git a/fs/Kconfig b/fs/Kconfig index b8fcb416be72..4d2f9210e748 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -67,6 +67,12 @@ config FS_POSIX_ACL | |||
67 | config EXPORTFS | 67 | config EXPORTFS |
68 | tristate | 68 | tristate |
69 | 69 | ||
70 | config EXPORTFS_BLOCK_OPS | ||
71 | bool "Enable filesystem export operations for block IO" | ||
72 | help | ||
73 | This option enables the export operations for a filesystem to support | ||
74 | external block IO. | ||
75 | |||
70 | config FILE_LOCKING | 76 | config FILE_LOCKING |
71 | bool "Enable POSIX file locking API" if EXPERT | 77 | bool "Enable POSIX file locking API" if EXPERT |
72 | default y | 78 | default y |
diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig index e64d1a3ec770..47febcf99185 100644 --- a/fs/nfsd/Kconfig +++ b/fs/nfsd/Kconfig | |||
@@ -90,6 +90,7 @@ config NFSD_BLOCKLAYOUT | |||
90 | bool "NFSv4.1 server support for pNFS block layouts" | 90 | bool "NFSv4.1 server support for pNFS block layouts" |
91 | depends on NFSD_V4 && BLOCK | 91 | depends on NFSD_V4 && BLOCK |
92 | select NFSD_PNFS | 92 | select NFSD_PNFS |
93 | select EXPORTFS_BLOCK_OPS | ||
93 | help | 94 | help |
94 | This option enables support for the exporting pNFS block layouts | 95 | This option enables support for the exporting pNFS block layouts |
95 | in the kernel's NFS server. The pNFS block layout enables NFS | 96 | in the kernel's NFS server. The pNFS block layout enables NFS |
@@ -102,6 +103,7 @@ config NFSD_SCSILAYOUT | |||
102 | bool "NFSv4.1 server support for pNFS SCSI layouts" | 103 | bool "NFSv4.1 server support for pNFS SCSI layouts" |
103 | depends on NFSD_V4 && BLOCK | 104 | depends on NFSD_V4 && BLOCK |
104 | select NFSD_PNFS | 105 | select NFSD_PNFS |
106 | select EXPORTFS_BLOCK_OPS | ||
105 | help | 107 | help |
106 | This option enables support for the exporting pNFS SCSI layouts | 108 | This option enables support for the exporting pNFS SCSI layouts |
107 | in the kernel's NFS server. The pNFS SCSI layout enables NFS | 109 | in the kernel's NFS server. The pNFS SCSI layout enables NFS |
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index 3542d94fddce..52c288514be1 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile | |||
@@ -121,5 +121,4 @@ xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o | |||
121 | xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o | 121 | xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o |
122 | xfs-$(CONFIG_SYSCTL) += xfs_sysctl.o | 122 | xfs-$(CONFIG_SYSCTL) += xfs_sysctl.o |
123 | xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o | 123 | xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o |
124 | xfs-$(CONFIG_NFSD_BLOCKLAYOUT) += xfs_pnfs.o | 124 | xfs-$(CONFIG_EXPORTFS_BLOCK_OPS) += xfs_pnfs.o |
125 | xfs-$(CONFIG_NFSD_SCSILAYOUT) += xfs_pnfs.o | ||
diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c index a1b2dd828b9d..fe1bfee35898 100644 --- a/fs/xfs/xfs_export.c +++ b/fs/xfs/xfs_export.c | |||
@@ -246,7 +246,7 @@ const struct export_operations xfs_export_operations = { | |||
246 | .fh_to_parent = xfs_fs_fh_to_parent, | 246 | .fh_to_parent = xfs_fs_fh_to_parent, |
247 | .get_parent = xfs_fs_get_parent, | 247 | .get_parent = xfs_fs_get_parent, |
248 | .commit_metadata = xfs_fs_nfs_commit_metadata, | 248 | .commit_metadata = xfs_fs_nfs_commit_metadata, |
249 | #ifdef CONFIG_NFSD_BLOCKLAYOUT | 249 | #ifdef CONFIG_EXPORTFS_BLOCK_OPS |
250 | .get_uuid = xfs_fs_get_uuid, | 250 | .get_uuid = xfs_fs_get_uuid, |
251 | .map_blocks = xfs_fs_map_blocks, | 251 | .map_blocks = xfs_fs_map_blocks, |
252 | .commit_blocks = xfs_fs_commit_blocks, | 252 | .commit_blocks = xfs_fs_commit_blocks, |
diff --git a/fs/xfs/xfs_pnfs.h b/fs/xfs/xfs_pnfs.h index 93f74853961b..e8339f74966b 100644 --- a/fs/xfs/xfs_pnfs.h +++ b/fs/xfs/xfs_pnfs.h | |||
@@ -1,7 +1,7 @@ | |||
1 | #ifndef _XFS_PNFS_H | 1 | #ifndef _XFS_PNFS_H |
2 | #define _XFS_PNFS_H 1 | 2 | #define _XFS_PNFS_H 1 |
3 | 3 | ||
4 | #if defined(CONFIG_NFSD_BLOCKLAYOUT) || defined(CONFIG_NFSD_SCSILAYOUT) | 4 | #ifdef CONFIG_EXPORTFS_BLOCK_OPS |
5 | int xfs_fs_get_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset); | 5 | int xfs_fs_get_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset); |
6 | int xfs_fs_map_blocks(struct inode *inode, loff_t offset, u64 length, | 6 | int xfs_fs_map_blocks(struct inode *inode, loff_t offset, u64 length, |
7 | struct iomap *iomap, bool write, u32 *device_generation); | 7 | struct iomap *iomap, bool write, u32 *device_generation); |
@@ -15,5 +15,5 @@ xfs_break_layouts(struct inode *inode, uint *iolock, bool with_imutex) | |||
15 | { | 15 | { |
16 | return 0; | 16 | return 0; |
17 | } | 17 | } |
18 | #endif /* CONFIG_NFSD_PNFS */ | 18 | #endif /* CONFIG_EXPORTFS_BLOCK_OPS */ |
19 | #endif /* _XFS_PNFS_H */ | 19 | #endif /* _XFS_PNFS_H */ |