From 8459c304c220d126dec7c903bb279497d684bcdf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 19 Sep 2024 08:13:21 +0200 Subject: [PATCH] xfs: remove CONFIG_XFS_QUOTA CONFIG_XFS_QUOTA guards support for quota accounting in XFS, and thus requires a lot of stubs and ifdefs to support builds without it. Unconditionally enable quota support to simplify maintenance. This increases the size of xfs.ko by about 1MB compared to builds without quota support. Signed-off-by: Christoph Hellwig --- arch/loongarch/configs/loongson3_defconfig | 1 - arch/mips/configs/ip22_defconfig | 1 - arch/mips/configs/ip27_defconfig | 1 - arch/mips/configs/ip30_defconfig | 1 - arch/mips/configs/jazz_defconfig | 1 - arch/mips/configs/lemote2f_defconfig | 1 - arch/mips/configs/loongson2k_defconfig | 1 - arch/mips/configs/malta_defconfig | 1 - arch/mips/configs/malta_kvm_defconfig | 1 - arch/mips/configs/malta_qemu_32r6_defconfig | 1 - arch/mips/configs/maltaaprp_defconfig | 1 - arch/mips/configs/maltasmvp_defconfig | 1 - arch/mips/configs/maltasmvp_eva_defconfig | 1 - arch/mips/configs/maltaup_defconfig | 1 - arch/mips/configs/maltaup_xpa_defconfig | 1 - arch/mips/configs/rm200_defconfig | 1 - arch/powerpc/configs/ppc6xx_defconfig | 1 - arch/s390/configs/debug_defconfig | 1 - arch/s390/configs/defconfig | 1 - fs/xfs/Kconfig | 19 +----- fs/xfs/Makefile | 33 ++++------ fs/xfs/libxfs/xfs_exchmaps.c | 4 -- fs/xfs/scrub/common.c | 4 -- fs/xfs/scrub/common.h | 12 ---- fs/xfs/scrub/repair.c | 2 - fs/xfs/scrub/repair.h | 11 ---- fs/xfs/scrub/scrub.h | 5 -- fs/xfs/scrub/trace.h | 4 -- fs/xfs/xfs_buf_item.h | 9 --- fs/xfs/xfs_buf_item_recover.c | 6 -- fs/xfs/xfs_mount.h | 4 -- fs/xfs/xfs_quota.h | 70 ++------------------- fs/xfs/xfs_stats.c | 4 -- fs/xfs/xfs_super.c | 7 --- fs/xfs/xfs_super.h | 8 +-- 35 files changed, 19 insertions(+), 202 deletions(-) diff --git a/arch/loongarch/configs/loongson3_defconfig b/arch/loongarch/configs/loongson3_defconfig index d1c16196f942..68c4e8b19381 100644 --- a/arch/loongarch/configs/loongson3_defconfig +++ b/arch/loongarch/configs/loongson3_defconfig @@ -842,7 +842,6 @@ CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=y CONFIG_OCFS2_FS=m diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig index e22e8b825903..56323d04849f 100644 --- a/arch/mips/configs/ip22_defconfig +++ b/arch/mips/configs/ip22_defconfig @@ -238,7 +238,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QUOTA_NETLINK_INTERFACE=y # CONFIG_PRINT_QUOTA_WARNING is not set diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index 922bd6c05a7b..753100f0651d 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig @@ -280,7 +280,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_QUOTA_NETLINK_INTERFACE=y diff --git a/arch/mips/configs/ip30_defconfig b/arch/mips/configs/ip30_defconfig index 2e4315ff580a..88bb2cd9c586 100644 --- a/arch/mips/configs/ip30_defconfig +++ b/arch/mips/configs/ip30_defconfig @@ -147,7 +147,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_BTRFS_FS=m CONFIG_BTRFS_FS_POSIX_ACL=y CONFIG_QUOTA_NETLINK_INTERFACE=y diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig index 65adb538030d..231cf31a51cf 100644 --- a/arch/mips/configs/jazz_defconfig +++ b/arch/mips/configs/jazz_defconfig @@ -71,7 +71,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_EXT2_FS=m CONFIG_EXT3_FS=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=m CONFIG_ISO9660_FS=m diff --git a/arch/mips/configs/lemote2f_defconfig b/arch/mips/configs/lemote2f_defconfig index 93c887461822..37f1273ff8bb 100644 --- a/arch/mips/configs/lemote2f_defconfig +++ b/arch/mips/configs/lemote2f_defconfig @@ -232,7 +232,6 @@ CONFIG_EXT3_FS_SECURITY=y CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_BTRFS_FS=m CONFIG_QUOTA=y CONFIG_QFMT_V2=m diff --git a/arch/mips/configs/loongson2k_defconfig b/arch/mips/configs/loongson2k_defconfig index 415aa7c31ba4..788bb3337a9a 100644 --- a/arch/mips/configs/loongson2k_defconfig +++ b/arch/mips/configs/loongson2k_defconfig @@ -292,7 +292,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y # CONFIG_PRINT_QUOTA_WARNING is not set CONFIG_AUTOFS_FS=y diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index 54afa3c4dd20..70932798e115 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig @@ -320,7 +320,6 @@ CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_FUSE_FS=m diff --git a/arch/mips/configs/malta_kvm_defconfig b/arch/mips/configs/malta_kvm_defconfig index 78e64a3da9ec..6894dd7c8936 100644 --- a/arch/mips/configs/malta_kvm_defconfig +++ b/arch/mips/configs/malta_kvm_defconfig @@ -326,7 +326,6 @@ CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_FUSE_FS=m diff --git a/arch/mips/configs/malta_qemu_32r6_defconfig b/arch/mips/configs/malta_qemu_32r6_defconfig index 7078b006cdef..d4c354ba3dc9 100644 --- a/arch/mips/configs/malta_qemu_32r6_defconfig +++ b/arch/mips/configs/malta_qemu_32r6_defconfig @@ -151,7 +151,6 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_MSDOS_FS=m diff --git a/arch/mips/configs/maltaaprp_defconfig b/arch/mips/configs/maltaaprp_defconfig index 9d84f273f7f4..430bc1db1e50 100644 --- a/arch/mips/configs/maltaaprp_defconfig +++ b/arch/mips/configs/maltaaprp_defconfig @@ -152,7 +152,6 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_MSDOS_FS=m diff --git a/arch/mips/configs/maltasmvp_defconfig b/arch/mips/configs/maltasmvp_defconfig index d70c4daf1250..5e978138a779 100644 --- a/arch/mips/configs/maltasmvp_defconfig +++ b/arch/mips/configs/maltasmvp_defconfig @@ -153,7 +153,6 @@ CONFIG_EXT3_FS=y CONFIG_EXT3_FS_POSIX_ACL=y CONFIG_EXT3_FS_SECURITY=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_MSDOS_FS=m diff --git a/arch/mips/configs/maltasmvp_eva_defconfig b/arch/mips/configs/maltasmvp_eva_defconfig index cedc54da86e0..a8feb6b9990f 100644 --- a/arch/mips/configs/maltasmvp_eva_defconfig +++ b/arch/mips/configs/maltasmvp_eva_defconfig @@ -155,7 +155,6 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_MSDOS_FS=m diff --git a/arch/mips/configs/maltaup_defconfig b/arch/mips/configs/maltaup_defconfig index fd27cbebb486..48476f06688d 100644 --- a/arch/mips/configs/maltaup_defconfig +++ b/arch/mips/configs/maltaup_defconfig @@ -151,7 +151,6 @@ CONFIG_RTC_DRV_CMOS=y CONFIG_EXT2_FS=y CONFIG_EXT3_FS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_MSDOS_FS=m diff --git a/arch/mips/configs/maltaup_xpa_defconfig b/arch/mips/configs/maltaup_xpa_defconfig index b80afc696e0e..396b4aa12105 100644 --- a/arch/mips/configs/maltaup_xpa_defconfig +++ b/arch/mips/configs/maltaup_xpa_defconfig @@ -326,7 +326,6 @@ CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_QUOTA=y CONFIG_QFMT_V2=y CONFIG_FUSE_FS=m diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig index 08e1c1f2f4de..5b6c8864f9a1 100644 --- a/arch/mips/configs/rm200_defconfig +++ b/arch/mips/configs/rm200_defconfig @@ -311,7 +311,6 @@ CONFIG_USB_TEST=m CONFIG_EXT2_FS=m CONFIG_EXT3_FS=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_AUTOFS_FS=m CONFIG_FUSE_FS=m CONFIG_ISO9660_FS=m diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index 7a9948c588de..6d23126e0a5e 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -956,7 +956,6 @@ CONFIG_JFS_FS=m CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_XFS_FS=m -CONFIG_XFS_QUOTA=y CONFIG_GFS2_FS=m CONFIG_FS_DAX=y CONFIG_QUOTA_NETLINK_INTERFACE=y diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig index 50b6417eb12e..df5c3153e024 100644 --- a/arch/s390/configs/debug_defconfig +++ b/arch/s390/configs/debug_defconfig @@ -627,7 +627,6 @@ CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_JFS_STATISTICS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_XFS_DEBUG=y CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=y diff --git a/arch/s390/configs/defconfig b/arch/s390/configs/defconfig index 82d35b8d4b4d..8292e265b7b7 100644 --- a/arch/s390/configs/defconfig +++ b/arch/s390/configs/defconfig @@ -618,7 +618,6 @@ CONFIG_JFS_POSIX_ACL=y CONFIG_JFS_SECURITY=y CONFIG_JFS_STATISTICS=y CONFIG_XFS_FS=y -CONFIG_XFS_QUOTA=y CONFIG_GFS2_FS=m CONFIG_GFS2_FS_LOCKING_DLM=y CONFIG_OCFS2_FS=m diff --git a/fs/xfs/Kconfig b/fs/xfs/Kconfig index 9d1a47e4cfbe..bd1c6421f86e 100644 --- a/fs/xfs/Kconfig +++ b/fs/xfs/Kconfig @@ -6,6 +6,7 @@ config XFS_FS select FS_IOMAP select FS_POSIX_ACL select LIBCRC32C + select QUOTACTL help XFS is a high performance journaling filesystem which originated on the SGI IRIX platform. It is completely multi-threaded, can @@ -75,24 +76,6 @@ config XFS_SUPPORT_ASCII_CI To continue supporting case-insensitivity (ascii-ci=1), say Y. To close off an attack surface, say N. -config XFS_QUOTA - bool "XFS Quota support" - depends on XFS_FS - select QUOTACTL - help - If you say Y here, you will be able to set limits for disk usage on - a per user and/or a per group basis under XFS. XFS considers quota - information as filesystem metadata and uses journaling to provide a - higher level guarantee of consistency. The on-disk data format for - quota is also compatible with the IRIX version of XFS, allowing a - filesystem to be migrated between Linux and IRIX without any need - for conversion. - - If unsure, say N. More comprehensive documentation can be found in - README.quota in the xfsprogs package. XFS quota can be used either - with or without the generic quota support enabled (CONFIG_QUOTA) - - they are completely independent subsystems. - config XFS_DRAIN_INTENTS bool select JUMP_LABEL if HAVE_ARCH_JUMP_LABEL diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index aaf78bbbf692..b7c6b7f9ce0e 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -68,6 +68,7 @@ xfs-y += xfs_acl.o \ xfs_dahash_test.o \ xfs_dir2_readdir.o \ xfs_discard.o \ + xfs_dquot.o \ xfs_error.o \ xfs_exchrange.o \ xfs_export.o \ @@ -90,6 +91,10 @@ xfs-y += xfs_acl.o \ xfs_mount.o \ xfs_mru_cache.o \ xfs_pwork.o \ + xfs_qm.o \ + xfs_qm_bhv.o \ + xfs_qm_syscalls.o \ + xfs_quotaops.o \ xfs_reflink.o \ xfs_rtalloc.o \ xfs_stats.o \ @@ -109,6 +114,7 @@ xfs-y += xfs_log.o \ xfs_exchmaps_item.o \ xfs_extfree_item.o \ xfs_attr_item.o \ + xfs_dquot_item.o \ xfs_icreate_item.o \ xfs_inode_item.o \ xfs_inode_item_recover.o \ @@ -117,16 +123,8 @@ xfs-y += xfs_log.o \ xfs_rmap_item.o \ xfs_log_recover.o \ xfs_trans_ail.o \ - xfs_trans_buf.o - -# optional features -xfs-$(CONFIG_XFS_QUOTA) += xfs_dquot.o \ - xfs_dquot_item.o \ - xfs_trans_dquot.o \ - xfs_qm_syscalls.o \ - xfs_qm_bhv.o \ - xfs_qm.o \ - xfs_quotaops.o + xfs_trans_buf.o \ + xfs_trans_dquot.o xfs-$(CONFIG_SYSCTL) += xfs_sysctl.o xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o @@ -160,6 +158,7 @@ xfs-y += $(addprefix scrub/, \ dabtree.o \ dir.o \ dirtree.o \ + dqiterate.o \ fscounters.o \ health.o \ ialloc.o \ @@ -168,6 +167,8 @@ xfs-y += $(addprefix scrub/, \ listxattr.o \ nlinks.o \ parent.o \ + quota.o \ + quotacheck.o \ readdir.o \ refcount.o \ rmap.o \ @@ -182,12 +183,6 @@ xfs-y += $(addprefix scrub/, \ xfs-$(CONFIG_XFS_ONLINE_SCRUB_STATS) += scrub/stats.o -xfs-$(CONFIG_XFS_QUOTA) += $(addprefix scrub/, \ - dqiterate.o \ - quota.o \ - quotacheck.o \ - ) - # online repair ifeq ($(CONFIG_XFS_ONLINE_REPAIR),y) xfs-y += $(addprefix scrub/, \ @@ -206,6 +201,8 @@ xfs-y += $(addprefix scrub/, \ nlinks_repair.o \ orphanage.o \ parent_repair.o \ + quota_repair.o \ + quotacheck_repair.o \ rcbag_btree.o \ rcbag.o \ reap.o \ @@ -218,9 +215,5 @@ xfs-y += $(addprefix scrub/, \ tempfile.o \ ) -xfs-$(CONFIG_XFS_QUOTA) += $(addprefix scrub/, \ - quota_repair.o \ - quotacheck_repair.o \ - ) endif endif diff --git a/fs/xfs/libxfs/xfs_exchmaps.c b/fs/xfs/libxfs/xfs_exchmaps.c index 2021396651de..f1d84838811b 100644 --- a/fs/xfs/libxfs/xfs_exchmaps.c +++ b/fs/xfs/libxfs/xfs_exchmaps.c @@ -155,7 +155,6 @@ xfs_exchmaps_check_forks( return 0; } -#ifdef CONFIG_XFS_QUOTA /* Log the actual updates to the quota accounting. */ static inline void xfs_exchmaps_update_quota( @@ -183,9 +182,6 @@ xfs_exchmaps_update_quota( xfs_trans_mod_dquot_byino(tp, xmi->xmi_ip1, qflag, ip1_delta); xfs_trans_mod_dquot_byino(tp, xmi->xmi_ip2, qflag, ip2_delta); } -#else -# define xfs_exchmaps_update_quota(tp, xmi, irec1, irec2) ((void)0) -#endif /* Decide if we want to skip this mapping from file1. */ static inline bool diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index 22f5f1a9d3f0..b96a0c075edb 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -250,7 +250,6 @@ xchk_block_set_corrupt( trace_xchk_block_error(sc, xfs_buf_daddr(bp), __return_address); } -#ifdef CONFIG_XFS_QUOTA /* Record a corrupt quota counter. */ void xchk_qcheck_set_corrupt( @@ -261,7 +260,6 @@ xchk_qcheck_set_corrupt( sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT; trace_xchk_qcheck_error(sc, dqtype, id, __return_address); } -#endif /* Record a corruption while cross-referencing. */ void @@ -867,7 +865,6 @@ again: return 0; } -#ifdef CONFIG_XFS_QUOTA /* * Try to attach dquots to this inode if we think we might want to repair it. * Callers must not hold any ILOCKs. If the dquots are broken and cannot be @@ -885,7 +882,6 @@ xchk_ino_dqattach( return xrep_ino_dqattach(sc); } -#endif /* Install an inode that we opened by handle for scrubbing. */ int diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h index c676d315eeac..3d4c4852a1ea 100644 --- a/fs/xfs/scrub/common.h +++ b/fs/xfs/scrub/common.h @@ -30,10 +30,8 @@ void xchk_block_set_corrupt(struct xfs_scrub *sc, void xchk_ino_set_corrupt(struct xfs_scrub *sc, xfs_ino_t ino); void xchk_fblock_set_corrupt(struct xfs_scrub *sc, int whichfork, xfs_fileoff_t offset); -#ifdef CONFIG_XFS_QUOTA void xchk_qcheck_set_corrupt(struct xfs_scrub *sc, unsigned int dqtype, xfs_dqid_t id); -#endif void xchk_block_xref_set_corrupt(struct xfs_scrub *sc, struct xfs_buf *bp); @@ -75,19 +73,9 @@ int xchk_setup_parent(struct xfs_scrub *sc); int xchk_setup_dirtree(struct xfs_scrub *sc); int xchk_setup_rtbitmap(struct xfs_scrub *sc); int xchk_setup_rtsummary(struct xfs_scrub *sc); -#ifdef CONFIG_XFS_QUOTA int xchk_ino_dqattach(struct xfs_scrub *sc); int xchk_setup_quota(struct xfs_scrub *sc); int xchk_setup_quotacheck(struct xfs_scrub *sc); -#else -static inline int -xchk_ino_dqattach(struct xfs_scrub *sc) -{ - return 0; -} -# define xchk_setup_quota xchk_setup_nothing -# define xchk_setup_quotacheck xchk_setup_nothing -#endif int xchk_setup_fscounters(struct xfs_scrub *sc); int xchk_setup_nlinks(struct xfs_scrub *sc); diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c index 67478294f11a..23d88e7158b3 100644 --- a/fs/xfs/scrub/repair.c +++ b/fs/xfs/scrub/repair.c @@ -693,7 +693,6 @@ xrep_find_ag_btree_roots( return error; } -#ifdef CONFIG_XFS_QUOTA /* Update some quota flags in the superblock. */ void xrep_update_qflags( @@ -790,7 +789,6 @@ xrep_ino_dqattach( return error; } -#endif /* CONFIG_XFS_QUOTA */ /* * Ensure that the inode being repaired is ready to handle a certain number of diff --git a/fs/xfs/scrub/repair.h b/fs/xfs/scrub/repair.h index f421e04ae315..026984aab4b3 100644 --- a/fs/xfs/scrub/repair.h +++ b/fs/xfs/scrub/repair.h @@ -71,15 +71,10 @@ struct xrep_find_ag_btree { int xrep_find_ag_btree_roots(struct xfs_scrub *sc, struct xfs_buf *agf_bp, struct xrep_find_ag_btree *btree_info, struct xfs_buf *agfl_bp); -#ifdef CONFIG_XFS_QUOTA void xrep_update_qflags(struct xfs_scrub *sc, unsigned int clear_flags, unsigned int set_flags); void xrep_force_quotacheck(struct xfs_scrub *sc, xfs_dqtype_t type); int xrep_ino_dqattach(struct xfs_scrub *sc); -#else -# define xrep_force_quotacheck(sc, type) ((void)0) -# define xrep_ino_dqattach(sc) (0) -#endif /* CONFIG_XFS_QUOTA */ int xrep_setup_xfbtree(struct xfs_scrub *sc, const char *descr); @@ -136,14 +131,8 @@ int xrep_symlink(struct xfs_scrub *sc); int xrep_dirtree(struct xfs_scrub *sc); int xrep_rtbitmap(struct xfs_scrub *sc); int xrep_rtsummary(struct xfs_scrub *sc); - -#ifdef CONFIG_XFS_QUOTA int xrep_quota(struct xfs_scrub *sc); int xrep_quotacheck(struct xfs_scrub *sc); -#else -# define xrep_quota xrep_notsupported -# define xrep_quotacheck xrep_notsupported -#endif /* CONFIG_XFS_QUOTA */ int xrep_reinit_pagf(struct xfs_scrub *sc); int xrep_reinit_pagi(struct xfs_scrub *sc); diff --git a/fs/xfs/scrub/scrub.h b/fs/xfs/scrub/scrub.h index 9eb6ec84fa58..df68d71cc0b0 100644 --- a/fs/xfs/scrub/scrub.h +++ b/fs/xfs/scrub/scrub.h @@ -257,13 +257,8 @@ int xchk_parent(struct xfs_scrub *sc); int xchk_dirtree(struct xfs_scrub *sc); int xchk_rtbitmap(struct xfs_scrub *sc); int xchk_rtsummary(struct xfs_scrub *sc); -#ifdef CONFIG_XFS_QUOTA int xchk_quota(struct xfs_scrub *sc); int xchk_quotacheck(struct xfs_scrub *sc); -#else -# define xchk_quota xchk_nothing -# define xchk_quotacheck xchk_nothing -#endif int xchk_fscounters(struct xfs_scrub *sc); int xchk_nlinks(struct xfs_scrub *sc); diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h index fde249c69d37..0b0a2021029b 100644 --- a/fs/xfs/scrub/trace.h +++ b/fs/xfs/scrub/trace.h @@ -451,7 +451,6 @@ DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_error); DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_warning); DEFINE_SCRUB_FBLOCK_ERROR_EVENT(xchk_fblock_preen); -#ifdef CONFIG_XFS_QUOTA DECLARE_EVENT_CLASS(xchk_dqiter_class, TP_PROTO(struct xchk_dqiter *cursor, uint64_t id), TP_ARGS(cursor, id), @@ -520,7 +519,6 @@ TRACE_EVENT(xchk_qcheck_error, __entry->id, __entry->ret_ip) ); -#endif /* CONFIG_XFS_QUOTA */ TRACE_EVENT(xchk_incomplete, TP_PROTO(struct xfs_scrub *sc, void *ret_ip), @@ -2616,7 +2614,6 @@ TRACE_EVENT(xrep_cow_free_staging, __entry->blockcount) ); -#ifdef CONFIG_XFS_QUOTA DECLARE_EVENT_CLASS(xrep_dquot_class, TP_PROTO(struct xfs_mount *mp, uint8_t type, uint32_t id), TP_ARGS(mp, type, id), @@ -2644,7 +2641,6 @@ DEFINE_XREP_DQUOT_EVENT(xrep_dquot_item); DEFINE_XREP_DQUOT_EVENT(xrep_disk_dquot); DEFINE_XREP_DQUOT_EVENT(xrep_dquot_item_fill_bmap_hole); DEFINE_XREP_DQUOT_EVENT(xrep_quotacheck_dquot); -#endif /* CONFIG_XFS_QUOTA */ DEFINE_SCRUB_NLINKS_DIFF_EVENT(xrep_nlinks_update_inode); DEFINE_SCRUB_NLINKS_DIFF_EVENT(xrep_nlinks_unfixable_inode); diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h index 4d8a6aece995..b73272323557 100644 --- a/fs/xfs/xfs_buf_item.h +++ b/fs/xfs/xfs_buf_item.h @@ -55,17 +55,8 @@ void xfs_buf_item_log(struct xfs_buf_log_item *, uint, uint); bool xfs_buf_item_dirty_format(struct xfs_buf_log_item *); void xfs_buf_inode_iodone(struct xfs_buf *); void xfs_buf_inode_io_fail(struct xfs_buf *bp); -#ifdef CONFIG_XFS_QUOTA void xfs_buf_dquot_iodone(struct xfs_buf *); void xfs_buf_dquot_io_fail(struct xfs_buf *bp); -#else -static inline void xfs_buf_dquot_iodone(struct xfs_buf *bp) -{ -} -static inline void xfs_buf_dquot_io_fail(struct xfs_buf *bp) -{ -} -#endif /* CONFIG_XFS_QUOTA */ void xfs_buf_iodone(struct xfs_buf *); bool xfs_buf_log_check_iovec(struct xfs_log_iovec *iovec); diff --git a/fs/xfs/xfs_buf_item_recover.c b/fs/xfs/xfs_buf_item_recover.c index ef39343a1da4..7cd819c7b2b5 100644 --- a/fs/xfs/xfs_buf_item_recover.c +++ b/fs/xfs/xfs_buf_item_recover.c @@ -292,17 +292,11 @@ xlog_recover_validate_buf_type( case XFS_BLFT_UDQUOT_BUF: case XFS_BLFT_PDQUOT_BUF: case XFS_BLFT_GDQUOT_BUF: -#ifdef CONFIG_XFS_QUOTA if (magic16 != XFS_DQUOT_MAGIC) { warnmsg = "Bad DQUOT block magic!"; break; } bp->b_ops = &xfs_dquot_buf_ops; -#else - xfs_alert(mp, - "Trying to recover dquots without QUOTA support built in!"); - ASSERT(0); -#endif break; case XFS_BLFT_DINO_BUF: if (magic16 != XFS_DINODE_MAGIC) { diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 96496f39f551..e85af4c087ea 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -467,11 +467,7 @@ __XFS_IS_OPSTATE(inode32, INODE32) __XFS_IS_OPSTATE(readonly, READONLY) __XFS_IS_OPSTATE(inodegc_enabled, INODEGC_ENABLED) __XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED) -#ifdef CONFIG_XFS_QUOTA __XFS_IS_OPSTATE(quotacheck_running, QUOTACHECK_RUNNING) -#else -# define xfs_is_quotacheck_running(mp) (false) -#endif __XFS_IS_OPSTATE(done_with_log_incompat, UNSET_LOG_INCOMPAT) __XFS_IS_OPSTATE(using_logged_xattrs, USE_LARP) diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h index 23d71a55bbc0..a1dad4adaed5 100644 --- a/fs/xfs/xfs_quota.h +++ b/fs/xfs/xfs_quota.h @@ -90,7 +90,6 @@ struct xfs_apply_dqtrx_params { xfs_dqid_t q_id; }; -#ifdef CONFIG_XFS_QUOTA extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *); extern void xfs_trans_free_dqinfo(struct xfs_trans *); extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *, @@ -125,7 +124,7 @@ extern void xfs_qm_unmount(struct xfs_mount *); extern void xfs_qm_unmount_quotas(struct xfs_mount *); bool xfs_inode_near_dquot_enforcement(struct xfs_inode *ip, xfs_dqtype_t type); -# ifdef CONFIG_XFS_LIVE_HOOKS +#ifdef CONFIG_XFS_LIVE_HOOKS void xfs_trans_mod_ino_dquot(struct xfs_trans *tp, struct xfs_inode *ip, struct xfs_dquot *dqp, unsigned int field, int64_t delta); @@ -143,71 +142,10 @@ int xfs_dqtrx_hook_add(struct xfs_quotainfo *qi, struct xfs_dqtrx_hook *hook); void xfs_dqtrx_hook_del(struct xfs_quotainfo *qi, struct xfs_dqtrx_hook *hook); void xfs_dqtrx_hook_setup(struct xfs_dqtrx_hook *hook, notifier_fn_t mod_fn, notifier_fn_t apply_fn); -# else -# define xfs_trans_mod_ino_dquot(tp, ip, dqp, field, delta) \ - xfs_trans_mod_dquot((tp), (dqp), (field), (delta)) -# endif /* CONFIG_XFS_LIVE_HOOKS */ - #else -static inline int -xfs_qm_vop_dqalloc(struct xfs_inode *ip, kuid_t kuid, kgid_t kgid, - prid_t prid, uint flags, struct xfs_dquot **udqp, - struct xfs_dquot **gdqp, struct xfs_dquot **pdqp) -{ - *udqp = NULL; - *gdqp = NULL; - *pdqp = NULL; - return 0; -} -#define xfs_trans_dup_dqinfo(tp, tp2) -#define xfs_trans_free_dqinfo(tp) -static inline void xfs_trans_mod_dquot_byino(struct xfs_trans *tp, - struct xfs_inode *ip, uint field, int64_t delta) -{ -} -#define xfs_trans_apply_dquot_deltas(tp) -#define xfs_trans_unreserve_and_mod_dquots(tp) -static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp, - struct xfs_inode *ip, int64_t dblocks, int64_t rblocks, - bool force) -{ - return 0; -} -static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp, - struct xfs_mount *mp, struct xfs_dquot *udqp, - struct xfs_dquot *gdqp, struct xfs_dquot *pdqp, - int64_t nblks, long nions, uint flags) -{ - return 0; -} - -static inline int -xfs_trans_reserve_quota_icreate(struct xfs_trans *tp, struct xfs_dquot *udqp, - struct xfs_dquot *gdqp, struct xfs_dquot *pdqp, int64_t dblocks) -{ - return 0; -} - -#define xfs_qm_vop_create_dqattach(tp, ip, u, g, p) -#define xfs_qm_vop_rename_dqattach(it) (0) -#define xfs_qm_vop_chown(tp, ip, old, new) (NULL) -#define xfs_qm_dqattach(ip) (0) -#define xfs_qm_dqattach_locked(ip, fl) (0) -#define xfs_qm_dqdetach(ip) -#define xfs_qm_dqrele(d) do { (d) = (d); } while(0) -#define xfs_qm_statvfs(ip, s) do { } while(0) -#define xfs_qm_newmount(mp, a, b) (0) -#define xfs_qm_mount_quotas(mp) -#define xfs_qm_unmount(mp) -#define xfs_qm_unmount_quotas(mp) -#define xfs_inode_near_dquot_enforcement(ip, type) (false) - -# ifdef CONFIG_XFS_LIVE_HOOKS -# define xfs_dqtrx_hook_enable() ((void)0) -# define xfs_dqtrx_hook_disable() ((void)0) -# endif /* CONFIG_XFS_LIVE_HOOKS */ - -#endif /* CONFIG_XFS_QUOTA */ +# define xfs_trans_mod_ino_dquot(tp, ip, dqp, field, delta) \ + xfs_trans_mod_dquot((tp), (dqp), (field), (delta)) +#endif /* CONFIG_XFS_LIVE_HOOKS */ static inline int xfs_quota_reserve_blkres(struct xfs_inode *ip, int64_t blocks) diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c index ed97d72caa66..933196245d84 100644 --- a/fs/xfs/xfs_stats.c +++ b/fs/xfs/xfs_stats.c @@ -108,7 +108,6 @@ void xfs_stats_clearall(struct xfsstats __percpu *stats) #ifdef CONFIG_PROC_FS /* legacy quota interfaces */ -#ifdef CONFIG_XFS_QUOTA #define XFSSTAT_START_XQMSTAT xfsstats_offset(xs_qm_dqreclaims) #define XFSSTAT_END_XQMSTAT xfsstats_offset(xs_qm_dquot) @@ -133,7 +132,6 @@ static int xqmstat_proc_show(struct seq_file *m, void *v) seq_putc(m, '\n'); return 0; } -#endif /* CONFIG_XFS_QUOTA */ int xfs_init_procfs(void) @@ -145,12 +143,10 @@ xfs_init_procfs(void) "/sys/fs/xfs/stats/stats")) goto out; -#ifdef CONFIG_XFS_QUOTA if (!proc_create_single("fs/xfs/xqmstat", 0, NULL, xqmstat_proc_show)) goto out; if (!proc_create_single("fs/xfs/xqm", 0, NULL, xqm_proc_show)) goto out; -#endif return 0; out: diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 7d22ce015ee1..2c201ca944ca 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1430,11 +1430,6 @@ xfs_fs_validate_params( return -EINVAL; } - if (!IS_ENABLED(CONFIG_XFS_QUOTA) && mp->m_qflags != 0) { - xfs_warn(mp, "quota support not available in this kernel."); - return -EINVAL; - } - if ((mp->m_dalign && !mp->m_swidth) || (!mp->m_dalign && mp->m_swidth)) { xfs_warn(mp, "sunit and swidth must be specified together"); @@ -1524,10 +1519,8 @@ xfs_fs_fill_super( sb_min_blocksize(sb, BBSIZE); sb->s_xattr = xfs_xattr_handlers; sb->s_export_op = &xfs_export_operations; -#ifdef CONFIG_XFS_QUOTA sb->s_qcop = &xfs_quotactl_operations; sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP | QTYPE_MASK_PRJ; -#endif sb->s_op = &xfs_super_operations; /* diff --git a/fs/xfs/xfs_super.h b/fs/xfs/xfs_super.h index 1801be69ed9b..8323af925f77 100644 --- a/fs/xfs/xfs_super.h +++ b/fs/xfs/xfs_super.h @@ -8,15 +8,9 @@ #include -#ifdef CONFIG_XFS_QUOTA extern int xfs_qm_init(void); extern void xfs_qm_exit(void); -# define XFS_QUOTA_STRING "quota, " -#else -# define xfs_qm_init() (0) -# define xfs_qm_exit() do { } while (0) -# define XFS_QUOTA_STRING -#endif +#define XFS_QUOTA_STRING "quota, " #define XFS_ACL_STRING "ACLs, " -- 2.50.1