Browse Source

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>
Benjamin Coddington 9 years ago
parent
commit
15d66ac209
5 changed files with 12 additions and 5 deletions
  1. 6 0
      fs/Kconfig
  2. 2 0
      fs/nfsd/Kconfig
  3. 1 2
      fs/xfs/Makefile
  4. 1 1
      fs/xfs/xfs_export.c
  5. 2 2
      fs/xfs/xfs_pnfs.h

+ 6 - 0
fs/Kconfig

@@ -67,6 +67,12 @@ config FS_POSIX_ACL
 config EXPORTFS
 config EXPORTFS
 	tristate
 	tristate
 
 
+config EXPORTFS_BLOCK_OPS
+	bool "Enable filesystem export operations for block IO"
+	help
+	  This option enables the export operations for a filesystem to support
+	  external block IO.
+
 config FILE_LOCKING
 config FILE_LOCKING
 	bool "Enable POSIX file locking API" if EXPERT
 	bool "Enable POSIX file locking API" if EXPERT
 	default y
 	default y

+ 2 - 0
fs/nfsd/Kconfig

@@ -90,6 +90,7 @@ config NFSD_BLOCKLAYOUT
 	bool "NFSv4.1 server support for pNFS block layouts"
 	bool "NFSv4.1 server support for pNFS block layouts"
 	depends on NFSD_V4 && BLOCK
 	depends on NFSD_V4 && BLOCK
 	select NFSD_PNFS
 	select NFSD_PNFS
+	select EXPORTFS_BLOCK_OPS
 	help
 	help
 	  This option enables support for the exporting pNFS block layouts
 	  This option enables support for the exporting pNFS block layouts
 	  in the kernel's NFS server. The pNFS block layout enables NFS
 	  in the kernel's NFS server. The pNFS block layout enables NFS
@@ -102,6 +103,7 @@ config NFSD_SCSILAYOUT
 	bool "NFSv4.1 server support for pNFS SCSI layouts"
 	bool "NFSv4.1 server support for pNFS SCSI layouts"
 	depends on NFSD_V4 && BLOCK
 	depends on NFSD_V4 && BLOCK
 	select NFSD_PNFS
 	select NFSD_PNFS
+	select EXPORTFS_BLOCK_OPS
 	help
 	help
 	  This option enables support for the exporting pNFS SCSI layouts
 	  This option enables support for the exporting pNFS SCSI layouts
 	  in the kernel's NFS server. The pNFS SCSI layout enables NFS
 	  in the kernel's NFS server. The pNFS SCSI layout enables NFS

+ 1 - 2
fs/xfs/Makefile

@@ -121,5 +121,4 @@ xfs-$(CONFIG_XFS_RT)		+= xfs_rtalloc.o
 xfs-$(CONFIG_XFS_POSIX_ACL)	+= xfs_acl.o
 xfs-$(CONFIG_XFS_POSIX_ACL)	+= xfs_acl.o
 xfs-$(CONFIG_SYSCTL)		+= xfs_sysctl.o
 xfs-$(CONFIG_SYSCTL)		+= xfs_sysctl.o
 xfs-$(CONFIG_COMPAT)		+= xfs_ioctl32.o
 xfs-$(CONFIG_COMPAT)		+= xfs_ioctl32.o
-xfs-$(CONFIG_NFSD_BLOCKLAYOUT)	+= xfs_pnfs.o
-xfs-$(CONFIG_NFSD_SCSILAYOUT)	+= xfs_pnfs.o
+xfs-$(CONFIG_EXPORTFS_BLOCK_OPS)	+= xfs_pnfs.o

+ 1 - 1
fs/xfs/xfs_export.c

@@ -246,7 +246,7 @@ const struct export_operations xfs_export_operations = {
 	.fh_to_parent		= xfs_fs_fh_to_parent,
 	.fh_to_parent		= xfs_fs_fh_to_parent,
 	.get_parent		= xfs_fs_get_parent,
 	.get_parent		= xfs_fs_get_parent,
 	.commit_metadata	= xfs_fs_nfs_commit_metadata,
 	.commit_metadata	= xfs_fs_nfs_commit_metadata,
-#ifdef CONFIG_NFSD_BLOCKLAYOUT
+#ifdef CONFIG_EXPORTFS_BLOCK_OPS
 	.get_uuid		= xfs_fs_get_uuid,
 	.get_uuid		= xfs_fs_get_uuid,
 	.map_blocks		= xfs_fs_map_blocks,
 	.map_blocks		= xfs_fs_map_blocks,
 	.commit_blocks		= xfs_fs_commit_blocks,
 	.commit_blocks		= xfs_fs_commit_blocks,

+ 2 - 2
fs/xfs/xfs_pnfs.h

@@ -1,7 +1,7 @@
 #ifndef _XFS_PNFS_H
 #ifndef _XFS_PNFS_H
 #define _XFS_PNFS_H 1
 #define _XFS_PNFS_H 1
 
 
-#if defined(CONFIG_NFSD_BLOCKLAYOUT) || defined(CONFIG_NFSD_SCSILAYOUT)
+#ifdef CONFIG_EXPORTFS_BLOCK_OPS
 int xfs_fs_get_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
 int xfs_fs_get_uuid(struct super_block *sb, u8 *buf, u32 *len, u64 *offset);
 int xfs_fs_map_blocks(struct inode *inode, loff_t offset, u64 length,
 int xfs_fs_map_blocks(struct inode *inode, loff_t offset, u64 length,
 		struct iomap *iomap, bool write, u32 *device_generation);
 		struct iomap *iomap, bool write, u32 *device_generation);
@@ -15,5 +15,5 @@ xfs_break_layouts(struct inode *inode, uint *iolock, bool with_imutex)
 {
 {
 	return 0;
 	return 0;
 }
 }
-#endif /* CONFIG_NFSD_PNFS */
+#endif /* CONFIG_EXPORTFS_BLOCK_OPS */
 #endif /* _XFS_PNFS_H */
 #endif /* _XFS_PNFS_H */