From: Darrick J. Wong <djwong@xxxxxxxxxx> Create a new xfs_fs_staging.h header where we can land experimental ioctls without committing them to any stable interfaces anywhere. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- fs/xfs/Kconfig | 11 +++++++++++ fs/xfs/libxfs/xfs_fs_staging.h | 18 ++++++++++++++++++ fs/xfs/xfs_linux.h | 1 + fs/xfs/xfs_super.c | 3 +++ 4 files changed, 33 insertions(+) create mode 100644 fs/xfs/libxfs/xfs_fs_staging.h diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index d41edd30388b7..5f94f69dc844c 100644 --- a/fs/xfs/Kconfig +++ b/fs/xfs/Kconfig @@ -191,6 +191,17 @@ config XFS_ONLINE_REPAIR If unsure, say N. +config XFS_EXPERIMENTAL_IOCTLS + bool "XFS experimental system calls" + default y if XFS_DEBUG + depends on XFS_FS + help + If you say Y here, the kernel will be built with support for new + system calls that are not yet ready to become part of the stable + kernel ABI. This enables testing for early adopters. + + If unsure, say N. + config XFS_WARN bool "XFS Verbose Warnings" depends on XFS_FS && !XFS_DEBUG diff --git a/fs/xfs/libxfs/xfs_fs_staging.h b/fs/xfs/libxfs/xfs_fs_staging.h new file mode 100644 index 0000000000000..d220790d5b593 --- /dev/null +++ b/fs/xfs/libxfs/xfs_fs_staging.h @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: LGPL-2.1 */ +/* + * Copyright (c) 2020-2024 Oracle. All Rights Reserved. + * Author: Darrick J. Wong <djwong@xxxxxxxxxx> + */ +#ifndef __XFS_FS_STAGING_H__ +#define __XFS_FS_STAGING_H__ + +/* + * Experimental system calls, ioctls and data structures supporting them. + * Nothing in here should be considered part of a stable interface of any kind. + * + * If you add an ioctl here, please leave a comment in xfs_fs.h marking it + * reserved. If you promote anything out of this file, please leave a comment + * explaining where it went. + */ + +#endif /* __XFS_FS_STAGING_H__ */ diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index 439f10b4a77a5..13511ff810d18 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -73,6 +73,7 @@ typedef __u32 xfs_nlink_t; #include <asm/unaligned.h> #include "xfs_fs.h" +#include "xfs_fs_staging.h" #include "xfs_stats.h" #include "xfs_sysctl.h" #include "xfs_iops.h" diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 66930ef4ad8cd..15b59c37e0ed1 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -2356,6 +2356,9 @@ init_xfs_fs(void) printk(KERN_INFO XFS_VERSION_STRING " with " XFS_BUILD_OPTIONS " enabled\n"); +#ifdef CONFIG_XFS_EXPERIMENTAL_IOCTLS + xfs_info(NULL, "EXPERIMENTAL ioctls in use. Use at your own risk!"); +#endif xfs_dir_startup(); error = xfs_init_caches();