From patchwork Mon Aug 2 21:50:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414825 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE262C4338F for ; Mon, 2 Aug 2021 21:50:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F29260F9C for ; Mon, 2 Aug 2021 21:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231950AbhHBVuk (ORCPT ); Mon, 2 Aug 2021 17:50:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:41193 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBVuk (ORCPT ); Mon, 2 Aug 2021 17:50:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941029; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IRanT4Z3WzLcBCgfoZ3uLI1oBFpL9RD6lC7I2HAteo4=; b=eisUS8guieLEFW0xUuc5KQLSdxLyxtSj+W2pB0Y8WpWAlLq6Lp39XMWBSwbePEYBWml2Sk wGPrVPcUkFJb0tmmgj88VrFwsPiVyXxl0o+96Jn0xf1JZ6smtZ0teq+OndB7EICrbX2DDf rB81zCVbhneqB+t8R3FOZ6eGLpJnNmc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-567-g8fIBNstOOiSRCijVOZdRg-1; Mon, 02 Aug 2021 17:50:28 -0400 X-MC-Unique: g8fIBNstOOiSRCijVOZdRg-1 Received: by mail-wr1-f72.google.com with SMTP id f6-20020adfe9060000b0290153abe88c2dso6908369wrm.20 for ; Mon, 02 Aug 2021 14:50:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IRanT4Z3WzLcBCgfoZ3uLI1oBFpL9RD6lC7I2HAteo4=; b=ll0JaFoyGrHNuJ8v5jnQxfvHRKyXe7g37w6omG4Q6OS+1D1iE8bqfFUBAEAw009sZX NLYWouJfm8kaKVVKrQLFA2FJOLRPILJgcCDAuqhgAkx3TI7KyZvlzSFVu5RP1l5GIi4+ G1+Gpq+W/A9hGCVv86rB1tMgJv5BJLHYD8v8lPni+xKl7dD9mCQshF92rOKhCTiqgtsf z81FHbCi0wBQ7G+hu8vRz6x5PD9CEU3MDI2yVnGdPr66W/OQE1R+jibi9lZd6afvlcfz sBmfRsUOSTl54eeyflnzayILtuKyTAgcFKnQ9AjlpBHVVetFWXm5h5xb2bo2E95Thl07 qNJg== X-Gm-Message-State: AOAM5335bZKQdik3R0V2pU+UtpKAHKlu7LHNInz+aLjWg2DlOOmf2JT2 uZBqwfttGK13vr61rPDwuuGc2MBzZ7XXjy2HK9puGuCNrX2pgjB5uynyX9YnLkSppop6mYzdptZ caZ04hqxDKye+D+lUOX7ed5uvOykFxH0DUvAeCG1mEaj3kQmRP2mWtybde1C5Nc7ZPneeeLE= X-Received: by 2002:adf:f446:: with SMTP id f6mr20421623wrp.361.1627941026656; Mon, 02 Aug 2021 14:50:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2C/8s7m/czZbSmi8qj34gzAHpy/9jwuf+rgkUdhvCbH0bcIaeJ54wVcbWqbw8x1cQwp2zRg== X-Received: by 2002:adf:f446:: with SMTP id f6mr20421607wrp.361.1627941026254; Mon, 02 Aug 2021 14:50:26 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:25 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 1/8] xfsprogs: Rename platform_defs.h.in -> defs.h.in Date: Mon, 2 Aug 2021 23:50:17 +0200 Message-Id: <20210802215024.949616-2-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org No other platform then linux is supported, so drop the extra "platform_" from filename. --- .gitignore | 2 +- Makefile | 10 +++++----- configure.ac | 2 +- debian/rules | 4 ++-- include/Makefile | 4 ++-- include/{platform_defs.h.in => defs.h.in} | 6 +++--- include/libxfs.h | 2 +- io/bmap.c | 2 +- io/bulkstat.c | 2 +- io/cowextsize.c | 2 +- io/crc32cselftest.c | 2 +- io/encrypt.c | 2 +- io/fiemap.c | 2 +- io/fsmap.c | 2 +- io/fsync.c | 2 +- io/init.c | 2 +- io/label.c | 2 +- io/log_writes.c | 2 +- io/sync.c | 2 +- libfrog/avl64.c | 2 +- libfrog/bitmap.c | 2 +- libfrog/convert.c | 2 +- libfrog/crc32.c | 2 +- libfrog/fsgeom.c | 2 +- libfrog/linux.c | 2 +- libfrog/paths.h | 2 +- libfrog/projects.h | 2 +- libfrog/ptvar.c | 2 +- libfrog/radix-tree.c | 2 +- libfrog/util.c | 2 +- libhandle/handle.c | 2 +- libhandle/jdm.c | 2 +- libxcmd/command.c | 2 +- libxcmd/help.c | 2 +- libxcmd/input.c | 2 +- libxcmd/quit.c | 2 +- libxfs/libxfs_priv.h | 2 +- scrub/common.c | 2 +- scrub/descr.c | 2 +- scrub/disk.c | 4 ++-- scrub/fscounters.c | 2 +- scrub/inodes.c | 2 +- scrub/xfs_scrub.c | 2 +- spaceman/health.c | 2 +- 44 files changed, 53 insertions(+), 53 deletions(-) rename include/{platform_defs.h.in => defs.h.in} (96%) diff --git a/.gitignore b/.gitignore index fd131b6f..59b81d6d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ # build system .census .gitcensus -/include/platform_defs.h +/include/defs.h /include/builddefs /install-sh diff --git a/Makefile b/Makefile index 0edc2700..296dcc09 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,7 @@ SRCTARINC = m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \ m4/ltversion.m4 po/xfsprogs.pot .gitcensus $(CONFIGURE) LDIRT = config.log .ltdep .dep config.status config.cache confdefs.h \ conftest* built .census install.* install-dev.* *.gz *.xz \ - autom4te.cache/* libtool include/builddefs include/platform_defs.h + autom4te.cache/* libtool include/builddefs include/defs.h ifeq ($(HAVE_BUILDDEFS), yes) LDIRDIRT = $(SRCDIR) @@ -84,7 +84,7 @@ endif # include is listed last so it is processed last in clean rules. SUBDIRS = $(LIBFROG_SUBDIR) $(LIB_SUBDIRS) $(TOOL_SUBDIRS) include -default: include/builddefs include/platform_defs.h +default: include/builddefs include/defs.h ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else @@ -130,7 +130,7 @@ configure: configure.ac include/builddefs: configure ./configure $$LOCAL_CONFIGURE_OPTIONS -include/platform_defs.h: include/builddefs +include/defs.h: include/builddefs ## Recover from the removal of $@ @if test -f $@; then :; else \ rm -f include/builddefs; \ @@ -160,14 +160,14 @@ realclean: distclean # # All this gunk is to allow for a make dist on an unconfigured tree # -dist: include/builddefs include/platform_defs.h default +dist: include/builddefs include/defs.h default ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else $(Q)$(MAKE) $(MAKEOPTS) $(SRCTAR) endif -deb: include/builddefs include/platform_defs.h +deb: include/builddefs include/defs.h ifeq ($(HAVE_BUILDDEFS), no) $(Q)$(MAKE) $(MAKEOPTS) -C . $@ else diff --git a/configure.ac b/configure.ac index e1775ed9..b328ccb5 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ(2.50) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([include/libxfs.h]) -AC_CONFIG_HEADER(include/platform_defs.h) +AC_CONFIG_HEADER(include/defs.h) AC_PREFIX_DEFAULT(/usr) AC_PROG_INSTALL diff --git a/debian/rules b/debian/rules index fe9a1c3a..700df898 100755 --- a/debian/rules +++ b/debian/rules @@ -44,14 +44,14 @@ config: .census $(checkdir) AUTOHEADER=/bin/true dh_autoreconf dh_update_autotools_config - $(options) $(MAKE) $(PMAKEFLAGS) include/platform_defs.h + $(options) $(MAKE) $(PMAKEFLAGS) include/defs.h touch .census dibuild: $(checkdir) @echo "== dpkg-buildpackage: installer" 1>&2 if [ ! -f mkfs/mkfs.xfs-$(bootpkg) ]; then \ - $(diopts) $(MAKE) include/platform_defs.h; \ + $(diopts) $(MAKE) include/defs.h; \ mkdir -p include/xfs; \ for dir in include libxfs; do \ $(MAKE) $(PMAKEFLAGS) -C $$dir NODEP=1 install-headers; \ diff --git a/include/Makefile b/include/Makefile index 632b819f..8e14ffae 100644 --- a/include/Makefile +++ b/include/Makefile @@ -27,7 +27,7 @@ LIBHFILES = libxfs.h \ xfs_trans.h \ command.h \ input.h \ - platform_defs.h + defs.h HFILES = handle.h \ jdm.h \ @@ -37,7 +37,7 @@ HFILES = handle.h \ xfs_fs_compat.h \ xfs_arch.h -LSRCFILES = platform_defs.h.in builddefs.in buildmacros buildrules install-sh +LSRCFILES = defs.h.in builddefs.in buildmacros buildrules install-sh LSRCFILES += $(DKHFILES) $(LIBHFILES) LDIRT = disk LDIRDIRT = xfs diff --git a/include/platform_defs.h.in b/include/defs.h.in similarity index 96% rename from include/platform_defs.h.in rename to include/defs.h.in index 539bdbec..ce0c1a0e 100644 --- a/include/platform_defs.h.in +++ b/include/defs.h.in @@ -3,8 +3,8 @@ * Copyright (c) 2000-2005 Silicon Graphics, Inc. * All Rights Reserved. */ -#ifndef __XFS_PLATFORM_DEFS_H__ -#define __XFS_PLATFORM_DEFS_H__ +#ifndef __XFS_DEFS_H__ +#define __XFS_DEFS_H__ #include #include @@ -112,4 +112,4 @@ static inline size_t __ab_c_size(size_t a, size_t b, size_t c) sizeof(*(p)->member) + __must_be_array((p)->member), \ sizeof(*(p))) -#endif /* __XFS_PLATFORM_DEFS_H__ */ +#endif /* __XFS_DEFS_H__ */ diff --git a/include/libxfs.h b/include/libxfs.h index bc07655e..af1feedb 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -8,7 +8,7 @@ #define __LIBXFS_H__ #include "libxfs_api_defs.h" -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "list.h" diff --git a/io/bmap.c b/io/bmap.c index 27383ca6..31a27848 100644 --- a/io/bmap.c +++ b/io/bmap.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/bulkstat.c b/io/bulkstat.c index 201470b2..f1a8113e 100644 --- a/io/bulkstat.c +++ b/io/bulkstat.c @@ -4,7 +4,7 @@ * Author: Darrick J. Wong */ #include "xfs.h" -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "libfrog/logging.h" diff --git a/io/cowextsize.c b/io/cowextsize.c index f6b134df..86496bb3 100644 --- a/io/cowextsize.c +++ b/io/cowextsize.c @@ -9,7 +9,7 @@ * build with the internal definition of struct fsxattr, which has * fsx_cowextsize. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/crc32cselftest.c b/io/crc32cselftest.c index f8f757f6..3ae8b98a 100644 --- a/io/crc32cselftest.c +++ b/io/crc32cselftest.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/encrypt.c b/io/encrypt.c index 1b347dc1..8d733363 100644 --- a/io/encrypt.c +++ b/io/encrypt.c @@ -7,7 +7,7 @@ #ifdef OVERRIDE_SYSTEM_FSCRYPT_ADD_KEY_ARG # define fscrypt_add_key_arg sys_fscrypt_add_key_arg #endif -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "libfrog/paths.h" diff --git a/io/fiemap.c b/io/fiemap.c index f0c74dfe..00bf5ec7 100644 --- a/io/fiemap.c +++ b/io/fiemap.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "input.h" #include diff --git a/io/fsmap.c b/io/fsmap.c index 4b217595..5cfb7794 100644 --- a/io/fsmap.c +++ b/io/fsmap.c @@ -3,7 +3,7 @@ * Copyright (C) 2017 Oracle. All Rights Reserved. * Author: Darrick J. Wong */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "libfrog/paths.h" diff --git a/io/fsync.c b/io/fsync.c index b425b612..0ba2fa6f 100644 --- a/io/fsync.c +++ b/io/fsync.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/io/init.c b/io/init.c index 033ed67d..0fbc703e 100644 --- a/io/init.c +++ b/io/init.c @@ -5,7 +5,7 @@ */ #include -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "input.h" #include "init.h" diff --git a/io/label.c b/io/label.c index 890ddde4..25b4adfb 100644 --- a/io/label.c +++ b/io/label.c @@ -4,7 +4,7 @@ */ #include -#include "platform_defs.h" +#include "defs.h" #include "libxfs.h" #include "libfrog/paths.h" #include "command.h" diff --git a/io/log_writes.c b/io/log_writes.c index 20049d18..0e24705e 100644 --- a/io/log_writes.c +++ b/io/log_writes.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include #include "command.h" #include "init.h" diff --git a/io/sync.c b/io/sync.c index 89f787ec..40c88531 100644 --- a/io/sync.c +++ b/io/sync.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "init.h" #include "io.h" diff --git a/libfrog/avl64.c b/libfrog/avl64.c index 2547bf3b..456c20e2 100644 --- a/libfrog/avl64.c +++ b/libfrog/avl64.c @@ -5,7 +5,7 @@ */ #include #include -#include "platform_defs.h" +#include "defs.h" #include "avl64.h" #define CERT ASSERT diff --git a/libfrog/bitmap.c b/libfrog/bitmap.c index 5af5ab8d..3081ecf6 100644 --- a/libfrog/bitmap.c +++ b/libfrog/bitmap.c @@ -8,7 +8,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "avl64.h" #include "list.h" #include "bitmap.h" diff --git a/libfrog/convert.c b/libfrog/convert.c index 0ceeb389..6211e192 100644 --- a/libfrog/convert.c +++ b/libfrog/convert.c @@ -3,7 +3,7 @@ * Copyright (c) 2003-2005 Silicon Graphics, Inc. * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "input.h" #include #include diff --git a/libfrog/crc32.c b/libfrog/crc32.c index 526ce950..c7f9c24b 100644 --- a/libfrog/crc32.c +++ b/libfrog/crc32.c @@ -32,7 +32,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" /* For endian conversion routines */ #include "xfs_arch.h" #include "crc32defs.h" diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c index 4f1a1842..62313c6b 100644 --- a/libfrog/fsgeom.c +++ b/libfrog/fsgeom.c @@ -2,7 +2,7 @@ /* * Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "bitops.h" #include "fsgeom.h" diff --git a/libfrog/linux.c b/libfrog/linux.c index a45d99ab..ea69b29b 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -9,7 +9,7 @@ #include #include -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "init.h" diff --git a/libfrog/paths.h b/libfrog/paths.h index c08e3733..01ca1e29 100644 --- a/libfrog/paths.h +++ b/libfrog/paths.h @@ -6,7 +6,7 @@ #ifndef __LIBFROG_PATH_H__ #define __LIBFROG_PATH_H__ -#include "platform_defs.h" +#include "defs.h" /* * XFS Filesystem Paths diff --git a/libfrog/projects.h b/libfrog/projects.h index 77919474..52c5cd33 100644 --- a/libfrog/projects.h +++ b/libfrog/projects.h @@ -6,7 +6,7 @@ #ifndef __LIBFROG_PROJECTS_H__ #define __LIBFROG_PROJECTS_H__ -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" extern int setprojid(const char *__name, int __fd, prid_t __id); diff --git a/libfrog/ptvar.c b/libfrog/ptvar.c index 7ac8c541..95e0eb15 100644 --- a/libfrog/ptvar.c +++ b/libfrog/ptvar.c @@ -10,7 +10,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "ptvar.h" /* diff --git a/libfrog/radix-tree.c b/libfrog/radix-tree.c index 261fc248..d07af105 100644 --- a/libfrog/radix-tree.c +++ b/libfrog/radix-tree.c @@ -8,7 +8,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "radix-tree.h" #ifndef ARRAY_SIZE diff --git a/libfrog/util.c b/libfrog/util.c index 8fb10cf8..8ab901f9 100644 --- a/libfrog/util.c +++ b/libfrog/util.c @@ -3,7 +3,7 @@ * Copyright (c) 2000-2005 Silicon Graphics, Inc. * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "util.h" /* diff --git a/libhandle/handle.c b/libhandle/handle.c index 27abc6b2..dbf56aba 100644 --- a/libhandle/handle.c +++ b/libhandle/handle.c @@ -5,7 +5,7 @@ */ #include -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "handle.h" #include "parent.h" diff --git a/libhandle/jdm.c b/libhandle/jdm.c index 07b0c609..d8f0efc0 100644 --- a/libhandle/jdm.c +++ b/libhandle/jdm.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "handle.h" #include "jdm.h" diff --git a/libxcmd/command.c b/libxcmd/command.c index a76d1515..7e37a9d6 100644 --- a/libxcmd/command.c +++ b/libxcmd/command.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "input.h" diff --git a/libxcmd/help.c b/libxcmd/help.c index b7e02073..09359dc0 100644 --- a/libxcmd/help.c +++ b/libxcmd/help.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "../quota/init.h" diff --git a/libxcmd/input.c b/libxcmd/input.c index e3fa626a..83b5a67d 100644 --- a/libxcmd/input.c +++ b/libxcmd/input.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "input.h" #include #include diff --git a/libxcmd/quit.c b/libxcmd/quit.c index 7c2d04f8..037b032c 100644 --- a/libxcmd/quit.c +++ b/libxcmd/quit.c @@ -4,7 +4,7 @@ * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "command.h" #include "../quota/init.h" diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index e37d5933..2815c79f 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -38,7 +38,7 @@ #define __LIBXFS_INTERNAL_XFS_H__ #include "libxfs_api_defs.h" -#include "platform_defs.h" +#include "defs.h" #include "xfs.h" #include "list.h" diff --git a/scrub/common.c b/scrub/common.c index 49a87f41..66be3f18 100644 --- a/scrub/common.c +++ b/scrub/common.c @@ -7,7 +7,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "libfrog/paths.h" #include "xfs_scrub.h" #include "common.h" diff --git a/scrub/descr.c b/scrub/descr.c index e694d01d..ffd57abe 100644 --- a/scrub/descr.c +++ b/scrub/descr.c @@ -6,7 +6,7 @@ #include "xfs.h" #include #include -#include "platform_defs.h" +#include "defs.h" #include "input.h" #include "libfrog/paths.h" #include "libfrog/ptvar.h" diff --git a/scrub/disk.c b/scrub/disk.c index a1ef798a..8bd2a36d 100644 --- a/scrub/disk.c +++ b/scrub/disk.c @@ -16,13 +16,13 @@ #ifdef HAVE_HDIO_GETGEO # include #endif -#include "platform_defs.h" +#include "defs.h" #include "libfrog/util.h" #include "libfrog/paths.h" #include "xfs_scrub.h" #include "common.h" #include "disk.h" -#include "platform_defs.h" +#include "defs.h" #ifndef BLKROTATIONAL # define BLKROTATIONAL _IO(0x12, 126) diff --git a/scrub/fscounters.c b/scrub/fscounters.c index f21b24e0..ef197687 100644 --- a/scrub/fscounters.c +++ b/scrub/fscounters.c @@ -7,7 +7,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "xfs_arch.h" #include "libfrog/paths.h" #include "libfrog/workqueue.h" diff --git a/scrub/inodes.c b/scrub/inodes.c index cc73da7f..f4f154da 100644 --- a/scrub/inodes.c +++ b/scrub/inodes.c @@ -8,7 +8,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "xfs_arch.h" #include "handle.h" #include "libfrog/paths.h" diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index bc2e84a7..afd2b3c1 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -10,7 +10,7 @@ #include #include #include -#include "platform_defs.h" +#include "defs.h" #include "input.h" #include "libfrog/paths.h" #include "xfs_scrub.h" diff --git a/spaceman/health.c b/spaceman/health.c index d83c5ccd..85a73c82 100644 --- a/spaceman/health.c +++ b/spaceman/health.c @@ -3,7 +3,7 @@ * Copyright (c) 2019 Oracle. * All Rights Reserved. */ -#include "platform_defs.h" +#include "defs.h" #include "libxfs.h" #include "command.h" #include "init.h" From patchwork Mon Aug 2 21:50:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414827 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5B6EC4320A for ; Mon, 2 Aug 2021 21:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B005F60FC1 for ; Mon, 2 Aug 2021 21:50:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231920AbhHBVuk (ORCPT ); Mon, 2 Aug 2021 17:50:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38345 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhHBVuk (ORCPT ); Mon, 2 Aug 2021 17:50:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qg6dUznY7Krc9uLhf+rKiMh4Ft5JeGh86ypCDysYG2g=; b=FiOo7IiABzoG+MCt1BjFeZ00GY198uIDkicN65StqtNLVri70574g21iJAn9Mp4keJ9BsV Saszi7SwKbrjJ4reYIYVP7J2SCA5sVFfZbKKAXX6XyWu2mqiybFAmJW2gSn2bz/teZMM+X KK0tLdPVzSjYC7QTNUHzm3plh2ZQJ9k= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-f1VagQXyM3CA-PejL16zhg-1; Mon, 02 Aug 2021 17:50:28 -0400 X-MC-Unique: f1VagQXyM3CA-PejL16zhg-1 Received: by mail-wr1-f70.google.com with SMTP id a9-20020a0560000509b029015485b95d0cso1325114wrf.5 for ; Mon, 02 Aug 2021 14:50:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qg6dUznY7Krc9uLhf+rKiMh4Ft5JeGh86ypCDysYG2g=; b=aCxonbUUp+t+UG9tglDP0BkNFafXOlweglQbunmrJ2uFgd7de9G5JxDMupUNH+ZPGN FeNx2hoY+VnQlKWr3sV9gDHpkUSMk9NP3Y43yo1qTmhOqDK754ZBofdKaniQDyMVvbF3 J6fhHVPx19JWWzVueVsOREQ8LpxH7kc3z+sosYbSlIdqRf4kZn2/sibQYn/wc8qF1iub at/dSrjKeGiLiisrAyGeFlzenE4rTZ0tXvaXARZKnGzd4ttv3m7mQ8Zb43MgQUIvcJol LtMkKuuJhINZ8PyANntjPH65s7XfOOrCSakHZR0mxmqWZNM8SKhLs0LuqRXJfWC2ov9f OB+Q== X-Gm-Message-State: AOAM5319M8L1TBUwtmRUF8oqE4c2ndcw8fl2XSKGO2a4EV3/EVd5zs8t ybtPaxKixxWqL+36gPEFuwDuMUgzGJY22Y4UTFnlNZ4g9qSp4v+R2tt3cKaPI1zh4bonkc9XctG 0AMtKtSJGlCvbiVOPj8e1qyARiYaZNWWrgz0aqnjXRP+wOloZhsQPoI0t5GditoVVUWPSkCs= X-Received: by 2002:a05:600c:4f46:: with SMTP id m6mr4196048wmq.68.1627941027203; Mon, 02 Aug 2021 14:50:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/e3XhmkL99nicevby06cu28Twq+Him28oLVc5NqzNRsE+FVgku2EXnQXuh6Up8C4mt01VlQ== X-Received: by 2002:a05:600c:4f46:: with SMTP id m6mr4196038wmq.68.1627941027027; Mon, 02 Aug 2021 14:50:27 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:26 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 2/8] xfsprogs: Rename platform.h -> common.h Date: Mon, 2 Aug 2021 23:50:18 +0200 Message-Id: <20210802215024.949616-3-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org No other platform then linux is supported so rename to something more common. --- copy/xfs_copy.c | 2 +- libfrog/{platform.h => common.h} | 0 libfrog/topology.c | 2 +- libxfs/init.c | 2 +- libxfs/rdwr.c | 2 +- repair/xfs_repair.c | 2 +- 6 files changed, 5 insertions(+), 5 deletions(-) rename libfrog/{platform.h => common.h} (100%) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index fc7d225f..c80b42d1 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -12,7 +12,7 @@ #include #include "xfs_copy.h" #include "libxlog.h" -#include "libfrog/platform.h" +#include "libfrog/common.h" #define rounddown(x, y) (((x)/(y))*(y)) #define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) diff --git a/libfrog/platform.h b/libfrog/common.h similarity index 100% rename from libfrog/platform.h rename to libfrog/common.h diff --git a/libfrog/topology.c b/libfrog/topology.c index b1b470c9..b059829e 100644 --- a/libfrog/topology.c +++ b/libfrog/topology.c @@ -11,7 +11,7 @@ #endif /* ENABLE_BLKID */ #include "xfs_multidisk.h" #include "topology.h" -#include "platform.h" +#include "common.h" #define TERABYTES(count, blog) ((uint64_t)(count) << (40 - (blog))) #define GIGABYTES(count, blog) ((uint64_t)(count) << (30 - (blog))) diff --git a/libxfs/init.c b/libxfs/init.c index 1ec83791..d1e87002 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -21,7 +21,7 @@ #include "xfs_trans.h" #include "xfs_rmap_btree.h" #include "xfs_refcount_btree.h" -#include "libfrog/platform.h" +#include "libfrog/common.h" #include "libxfs.h" /* for now */ diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index fd456d6b..f8e4cf0a 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -17,7 +17,7 @@ #include "xfs_inode_fork.h" #include "xfs_inode.h" #include "xfs_trans.h" -#include "libfrog/platform.h" +#include "libfrog/common.h" #include "libxfs.h" diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index 38406eea..af24b356 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -23,7 +23,7 @@ #include "slab.h" #include "rmap.h" #include "libfrog/fsgeom.h" -#include "libfrog/platform.h" +#include "libfrog/common.h" #include "bulkload.h" #include "quotacheck.h" From patchwork Mon Aug 2 21:50:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414823 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73129C432BE for ; Mon, 2 Aug 2021 21:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BF3F60EBB for ; Mon, 2 Aug 2021 21:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230313AbhHBVul (ORCPT ); Mon, 2 Aug 2021 17:50:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55175 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBVul (ORCPT ); Mon, 2 Aug 2021 17:50:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941030; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jWlBM/MV78duAhLTT2oScAQJPZ0iboS6PGETExLUw9A=; b=g0kStcPZcuCNXccqGmJ7EBKY7OEJC/shzFkOioK5ss6oGsuEcfCyrmVo30Bjh+NZnN09Sf Hl4/Nna/hW/ojbbo9yHh/swiVX0h4OuN3HXjEbRx7KEU4OCg/a3Fr85Koq9Zk6fiuN5/3C +uUnm+C/2+yVP+15dWGgVZanRlVwJBU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-174-4wIUQXAmNF2UbWiUT0uQ4A-1; Mon, 02 Aug 2021 17:50:29 -0400 X-MC-Unique: 4wIUQXAmNF2UbWiUT0uQ4A-1 Received: by mail-wm1-f71.google.com with SMTP id 85-20020a1c01580000b02902511869b403so169132wmb.8 for ; Mon, 02 Aug 2021 14:50:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jWlBM/MV78duAhLTT2oScAQJPZ0iboS6PGETExLUw9A=; b=D2IqJ254snyxahqAgGzHtHDs+ru0+/XhCLL09Cnx7OFxjcZPC/GTBI7KzM8Vb/0hd8 TWXlYX4irM5weUxV3vlSMatTsC1baLtCvlJM/2z2LTb66ld9iexOLg0g+hqy8rf2jHy1 TkqUqMARC9dTfMQC39qlIby5ficKz3Oej5dJglWqOpd5qFeoPH8l+gzRpKNKpHo/fjcq qYgRvH+LCN3OH6tLCcBmkm09HqA1isOgPmmJSIqj8CLlf8f6VIYrQDB4rc4MAwbeFBZN 89550FQdVTyfhZCr+d17cXn86wD9Axiga7oIkTmdxmINLmc7FiNb8Y6HtMvPpGASNrGV 8d5w== X-Gm-Message-State: AOAM531F8UxzpUiq7msxIUTbpI2l5QiyFld1h9sBBgaSWfRigJiLaD3l +IqQZ/dcQ8+8XadPxb0FCyxnKLZFnI8PnDjcuBOze9mVHp+BH9KdJT0DTMjcA4fNCUvyUmpdlUt ns009BzpTlJWL9i43EZyXmdxoWFtYtzPHwGd9pbLg1u9BCzWeGyBEHh7QnjKCuaGFYyJv7H4= X-Received: by 2002:a5d:5147:: with SMTP id u7mr19750097wrt.181.1627941028148; Mon, 02 Aug 2021 14:50:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHacHogk+S1/VlAdwZZeGv7FlqkAQH3VFo/CWTjwdbuF8smQ6Ef4OfIwK7vVoglrUStlEE2w== X-Received: by 2002:a5d:5147:: with SMTP id u7mr19750084wrt.181.1627941027899; Mon, 02 Aug 2021 14:50:27 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:27 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 3/8] xfsprogs: remove platform_uuid_compare() Date: Mon, 2 Aug 2021 23:50:19 +0200 Message-Id: <20210802215024.949616-4-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- copy/xfs_copy.c | 2 +- db/sb.c | 2 +- include/linux.h | 5 ----- libxfs/libxfs_priv.h | 2 +- libxlog/util.c | 2 +- repair/agheader.c | 4 ++-- repair/attr_repair.c | 2 +- repair/dinode.c | 6 +++--- repair/phase6.c | 2 +- repair/scan.c | 4 ++-- 10 files changed, 13 insertions(+), 18 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index c80b42d1..2a17bf38 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -15,7 +15,7 @@ #include "libfrog/common.h" #define rounddown(x, y) (((x)/(y))*(y)) -#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) +#define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) extern int platform_check_ismounted(char *, char *, struct stat *, int); diff --git a/db/sb.c b/db/sb.c index cec7dce9..7017e1e5 100644 --- a/db/sb.c +++ b/db/sb.c @@ -17,7 +17,7 @@ #include "output.h" #include "init.h" -#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) +#define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) static int sb_f(int argc, char **argv); static void sb_help(void); diff --git a/include/linux.h b/include/linux.h index a22f7812..9c7ea189 100644 --- a/include/linux.h +++ b/include/linux.h @@ -85,11 +85,6 @@ static __inline__ void platform_getoptreset(void) optind = 0; } -static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2) -{ - return uuid_compare(*uu1, *uu2); -} - static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer) { uuid_unparse(*uu, buffer); diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 2815c79f..22b4f606 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -505,7 +505,7 @@ static inline int retzero(void) { return 0; } #define xfs_qm_dqattach(i) (0) #define uuid_copy(s,d) platform_uuid_copy((s),(d)) -#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) +#define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) #define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0) #define xfs_sb_validate_fsb_count(sbp, nblks) (0) diff --git a/libxlog/util.c b/libxlog/util.c index a85d70c9..b4dfeca0 100644 --- a/libxlog/util.c +++ b/libxlog/util.c @@ -76,7 +76,7 @@ header_check_uuid(xfs_mount_t *mp, xlog_rec_header_t *head) if (print_skip_uuid) return 0; - if (!platform_uuid_compare(&mp->m_sb.sb_uuid, &head->h_fs_uuid)) + if (!uuid_compare(mp->m_sb.sb_uuid, head->h_fs_uuid)) return 0; platform_uuid_unparse(&mp->m_sb.sb_uuid, uu_sb); diff --git a/repair/agheader.c b/repair/agheader.c index 2af24106..1c4138e4 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -100,7 +100,7 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i) if (!xfs_sb_version_hascrc(&mp->m_sb)) return retval; - if (platform_uuid_compare(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid)) { + if (uuid_compare(agf->agf_uuid, mp->m_sb.sb_meta_uuid)) { char uu[64]; retval = XR_AG_AGF; @@ -179,7 +179,7 @@ verify_set_agi(xfs_mount_t *mp, xfs_agi_t *agi, xfs_agnumber_t agno) if (!xfs_sb_version_hascrc(&mp->m_sb)) return retval; - if (platform_uuid_compare(&agi->agi_uuid, &mp->m_sb.sb_meta_uuid)) { + if (uuid_compare(agi->agi_uuid, mp->m_sb.sb_meta_uuid)) { char uu[64]; retval = XR_AG_AGI; diff --git a/repair/attr_repair.c b/repair/attr_repair.c index bc3c2bef..25bdff73 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -947,7 +947,7 @@ _("expected block %" PRIu64 ", got %llu, inode %" PRIu64 "attr block\n"), return 1; } /* verify uuid */ - if (platform_uuid_compare(&info->uuid, &mp->m_sb.sb_meta_uuid) != 0) { + if (uuid_compare(info->uuid, mp->m_sb.sb_meta_uuid) != 0) { do_warn( _("wrong FS UUID, inode %" PRIu64 " attr block %" PRIu64 "\n"), ino, bp->b_bn); diff --git a/repair/dinode.c b/repair/dinode.c index 291c5807..a6156830 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -1098,7 +1098,7 @@ null_check(char *name, int length) * This does /not/ do quotacheck, it validates the basic quota * inode metadata, checksums, etc. */ -#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0) +#define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) static int process_quota_inode( struct xfs_mount *mp, @@ -2329,8 +2329,8 @@ _("inode identifier %llu mismatch on inode %" PRIu64 "\n"), return 1; goto clear_bad_out; } - if (platform_uuid_compare(&dino->di_uuid, - &mp->m_sb.sb_meta_uuid)) { + if (uuid_compare(dino->di_uuid, + mp->m_sb.sb_meta_uuid)) { if (!uncertain) do_warn( _("UUID mismatch on inode %" PRIu64 "\n"), lino); diff --git a/repair/phase6.c b/repair/phase6.c index 6bddfefa..05e6a321 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -1886,7 +1886,7 @@ _("expected block %" PRIu64 ", got %llu, directory inode %" PRIu64 "\n"), return 1; } /* verify uuid */ - if (platform_uuid_compare(uuid, &mp->m_sb.sb_meta_uuid) != 0) { + if (uuid_compare(*uuid, mp->m_sb.sb_meta_uuid) != 0) { do_warn( _("wrong FS UUID, directory inode %" PRIu64 " block %" PRIu64 "\n"), ino, bp->b_bn); diff --git a/repair/scan.c b/repair/scan.c index 2c25af57..361c3b3c 100644 --- a/repair/scan.c +++ b/repair/scan.c @@ -268,8 +268,8 @@ _("expected block %" PRIu64 ", got %llu, bmbt block %" PRIu64 "\n"), return 1; } /* verify uuid */ - if (platform_uuid_compare(&block->bb_u.l.bb_uuid, - &mp->m_sb.sb_meta_uuid) != 0) { + if (uuid_compare(block->bb_u.l.bb_uuid, + mp->m_sb.sb_meta_uuid) != 0) { do_warn( _("wrong FS UUID, bmbt block %" PRIu64 "\n"), bno); From patchwork Mon Aug 2 21:50:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68649C4320E for ; Mon, 2 Aug 2021 21:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 54F9660FA0 for ; Mon, 2 Aug 2021 21:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbhHBVum (ORCPT ); Mon, 2 Aug 2021 17:50:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50884 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbhHBVum (ORCPT ); Mon, 2 Aug 2021 17:50:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941031; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HL4LP/dxFXAmTv8R18DoT9bDI5AY53hvDJyS/CYm3eU=; b=Rb2CMXkdBzAK30IWOym2MOCyPWGG0Z7TBxS3O0JPJG8fidmuoRFHxOyC/AlirSLqjGEvZZ UFgDrLgnYSBAHKwbmsrLbdfjyhs2SiDl3QezZQnZ/004++kbilF1x4VP64oL9y97W0uXDv gfifa0wZUNhhLRvtC5O9bQRDJWDcFXM= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-131-bcFedhSoNWiBBTc1AwMRzw-1; Mon, 02 Aug 2021 17:50:30 -0400 X-MC-Unique: bcFedhSoNWiBBTc1AwMRzw-1 Received: by mail-wr1-f70.google.com with SMTP id q13-20020a05600000cdb02901545f1bdac1so3155927wrx.4 for ; Mon, 02 Aug 2021 14:50:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HL4LP/dxFXAmTv8R18DoT9bDI5AY53hvDJyS/CYm3eU=; b=agXgK1Pyx6NIyQl2bebjL8X8Ki1AsiMSSXYoF9nxtdMLYSB6/XMQgVzVLnSBr7G6to SHuIhHzRkmqeThjHLeGkSRm2XBQfLlR69WjOmgDF/VKTwsG8+auC0HENyCkT6kPBZFtK a+P4jV5nbrTW+r2eQ+9DknCjso17jCL7qTgB4exLMyiPCyHgxFXodNez/Cyf34aQ0Ozv ajaJUKqDvrBd+Xkz1hawEpoi6rB3ZXC/v/jc/DJboueeIa7s/1KMEef9J+U9DYZMlwjb +xzY9hE4AKtRJ33Smcr82G1p7cZ57+Db+N1ZmY8jjTmHpaui6UzPEaC0lrLoSqG4lygl ubuA== X-Gm-Message-State: AOAM530LC+5lyaEtn69WjE/b+QZ0+bspSUL5/MNP4zqDrgvpZxqhrsiY QN7e9mHJRwKRQ2LV5cZ/cI6JUQvhycUbzt8rIByYv+FQMCnNq88NlCElifrWfJtcFawghObn4FS HYKo5i4Fl4C3lO68AIPD+NJgItevaFwwSepymtl7SG6ZVr8H/k9dg9Xy6JBDyyM+qv5JC0r4= X-Received: by 2002:a1c:7314:: with SMTP id d20mr18255994wmb.167.1627941029158; Mon, 02 Aug 2021 14:50:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6p4PdcvZUORmnbjq20LoSy0bfSYfwLnbQKbKvF+UiPviTB8ZgTBFbpxUmTN+X7XgiHn/Xpw== X-Received: by 2002:a1c:7314:: with SMTP id d20mr18255976wmb.167.1627941028890; Mon, 02 Aug 2021 14:50:28 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:28 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 4/8] xfsprogs: remove platform_{test_xfs_fd,path,fstatfs} Date: Mon, 2 Aug 2021 23:50:20 +0200 Message-Id: <20210802215024.949616-5-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- copy/xfs_copy.c | 4 ++-- fsr/xfs_fsr.c | 2 +- growfs/xfs_growfs.c | 2 +- include/linux.h | 9 ++------- io/init.c | 2 +- io/open.c | 4 ++-- io/stat.c | 2 +- libfrog/paths.c | 2 +- quota/free.c | 2 +- spaceman/init.c | 2 +- 10 files changed, 13 insertions(+), 18 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 2a17bf38..4872621d 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -670,7 +670,7 @@ main(int argc, char **argv) if (S_ISREG(statbuf.st_mode)) source_is_file = 1; - if (source_is_file && platform_test_xfs_fd(source_fd)) { + if (source_is_file && test_xfs_fd(source_fd)) { if (fcntl(source_fd, F_SETFL, open_flags | O_DIRECT) < 0) { do_log(_("%s: Cannot set direct I/O flag on \"%s\".\n"), progname, source_name); @@ -869,7 +869,7 @@ main(int argc, char **argv) progname); die_perror(); } - if (platform_test_xfs_fd(target[i].fd)) { + if (test_xfs_fd(target[i].fd)) { if (xfsctl(target[i].name, target[i].fd, XFS_IOC_DIOINFO, &d) < 0) { do_log( diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 6cf8bfb7..25eb2e12 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -248,7 +248,7 @@ main(int argc, char **argv) progname, argname); exit(1); } else if (S_ISDIR(sb.st_mode) || S_ISREG(sb.st_mode)) { - if (!platform_test_xfs_path(argname)) { + if (!test_xfs_path(argname)) { fprintf(stderr, _( "%s: cannot defragment: %s: Not XFS\n"), progname, argname); diff --git a/growfs/xfs_growfs.c b/growfs/xfs_growfs.c index d45ba703..dc01dfe8 100644 --- a/growfs/xfs_growfs.c +++ b/growfs/xfs_growfs.c @@ -160,7 +160,7 @@ main(int argc, char **argv) return 1; } - if (!platform_test_xfs_fd(ffd)) { + if (!test_xfs_fd(ffd)) { fprintf(stderr, _("%s: specified file " "[\"%s\"] is not on an XFS filesystem\n"), progname, fname); diff --git a/include/linux.h b/include/linux.h index 9c7ea189..bef4ea00 100644 --- a/include/linux.h +++ b/include/linux.h @@ -46,7 +46,7 @@ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) * so return 0 for those */ -static __inline__ int platform_test_xfs_fd(int fd) +static __inline__ int test_xfs_fd(int fd) { struct statfs statfsbuf; struct stat statbuf; @@ -60,7 +60,7 @@ static __inline__ int platform_test_xfs_fd(int fd) return (statfsbuf.f_type == 0x58465342); /* XFSB */ } -static __inline__ int platform_test_xfs_path(const char *path) +static __inline__ int test_xfs_path(const char *path) { struct statfs statfsbuf; struct stat statbuf; @@ -74,11 +74,6 @@ static __inline__ int platform_test_xfs_path(const char *path) return (statfsbuf.f_type == 0x58465342); /* XFSB */ } -static __inline__ int platform_fstatfs(int fd, struct statfs *buf) -{ - return fstatfs(fd, buf); -} - static __inline__ void platform_getoptreset(void) { extern int optind; diff --git a/io/init.c b/io/init.c index 0fbc703e..15df0c03 100644 --- a/io/init.c +++ b/io/init.c @@ -219,7 +219,7 @@ init( c = openfile(argv[optind], &geometry, flags, mode, &fsp); if (c < 0) exit(1); - if (!platform_test_xfs_fd(c)) + if (!test_xfs_fd(c)) flags |= IO_FOREIGN; if (addfile(argv[optind], c, &geometry, flags, &fsp) < 0) exit(1); diff --git a/io/open.c b/io/open.c index d8072664..498e6163 100644 --- a/io/open.c +++ b/io/open.c @@ -115,7 +115,7 @@ openfile( } } - if (!geom || !platform_test_xfs_fd(fd)) + if (!geom || !test_xfs_fd(fd)) return fd; if (flags & IO_PATH) { @@ -326,7 +326,7 @@ open_f( return 0; } - if (!platform_test_xfs_fd(fd)) + if (!test_xfs_fd(fd)) flags |= IO_FOREIGN; if (addfile(argv[optind], fd, &geometry, flags, &fsp) != 0) { diff --git a/io/stat.c b/io/stat.c index 49c4c27c..78f7d7f8 100644 --- a/io/stat.c +++ b/io/stat.c @@ -182,7 +182,7 @@ statfs_f( int ret; printf(_("fd.path = \"%s\"\n"), file->name); - if (platform_fstatfs(file->fd, &st) < 0) { + if (fstatfs(file->fd, &st) < 0) { perror("fstatfs"); exitcode = 1; } else { diff --git a/libfrog/paths.c b/libfrog/paths.c index d6793764..c86f258e 100644 --- a/libfrog/paths.c +++ b/libfrog/paths.c @@ -161,7 +161,7 @@ fs_table_insert( goto out_nodev; } - if (!platform_test_xfs_path(dir)) + if (!test_xfs_path(dir)) flags |= FS_FOREIGN; /* diff --git a/quota/free.c b/quota/free.c index ea9c112f..8fcb6b93 100644 --- a/quota/free.c +++ b/quota/free.c @@ -62,7 +62,7 @@ mount_free_space_data( return 0; } - if (platform_fstatfs(fd, &st) < 0) { + if (fstatfs(fd, &st) < 0) { perror("fstatfs"); close(fd); return 0; diff --git a/spaceman/init.c b/spaceman/init.c index cf1ff3cb..8ad70929 100644 --- a/spaceman/init.c +++ b/spaceman/init.c @@ -93,7 +93,7 @@ init( c = openfile(argv[optind], &xfd, &fsp); if (c < 0) exit(1); - if (!platform_test_xfs_fd(xfd.fd)) + if (!test_xfs_fd(xfd.fd)) printf(_("Not an XFS filesystem!\n")); c = addfile(argv[optind], &xfd, &fsp); if (c < 0) From patchwork Mon Aug 2 21:50:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414829 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD6CBC43214 for ; Mon, 2 Aug 2021 21:50:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B36E460F9C for ; Mon, 2 Aug 2021 21:50:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232333AbhHBVun (ORCPT ); Mon, 2 Aug 2021 17:50:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22152 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbhHBVum (ORCPT ); Mon, 2 Aug 2021 17:50:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941032; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jHLXYvlZAf2kHcw5oST3ZdpB2o5vzu2wEijmKB9e+8M=; b=KtqzUUcmSTXrHwC6T1mt/TQGJrwD4vPiqaH3fe40iCyJX9FRAStleYEB65sGVNxFGo88MS ALO1nItX5C7radV25zFsXGjT5Su0WyxF7vZkxaiK0yu6aM1gqKY2YP5lMS1UyUWNfaxeil 34kdtHTIVxQd+E56NEMAeDT2whT/S9o= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-421-TGX-ahfFMV2pDdS4Phsg6Q-1; Mon, 02 Aug 2021 17:50:31 -0400 X-MC-Unique: TGX-ahfFMV2pDdS4Phsg6Q-1 Received: by mail-wm1-f72.google.com with SMTP id l19-20020a05600c4f13b029025b036c91c6so1064945wmq.2 for ; Mon, 02 Aug 2021 14:50:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jHLXYvlZAf2kHcw5oST3ZdpB2o5vzu2wEijmKB9e+8M=; b=U4Q2EaBQ7k3aj/WL5kd9fM7AMgBmTzh3z88NnLdBBEsaGQuqWOJbIhes9gL2mfm3sV iBN/jFIJIBoV3tovQL2c0s2QHmEmr4sCbGFeasXVZfoFbKTu3Oq30Uif6duz6jPM3h4X XbzVMH4Tfv24uC2vHnaYUYHGyfrVrF8klrrpT5XbTIJTLl0Pgrv5zH1cQ0yRBLQLkmNn LTgXnUTQpVn9D3ftJWVhM5h0O4O2xfRvo7lDPrG/uThmWmw5SQjf0vLPYl2753OYLQC9 fn2dCGKwfHsY5NYsqEvVgdmVBqJGUy4m2JWVA3WJhbjsKSLWsNd9/LG8VI+M4+vSnYLw qn5g== X-Gm-Message-State: AOAM531ZtJ4WLra9sr7rcdlARndLuctonJGdoILFILH7hDXWUB5eYJk3 3YCfUdXfJLxFbYyd+kyTHoQfJrpeMKqUJUzdQlxpuWtbGA/1sFpMvGa2O4hhj6ngmJdlUcDTn2l n+NVbWZ4QzGVAML7SPx4DHsQit508wipvcERgTmp3yWQ6Q9/2FUaOxjNHVlr2UyRwCOpZsJ0= X-Received: by 2002:adf:ed4a:: with SMTP id u10mr19258299wro.86.1627941029671; Mon, 02 Aug 2021 14:50:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdBYJHzRuH5N52jq1NA7/vnSCAB+8RSnwqZfDO7Kf2aJAQruFLWvf9fbK0BrjmRaHxIWhWyw== X-Received: by 2002:adf:ed4a:: with SMTP id u10mr19258289wro.86.1627941029549; Mon, 02 Aug 2021 14:50:29 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:29 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 5/8] xfsprogs: Rename platform_getoptreset -> getoptreset Date: Mon, 2 Aug 2021 23:50:21 +0200 Message-Id: <20210802215024.949616-6-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- db/command.c | 2 +- include/linux.h | 2 +- libxcmd/command.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/db/command.c b/db/command.c index 02f778b9..65d8a056 100644 --- a/db/command.c +++ b/db/command.c @@ -84,7 +84,7 @@ command( dbprintf(_(" arguments\n")); return 0; } - platform_getoptreset(); + getoptreset(); return ct->cfunc(argc, argv); } diff --git a/include/linux.h b/include/linux.h index bef4ea00..1905640f 100644 --- a/include/linux.h +++ b/include/linux.h @@ -74,7 +74,7 @@ static __inline__ int test_xfs_path(const char *path) return (statfsbuf.f_type == 0x58465342); /* XFSB */ } -static __inline__ void platform_getoptreset(void) +static __inline__ void getoptreset(void) { extern int optind; optind = 0; diff --git a/libxcmd/command.c b/libxcmd/command.c index 7e37a9d6..610b3e0c 100644 --- a/libxcmd/command.c +++ b/libxcmd/command.c @@ -92,7 +92,7 @@ command( argc-1, cmd, ct->argmin, ct->argmax); return 0; } - platform_getoptreset(); + getoptreset(); return ct->cfunc(argc, argv); } From patchwork Mon Aug 2 21:50:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414833 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 832D6C4338F for ; Mon, 2 Aug 2021 21:50:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 65D3D60EBB for ; Mon, 2 Aug 2021 21:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232475AbhHBVuo (ORCPT ); Mon, 2 Aug 2021 17:50:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24124 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBVuo (ORCPT ); Mon, 2 Aug 2021 17:50:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=spKTbDeH0Oe8em9YmGAL1NYnI03b6P0iCH+/D3pUack=; b=S+Leb82jHFZYzI+Ifb4YzSddefCBRwDRgZpGaUn1DHu3ShBdntNXS8a4OK2v0DrAQsbvyM ayp26xq62p6+7yQDKX8d9t9YKCZDEgCGoVXqHn9hj04TiUdJw0DCJZzYI/2H5TNCdTqVOs eXD90jfTUIKJWnvA16LrPXDxjJ/N53Q= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-xEMSE6gcPBuYC4mroBPMxg-1; Mon, 02 Aug 2021 17:50:32 -0400 X-MC-Unique: xEMSE6gcPBuYC4mroBPMxg-1 Received: by mail-wr1-f69.google.com with SMTP id q13-20020a05600000cdb02901545f1bdac1so3155940wrx.4 for ; Mon, 02 Aug 2021 14:50:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=spKTbDeH0Oe8em9YmGAL1NYnI03b6P0iCH+/D3pUack=; b=gzBwHm1rQ0pHXDGC+wknu9pj1I7YiSlU3/QIwVhnXnSPhju/Xvlj59Ph/UTX3+Ihg2 KR7o5lSk96URhwDA4WC5l2t/Q4/V63xiBbtYPYURrpoOBH4m8TyxyfiqffIKz4fCE/a2 ZN8mCGKOde2xDOR1T6D94erE1QXKO6KxwSQHMNr70RAaXrRYuXfnB2yw23blELxSU+g6 NCjAfj9CtpBsKK9RmjjGCqwXu2hqqeQTwV97WEc/UNun3Jj0ul3fwPxzsJNPZ7+hIQIX Kfa6U6zinuXcY4ekA+MeanayMp9vKxll2n5fkZJQIodPvhZzpbGHF7QfIRlqCxTjBXVd Xx1A== X-Gm-Message-State: AOAM533f+2YHkg68qE2wGuFO0j/T0SSTM+sZhLwL8BZwYVbMoNhtqWCL H4JNxM2ysGhR04hpCYNnG9fLt871y6nVBxKeQjuPe0f+zEw+B/OjUduXeYV44F81J4J2bkrEdT7 fI1WjCR5j1yFh4ijUiFT5OHQb0Hw5U3fo/SG5Idmt6YqC8std8bImJZ6NX9kzmWbzkqjtD3I= X-Received: by 2002:adf:fc12:: with SMTP id i18mr19261339wrr.138.1627941031088; Mon, 02 Aug 2021 14:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvdvsina37Rmmap8LKF3aAmX3Vv0KGMUYn4PowpfrNRbdxDu4BGI4JtdFyQ89aEHDBPhHbQw== X-Received: by 2002:adf:fc12:: with SMTP id i18mr19261320wrr.138.1627941030698; Mon, 02 Aug 2021 14:50:30 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:30 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 6/8] xfsprogs: remove all platform_ prefixes in linux.h Date: Mon, 2 Aug 2021 23:50:22 +0200 Message-Id: <20210802215024.949616-7-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- copy/xfs_copy.c | 10 +++++----- db/fprint.c | 2 +- db/sb.c | 12 ++++++------ include/linux.h | 30 ------------------------------ libxfs/libxfs_priv.h | 1 - libxfs/xfs_ag.c | 6 +++--- libxfs/xfs_attr_leaf.c | 2 +- libxfs/xfs_attr_remote.c | 2 +- libxfs/xfs_btree.c | 4 ++-- libxfs/xfs_da_btree.c | 2 +- libxfs/xfs_dir2_block.c | 2 +- libxfs/xfs_dir2_data.c | 2 +- libxfs/xfs_dir2_leaf.c | 2 +- libxfs/xfs_dir2_node.c | 2 +- libxfs/xfs_dquot_buf.c | 2 +- libxfs/xfs_ialloc.c | 4 ++-- libxfs/xfs_inode_buf.c | 2 +- libxfs/xfs_sb.c | 6 +++--- libxfs/xfs_symlink_remote.c | 2 +- libxlog/util.c | 6 +++--- logprint/log_misc.c | 2 +- mkfs/xfs_mkfs.c | 12 ++++++------ repair/agheader.c | 12 ++++++------ repair/dinode.c | 2 +- repair/phase5.c | 6 +++--- 25 files changed, 52 insertions(+), 83 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 4872621d..f06a1557 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -530,12 +530,12 @@ sb_update_uuid( feat = be32_to_cpu(ag_hdr->xfs_sb->sb_features_incompat); feat |= XFS_SB_FEAT_INCOMPAT_META_UUID; ag_hdr->xfs_sb->sb_features_incompat = cpu_to_be32(feat); - platform_uuid_copy(&ag_hdr->xfs_sb->sb_meta_uuid, - &sb->sb_uuid); + uuid_copy(ag_hdr->xfs_sb->sb_meta_uuid, + sb->sb_uuid); } /* Copy the (possibly new) fs-identifier UUID into sb_uuid */ - platform_uuid_copy(&ag_hdr->xfs_sb->sb_uuid, &tcarg->uuid); + uuid_copy(ag_hdr->xfs_sb->sb_uuid, tcarg->uuid); /* We may have changed the UUID, so update the superblock CRC */ if (xfs_sb_version_hascrc(sb)) @@ -946,9 +946,9 @@ main(int argc, char **argv) for (i = 0, tcarg = targ; i < num_targets; i++, tcarg++) { if (!duplicate) - platform_uuid_generate(&tcarg->uuid); + uuid_generate(tcarg->uuid); else - platform_uuid_copy(&tcarg->uuid, &mp->m_sb.sb_uuid); + uuid_copy(tcarg->uuid, mp->m_sb.sb_uuid); if (pthread_mutex_init(&tcarg->wait, NULL) != 0) { do_log(_("Error creating thread mutex %d\n"), i); diff --git a/db/fprint.c b/db/fprint.c index 65accfda..f2f42c28 100644 --- a/db/fprint.c +++ b/db/fprint.c @@ -273,7 +273,7 @@ fp_uuid( i++, p++) { if (array) dbprintf("%d:", i + base); - platform_uuid_unparse(p, bp); + uuid_unparse(*p, bp); dbprintf("%s", bp); if (i < count - 1) dbprintf(" "); diff --git a/db/sb.c b/db/sb.c index 7017e1e5..63f43ea4 100644 --- a/db/sb.c +++ b/db/sb.c @@ -386,9 +386,9 @@ uuid_f( } if (!strcasecmp(argv[1], "generate")) { - platform_uuid_generate(&uu); + uuid_generate(uu); } else if (!strcasecmp(argv[1], "nil")) { - platform_uuid_clear(&uu); + uuid_clear(uu); } else if (!strcasecmp(argv[1], "rewrite")) { uup = do_uuid(0, NULL); if (!uup) { @@ -396,7 +396,7 @@ uuid_f( return 0; } memcpy(&uu, uup, sizeof(uuid_t)); - platform_uuid_unparse(&uu, bp); + uuid_unparse(uu, bp); dbprintf(_("old UUID = %s\n"), bp); } else if (!strcasecmp(argv[1], "restore")) { xfs_sb_t tsb; @@ -410,7 +410,7 @@ uuid_f( memcpy(&uu, mp->m_sb.sb_meta_uuid, sizeof(uuid_t)); } else { - if (platform_uuid_parse(argv[1], &uu)) { + if (uuid_parse(argv[1], uu)) { dbprintf(_("invalid UUID\n")); return 0; } @@ -427,7 +427,7 @@ uuid_f( break; } - platform_uuid_unparse(&uu, bp); + uuid_unparse(uu, bp); dbprintf(_("new UUID = %s\n"), bp); return 0; @@ -460,7 +460,7 @@ uuid_f( "for FS with an external log\n")); } - platform_uuid_unparse(&uu, bp); + uuid_unparse(uu, bp); dbprintf(_("UUID = %s\n"), bp); } diff --git a/include/linux.h b/include/linux.h index 1905640f..a12ccee1 100644 --- a/include/linux.h +++ b/include/linux.h @@ -80,36 +80,6 @@ static __inline__ void getoptreset(void) optind = 0; } -static __inline__ void platform_uuid_unparse(uuid_t *uu, char *buffer) -{ - uuid_unparse(*uu, buffer); -} - -static __inline__ int platform_uuid_parse(const char *buffer, uuid_t *uu) -{ - return uuid_parse(buffer, *uu); -} - -static __inline__ int platform_uuid_is_null(uuid_t *uu) -{ - return uuid_is_null(*uu); -} - -static __inline__ void platform_uuid_generate(uuid_t *uu) -{ - uuid_generate(*uu); -} - -static __inline__ void platform_uuid_clear(uuid_t *uu) -{ - uuid_clear(*uu); -} - -static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src) -{ - uuid_copy(*dst, *src); -} - #ifndef BLKDISCARD #define BLKDISCARD _IO(0x12,119) #endif diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 22b4f606..454df465 100644 --- a/libxfs/libxfs_priv.h +++ b/libxfs/libxfs_priv.h @@ -504,7 +504,6 @@ static inline int retzero(void) { return 0; } #define xfs_quota_reserve_blkres(i,b) (0) #define xfs_qm_dqattach(i) (0) -#define uuid_copy(s,d) platform_uuid_copy((s),(d)) #define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) #define xfs_icreate_log(tp, agno, agbno, cnt, isize, len, gen) ((void) 0) diff --git a/libxfs/xfs_ag.c b/libxfs/xfs_ag.c index af8a0afd..7c70aa4c 100644 --- a/libxfs/xfs_ag.c +++ b/libxfs/xfs_ag.c @@ -268,7 +268,7 @@ xfs_agfblock_init( agf->agf_freeblks = cpu_to_be32(tmpsize); agf->agf_longest = cpu_to_be32(tmpsize); if (xfs_sb_version_hascrc(&mp->m_sb)) - uuid_copy(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agf->agf_uuid, mp->m_sb.sb_meta_uuid); if (xfs_sb_version_hasreflink(&mp->m_sb)) { agf->agf_refcount_root = cpu_to_be32( xfs_refc_block(mp)); @@ -298,7 +298,7 @@ xfs_agflblock_init( if (xfs_sb_version_hascrc(&mp->m_sb)) { agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC); agfl->agfl_seqno = cpu_to_be32(id->agno); - uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agfl->agfl_uuid, mp->m_sb.sb_meta_uuid); } agfl_bno = xfs_buf_to_agfl_bno(bp); @@ -326,7 +326,7 @@ xfs_agiblock_init( agi->agi_newino = cpu_to_be32(NULLAGINO); agi->agi_dirino = cpu_to_be32(NULLAGINO); if (xfs_sb_version_hascrc(&mp->m_sb)) - uuid_copy(&agi->agi_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agi->agi_uuid, mp->m_sb.sb_meta_uuid); if (xfs_sb_version_hasfinobt(&mp->m_sb)) { agi->agi_free_root = cpu_to_be32(XFS_FIBT_BLOCK(mp)); agi->agi_free_level = cpu_to_be32(1); diff --git a/libxfs/xfs_attr_leaf.c b/libxfs/xfs_attr_leaf.c index a59660f2..70fa7b2f 100644 --- a/libxfs/xfs_attr_leaf.c +++ b/libxfs/xfs_attr_leaf.c @@ -1272,7 +1272,7 @@ xfs_attr3_leaf_create( hdr3->blkno = cpu_to_be64(bp->b_bn); hdr3->owner = cpu_to_be64(dp->i_ino); - uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(hdr3->uuid, mp->m_sb.sb_meta_uuid); ichdr.freemap[0].base = sizeof(struct xfs_attr3_leaf_hdr); } else { diff --git a/libxfs/xfs_attr_remote.c b/libxfs/xfs_attr_remote.c index 3807cd3d..ed459290 100644 --- a/libxfs/xfs_attr_remote.c +++ b/libxfs/xfs_attr_remote.c @@ -251,7 +251,7 @@ xfs_attr3_rmt_hdr_set( rmt->rm_magic = cpu_to_be32(XFS_ATTR3_RMT_MAGIC); rmt->rm_offset = cpu_to_be32(offset); rmt->rm_bytes = cpu_to_be32(size); - uuid_copy(&rmt->rm_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(rmt->rm_uuid, mp->m_sb.sb_meta_uuid); rmt->rm_owner = cpu_to_be64(ino); rmt->rm_blkno = cpu_to_be64(bno); diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c index d52fdc00..59fb4223 100644 --- a/libxfs/xfs_btree.c +++ b/libxfs/xfs_btree.c @@ -1097,7 +1097,7 @@ xfs_btree_init_block_int( if (crc) { buf->bb_u.l.bb_blkno = cpu_to_be64(blkno); buf->bb_u.l.bb_owner = cpu_to_be64(owner); - uuid_copy(&buf->bb_u.l.bb_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(buf->bb_u.l.bb_uuid, mp->m_sb.sb_meta_uuid); buf->bb_u.l.bb_pad = 0; buf->bb_u.l.bb_lsn = 0; } @@ -1110,7 +1110,7 @@ xfs_btree_init_block_int( if (crc) { buf->bb_u.s.bb_blkno = cpu_to_be64(blkno); buf->bb_u.s.bb_owner = cpu_to_be32(__owner); - uuid_copy(&buf->bb_u.s.bb_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(buf->bb_u.s.bb_uuid, mp->m_sb.sb_meta_uuid); buf->bb_u.s.bb_lsn = 0; } } diff --git a/libxfs/xfs_da_btree.c b/libxfs/xfs_da_btree.c index 7448ee6c..8c3deca6 100644 --- a/libxfs/xfs_da_btree.c +++ b/libxfs/xfs_da_btree.c @@ -446,7 +446,7 @@ xfs_da3_node_create( ichdr.magic = XFS_DA3_NODE_MAGIC; hdr3->info.blkno = cpu_to_be64(bp->b_bn); hdr3->info.owner = cpu_to_be64(args->dp->i_ino); - uuid_copy(&hdr3->info.uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(hdr3->info.uuid, mp->m_sb.sb_meta_uuid); } else { ichdr.magic = XFS_DA_NODE_MAGIC; } diff --git a/libxfs/xfs_dir2_block.c b/libxfs/xfs_dir2_block.c index eaa2b47a..2ee95a4f 100644 --- a/libxfs/xfs_dir2_block.c +++ b/libxfs/xfs_dir2_block.c @@ -173,7 +173,7 @@ xfs_dir3_block_init( hdr3->magic = cpu_to_be32(XFS_DIR3_BLOCK_MAGIC); hdr3->blkno = cpu_to_be64(bp->b_bn); hdr3->owner = cpu_to_be64(dp->i_ino); - uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(hdr3->uuid, mp->m_sb.sb_meta_uuid); return; } diff --git a/libxfs/xfs_dir2_data.c b/libxfs/xfs_dir2_data.c index ddd5e885..c11b718b 100644 --- a/libxfs/xfs_dir2_data.c +++ b/libxfs/xfs_dir2_data.c @@ -721,7 +721,7 @@ xfs_dir3_data_init( hdr3->magic = cpu_to_be32(XFS_DIR3_DATA_MAGIC); hdr3->blkno = cpu_to_be64(bp->b_bn); hdr3->owner = cpu_to_be64(dp->i_ino); - uuid_copy(&hdr3->uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(hdr3->uuid, mp->m_sb.sb_meta_uuid); } else hdr->magic = cpu_to_be32(XFS_DIR2_DATA_MAGIC); diff --git a/libxfs/xfs_dir2_leaf.c b/libxfs/xfs_dir2_leaf.c index 0cecd698..25edf4c8 100644 --- a/libxfs/xfs_dir2_leaf.c +++ b/libxfs/xfs_dir2_leaf.c @@ -312,7 +312,7 @@ xfs_dir3_leaf_init( : cpu_to_be16(XFS_DIR3_LEAFN_MAGIC); leaf3->info.blkno = cpu_to_be64(bp->b_bn); leaf3->info.owner = cpu_to_be64(owner); - uuid_copy(&leaf3->info.uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(leaf3->info.uuid, mp->m_sb.sb_meta_uuid); } else { memset(leaf, 0, sizeof(*leaf)); leaf->hdr.info.magic = cpu_to_be16(type); diff --git a/libxfs/xfs_dir2_node.c b/libxfs/xfs_dir2_node.c index ab156a8e..c1d4a18b 100644 --- a/libxfs/xfs_dir2_node.c +++ b/libxfs/xfs_dir2_node.c @@ -345,7 +345,7 @@ xfs_dir3_free_get_buf( hdr3->hdr.blkno = cpu_to_be64(bp->b_bn); hdr3->hdr.owner = cpu_to_be64(dp->i_ino); - uuid_copy(&hdr3->hdr.uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(hdr3->hdr.uuid, mp->m_sb.sb_meta_uuid); } else hdr.magic = XFS_DIR2_FREE_MAGIC; xfs_dir2_free_hdr_to_disk(mp, bp->b_addr, &hdr); diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c index 0a5a237d..2f5fd03e 100644 --- a/libxfs/xfs_dquot_buf.c +++ b/libxfs/xfs_dquot_buf.c @@ -133,7 +133,7 @@ xfs_dqblk_repair( dqb->dd_diskdq.d_id = cpu_to_be32(id); if (xfs_sb_version_hascrc(&mp->m_sb)) { - uuid_copy(&dqb->dd_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(dqb->dd_uuid, mp->m_sb.sb_meta_uuid); xfs_update_cksum((char *)dqb, sizeof(struct xfs_dqblk), XFS_DQUOT_CRC_OFF); } diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c index c8e2125d..b42fe37a 100644 --- a/libxfs/xfs_ialloc.c +++ b/libxfs/xfs_ialloc.c @@ -345,8 +345,8 @@ xfs_ialloc_inode_init( if (version == 3) { free->di_ino = cpu_to_be64(ino); ino++; - uuid_copy(&free->di_uuid, - &mp->m_sb.sb_meta_uuid); + uuid_copy(free->di_uuid, + mp->m_sb.sb_meta_uuid); xfs_dinode_calc_crc(mp, free); } else if (tp) { /* just log the inode core */ diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index c9bde7ee..c492d892 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -340,7 +340,7 @@ xfs_inode_to_disk( to->di_ino = cpu_to_be64(ip->i_ino); to->di_lsn = cpu_to_be64(lsn); memset(to->di_pad2, 0, sizeof(to->di_pad2)); - uuid_copy(&to->di_uuid, &ip->i_mount->m_sb.sb_meta_uuid); + uuid_copy(to->di_uuid, ip->i_mount->m_sb.sb_meta_uuid); to->di_flushiter = 0; } else { to->di_version = 2; diff --git a/libxfs/xfs_sb.c b/libxfs/xfs_sb.c index 8037b369..cab092af 100644 --- a/libxfs/xfs_sb.c +++ b/libxfs/xfs_sb.c @@ -513,9 +513,9 @@ __xfs_sb_from_disk( * feature flag is set; if not set we keep it only in memory. */ if (xfs_sb_version_hasmetauuid(to)) - uuid_copy(&to->sb_meta_uuid, &from->sb_meta_uuid); + uuid_copy(to->sb_meta_uuid, from->sb_meta_uuid); else - uuid_copy(&to->sb_meta_uuid, &from->sb_uuid); + uuid_copy(to->sb_meta_uuid, from->sb_uuid); /* Convert on-disk flags to in-memory flags? */ if (convert_xquota) xfs_sb_quota_from_disk(to); @@ -658,7 +658,7 @@ xfs_sb_to_disk( to->sb_spino_align = cpu_to_be32(from->sb_spino_align); to->sb_lsn = cpu_to_be64(from->sb_lsn); if (xfs_sb_version_hasmetauuid(from)) - uuid_copy(&to->sb_meta_uuid, &from->sb_meta_uuid); + uuid_copy(to->sb_meta_uuid, from->sb_meta_uuid); } } diff --git a/libxfs/xfs_symlink_remote.c b/libxfs/xfs_symlink_remote.c index 8eb3d59f..0e1f3596 100644 --- a/libxfs/xfs_symlink_remote.c +++ b/libxfs/xfs_symlink_remote.c @@ -46,7 +46,7 @@ xfs_symlink_hdr_set( dsl->sl_magic = cpu_to_be32(XFS_SYMLINK_MAGIC); dsl->sl_offset = cpu_to_be32(offset); dsl->sl_bytes = cpu_to_be32(size); - uuid_copy(&dsl->sl_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(dsl->sl_uuid, mp->m_sb.sb_meta_uuid); dsl->sl_owner = cpu_to_be64(ino); dsl->sl_blkno = cpu_to_be64(bp->b_bn); bp->b_ops = &xfs_symlink_buf_ops; diff --git a/libxlog/util.c b/libxlog/util.c index b4dfeca0..84c6f99a 100644 --- a/libxlog/util.c +++ b/libxlog/util.c @@ -79,8 +79,8 @@ header_check_uuid(xfs_mount_t *mp, xlog_rec_header_t *head) if (!uuid_compare(mp->m_sb.sb_uuid, head->h_fs_uuid)) return 0; - platform_uuid_unparse(&mp->m_sb.sb_uuid, uu_sb); - platform_uuid_unparse(&head->h_fs_uuid, uu_log); + uuid_unparse(mp->m_sb.sb_uuid, uu_sb); + uuid_unparse(head->h_fs_uuid, uu_log); printf(_("* ERROR: mismatched uuid in log\n" "* SB : %s\n* log: %s\n"), @@ -130,7 +130,7 @@ xlog_header_check_recover(xfs_mount_t *mp, xlog_rec_header_t *head) int xlog_header_check_mount(xfs_mount_t *mp, xlog_rec_header_t *head) { - if (platform_uuid_is_null(&head->h_fs_uuid)) return 0; + if (uuid_is_null(head->h_fs_uuid)) return 0; if (header_check_uuid(mp, head)) { /* bail out now or just carry on regardless */ if (print_exit) diff --git a/logprint/log_misc.c b/logprint/log_misc.c index afcd2cee..c593c828 100644 --- a/logprint/log_misc.c +++ b/logprint/log_misc.c @@ -1082,7 +1082,7 @@ xlog_print_rec_head(xlog_rec_header_t *head, int *len, int bad_hdr_warn) printf("\n"); } - platform_uuid_unparse(&head->h_fs_uuid, uub); + uuid_unparse(head->h_fs_uuid, uub); printf(_("uuid: %s format: "), uub); switch (be32_to_cpu(head->h_fmt)) { case XLOG_FMT_UNKNOWN: diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index f84a42f9..c6929a83 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1656,7 +1656,7 @@ meta_opts_parser( case M_UUID: if (!value || *value == '\0') reqval('m', opts->subopts, subopt); - if (platform_uuid_parse(value, &cli->uuid)) + if (uuid_parse(value, cli->uuid)) illegal(value, "m uuid"); break; case M_RMAPBT: @@ -2191,8 +2191,8 @@ _("cowextsize not supported without reflink support\n")); * Copy features across to config structure now. */ cfg->sb_feat = cli->sb_feat; - if (!platform_uuid_is_null(&cli->uuid)) - platform_uuid_copy(&cfg->uuid, &cli->uuid); + if (!uuid_is_null(cli->uuid)) + uuid_copy(cfg->uuid, cli->uuid); } static void @@ -3452,9 +3452,9 @@ finish_superblock_setup( sbp->sb_dblocks = cfg->dblocks; sbp->sb_rextents = cfg->rtextents; - platform_uuid_copy(&sbp->sb_uuid, &cfg->uuid); + uuid_copy(sbp->sb_uuid, cfg->uuid); /* Only in memory; libxfs expects this as if read from disk */ - platform_uuid_copy(&sbp->sb_meta_uuid, &cfg->uuid); + uuid_copy(sbp->sb_meta_uuid, cfg->uuid); sbp->sb_logstart = cfg->logstart; sbp->sb_rootino = sbp->sb_rbmino = sbp->sb_rsumino = NULLFSINO; sbp->sb_agcount = (xfs_agnumber_t)cfg->agcount; @@ -3859,7 +3859,7 @@ main( struct list_head buffer_list; int error; - platform_uuid_generate(&cli.uuid); + uuid_generate(cli.uuid); progname = basename(argv[0]); setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); diff --git a/repair/agheader.c b/repair/agheader.c index 1c4138e4..7e596a66 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -104,12 +104,12 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i) char uu[64]; retval = XR_AG_AGF; - platform_uuid_unparse(&agf->agf_uuid, uu); + uuid_unparse(agf->agf_uuid, uu); do_warn(_("bad uuid %s for agf %d\n"), uu, i); if (!no_modify) - platform_uuid_copy(&agf->agf_uuid, - &mp->m_sb.sb_meta_uuid); + uuid_copy(agf->agf_uuid, + mp->m_sb.sb_meta_uuid); } return retval; } @@ -183,12 +183,12 @@ verify_set_agi(xfs_mount_t *mp, xfs_agi_t *agi, xfs_agnumber_t agno) char uu[64]; retval = XR_AG_AGI; - platform_uuid_unparse(&agi->agi_uuid, uu); + uuid_unparse(agi->agi_uuid, uu); do_warn(_("bad uuid %s for agi %d\n"), uu, agno); if (!no_modify) - platform_uuid_copy(&agi->agi_uuid, - &mp->m_sb.sb_meta_uuid); + uuid_copy(agi->agi_uuid, + mp->m_sb.sb_meta_uuid); } return retval; diff --git a/repair/dinode.c b/repair/dinode.c index a6156830..3206dd80 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -121,7 +121,7 @@ clear_dinode_core(struct xfs_mount *mp, xfs_dinode_t *dinoc, xfs_ino_t ino_num) if (dinoc->di_version < 3) return; dinoc->di_ino = cpu_to_be64(ino_num); - platform_uuid_copy(&dinoc->di_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(dinoc->di_uuid, mp->m_sb.sb_meta_uuid); return; } diff --git a/repair/phase5.c b/repair/phase5.c index fcdf757c..c98267a1 100644 --- a/repair/phase5.c +++ b/repair/phase5.c @@ -163,7 +163,7 @@ build_agi( agi->agi_unlinked[i] = cpu_to_be32(NULLAGINO); if (xfs_sb_version_hascrc(&mp->m_sb)) - platform_uuid_copy(&agi->agi_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agi->agi_uuid, mp->m_sb.sb_meta_uuid); if (xfs_sb_version_hasfinobt(&mp->m_sb)) { agi->agi_free_root = @@ -312,7 +312,7 @@ build_agf_agfl( #endif if (xfs_sb_version_hascrc(&mp->m_sb)) - platform_uuid_copy(&agf->agf_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agf->agf_uuid, mp->m_sb.sb_meta_uuid); /* initialise the AGFL, then fill it if there are blocks left over. */ error = -libxfs_buf_get(mp->m_dev, @@ -330,7 +330,7 @@ build_agf_agfl( if (xfs_sb_version_hascrc(&mp->m_sb)) { agfl->agfl_magicnum = cpu_to_be32(XFS_AGFL_MAGIC); agfl->agfl_seqno = cpu_to_be32(agno); - platform_uuid_copy(&agfl->agfl_uuid, &mp->m_sb.sb_meta_uuid); + uuid_copy(agfl->agfl_uuid, mp->m_sb.sb_meta_uuid); for (agfl_idx = 0; agfl_idx < libxfs_agfl_size(mp); agfl_idx++) freelist[agfl_idx] = cpu_to_be32(NULLAGBLOCK); } From patchwork Mon Aug 2 21:50:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414835 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F140C432BE for ; Mon, 2 Aug 2021 21:50:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8814060F4B for ; Mon, 2 Aug 2021 21:50:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbhHBVuq (ORCPT ); Mon, 2 Aug 2021 17:50:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52981 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231907AbhHBVuo (ORCPT ); Mon, 2 Aug 2021 17:50:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941034; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hc+KluJ9un4gGnyqaniSuiMDPtAucnkLocPBe/mqzx0=; b=Lw1TlUVZdaNDVPkrUnkr6h0rb/N9/8cu5rBuLyrCYwhs3XOkhcqc35n1t7S82i6yzoK/fZ +Ex5KmnorP4L6WzgAZocIvBxFG2y+5UoW8SiY0q6lteguIxXq1XAKNnsnfe4Nj+nH11V7P LjauksptkJUz4QK1lIqaKeO1qiGlSpQ= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-71yKJcIfN1a5ejshMO7NnA-1; Mon, 02 Aug 2021 17:50:33 -0400 X-MC-Unique: 71yKJcIfN1a5ejshMO7NnA-1 Received: by mail-wr1-f70.google.com with SMTP id l14-20020a5d560e0000b029013e2b4ee624so6926648wrv.1 for ; Mon, 02 Aug 2021 14:50:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Hc+KluJ9un4gGnyqaniSuiMDPtAucnkLocPBe/mqzx0=; b=dtv6pzHKqGa7BaNXdbRjHyUSfAOXGmiftyLlvk1uItkzQhDfPC5D9f0uOwIqU8vPWR qL4lQ+33F/0xmjlzlASywzuo7XB4G5wpZnPdXUO/ocxOpaUf8XpWJ5vnY9HfECDJsCv7 FLXdg9XgEHoMLfVHVMU+wsPV8Vt082GwsUEwqHX3EWJ6Awaa1FOPk36j2uQeIYwQ4q+6 UIlYQ345gBsekESgpa5uKofvhI6ZA8LCh2O6cDVhU5yswAj8nTpXZL4wespxc3peJXxs sO7EE5+xjOs2KleN1+4YPT/Ch6DzozsDXDR7Y/VhOLdOLX9ioFgeA4n9muZg1Vf3plnF 04zg== X-Gm-Message-State: AOAM532Yt67Vl2wSdi7dfMi3NMPSglcGe9KaOt5CMFjU9qYpfN3niFtT wG0J0wGtOZLE7k3XoXEMIYMXFqckQe4wQM5Ggi9mMi95mjTRI9UAjvvsD2/G/U+tE3nrSQqmXMY aCVY6QklAsXDeG7KSQalsDc5DzCpwgmYRWQtR/5Pf8vSsuTQozVue/hmY9mkReSnh9L1Y6iw= X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr19893376wrx.110.1627941031883; Mon, 02 Aug 2021 14:50:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO+HUUmMnHtt1aF2F+VsLTqFRTr9VZr+P7paNN4c9NmqkTcE7nTHKcnBT4FvGMDUR4ZcKm2Q== X-Received: by 2002:a05:6000:10c6:: with SMTP id b6mr19893351wrx.110.1627941031351; Mon, 02 Aug 2021 14:50:31 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:31 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 7/8] xfsprogs: Remove platform_ prefixes in libfrog/common.h Date: Mon, 2 Aug 2021 23:50:23 +0200 Message-Id: <20210802215024.949616-8-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- copy/xfs_copy.c | 8 ++++---- fsr/xfs_fsr.c | 6 +++--- include/defs.h.in | 2 +- include/linux.h | 16 ++++++++-------- libfrog/common.h | 24 ++++++++++++------------ libfrog/linux.c | 28 ++++++++++++++-------------- libfrog/topology.c | 6 +++--- libxfs/init.c | 32 ++++++++++++++++---------------- libxfs/libxfs_io.h | 2 +- libxfs/rdwr.c | 4 ++-- mdrestore/xfs_mdrestore.c | 4 ++-- mkfs/xfs_mkfs.c | 10 +++++----- repair/phase4.c | 6 +++--- repair/prefetch.c | 2 +- repair/slab.c | 2 +- repair/xfs_repair.c | 6 +++--- scrub/disk.c | 2 +- 17 files changed, 80 insertions(+), 80 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index f06a1557..d5561ac8 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -17,7 +17,7 @@ #define rounddown(x, y) (((x)/(y))*(y)) #define uuid_equal(s,d) (uuid_compare((*s),(*d)) == 0) -extern int platform_check_ismounted(char *, char *, struct stat *, int); +extern int check_ismounted(char *, char *, struct stat *, int); static char *logfile_name; static FILE *logerr; @@ -140,7 +140,7 @@ check_errors(void) for (i = 0; i < num_targets; i++) { if (target[i].state != INACTIVE) { - if (platform_flush_device(target[i].fd, 0)) { + if (flush_device(target[i].fd, 0)) { target[i].error = errno; target[i].state = INACTIVE; target[i].err_type = 2; @@ -698,7 +698,7 @@ main(int argc, char **argv) * check to make sure a filesystem isn't mounted * on the device */ - if (platform_check_ismounted(source_name, NULL, &statbuf, 0)) { + if (check_ismounted(source_name, NULL, &statbuf, 0)) { do_log( _("%s: Warning -- a filesystem is mounted on the source device.\n"), progname); @@ -842,7 +842,7 @@ main(int argc, char **argv) * check to make sure a filesystem isn't mounted * on the device */ - if (platform_check_ismounted(target[i].name, + if (check_ismounted(target[i].name, NULL, &statbuf, 0)) { do_log(_("%s: a filesystem is mounted " "on target device \"%s\".\n" diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 25eb2e12..42f477e8 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -314,12 +314,12 @@ initallfs(char *mtab) mi = 0; fs = fsbase; - if (platform_mntent_open(&cursor, mtab) != 0){ + if (mntent_open(&cursor, mtab) != 0){ fprintf(stderr, "Error: can't get mntent entries.\n"); exit(1); } - while ((mnt = platform_mntent_next(&cursor)) != NULL) { + while ((mnt = mntent_next(&cursor)) != NULL) { int rw = 0; if (strcmp(mnt->mnt_type, MNTTYPE_XFS ) != 0 || @@ -369,7 +369,7 @@ initallfs(char *mtab) mi++; fs++; } - platform_mntent_close(&cursor); + mntent_close(&cursor); numfs = mi; fsend = (fsbase + numfs); diff --git a/include/defs.h.in b/include/defs.h.in index ce0c1a0e..fcf27331 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -78,7 +78,7 @@ typedef unsigned short umode_t; # define ASSERT(EX) ((void) 0) #endif -extern int platform_nproc(void); +extern int libfrog_nproc(void); #define NSEC_PER_SEC (1000000000ULL) #define NSEC_PER_USEC (1000ULL) diff --git a/include/linux.h b/include/linux.h index a12ccee1..da74ae53 100644 --- a/include/linux.h +++ b/include/linux.h @@ -41,7 +41,7 @@ static __inline__ int xfsctl(const char *path, int fd, int cmd, void *p) } /* - * platform_test_xfs_*() implies that xfsctl will succeed on the file; + * test_xfs_*() implies that xfsctl will succeed on the file; * on Linux, at least, special files don't get xfs file ops, * so return 0 for those */ @@ -85,7 +85,7 @@ static __inline__ void getoptreset(void) #endif static __inline__ int -platform_discard_blocks(int fd, uint64_t start, uint64_t len) +discard_blocks(int fd, uint64_t start, uint64_t len) { uint64_t range[2] = { start, len }; @@ -111,7 +111,7 @@ struct mntent_cursor { FILE *mtabp; }; -static inline int platform_mntent_open(struct mntent_cursor * cursor, char *mtab) +static inline int mntent_open(struct mntent_cursor * cursor, char *mtab) { cursor->mtabp = setmntent(mtab, "r"); if (!cursor->mtabp) { @@ -121,19 +121,19 @@ static inline int platform_mntent_open(struct mntent_cursor * cursor, char *mtab return 0; } -static inline struct mntent * platform_mntent_next(struct mntent_cursor * cursor) +static inline struct mntent * mntent_next(struct mntent_cursor * cursor) { return getmntent(cursor->mtabp); } -static inline void platform_mntent_close(struct mntent_cursor * cursor) +static inline void mntent_close(struct mntent_cursor * cursor) { endmntent(cursor->mtabp); } #if defined(FALLOC_FL_ZERO_RANGE) static inline int -platform_zero_range( +zero_range( int fd, xfs_off_t start, size_t len) @@ -146,7 +146,7 @@ platform_zero_range( return -errno; } #else -#define platform_zero_range(fd, s, l) (-EOPNOTSUPP) +#define zero_range(fd, s, l) (-EOPNOTSUPP) #endif /* @@ -154,7 +154,7 @@ platform_zero_range( * atexit handlers. */ static inline void -platform_crash(void) +crash(void) { kill(getpid(), SIGKILL); assert(0); diff --git a/libfrog/common.h b/libfrog/common.h index 0aef318a..4d1d5861 100644 --- a/libfrog/common.h +++ b/libfrog/common.h @@ -7,20 +7,20 @@ #ifndef __LIBFROG_PLATFORM_H__ #define __LIBFROG_PLATFORM_H__ -int platform_check_ismounted(char *path, char *block, struct stat *sptr, +int check_ismounted(char *path, char *block, struct stat *sptr, int verbose); -int platform_check_iswritable(char *path, char *block, struct stat *sptr); -int platform_set_blocksize(int fd, char *path, dev_t device, int bsz, +int check_iswritable(char *path, char *block, struct stat *sptr); +int set_blocksize(int fd, char *path, dev_t device, int bsz, int fatal); -int platform_flush_device(int fd, dev_t device); -char *platform_findrawpath(char *path); -char *platform_findblockpath(char *path); -int platform_direct_blockdev(void); -int platform_align_blockdev(void); -unsigned long platform_physmem(void); /* in kilobytes */ -void platform_findsizes(char *path, int fd, long long *sz, int *bsz); -int platform_nproc(void); +int flush_device(int fd, dev_t device); +char *findrawpath(char *path); +char *findblockpath(char *path); +int direct_blockdev(void); +int align_blockdev(void); +unsigned long physmem(void); /* in kilobytes */ +void findsizes(char *path, int fd, long long *sz, int *bsz); +int libfrog_nproc(void); -void platform_findsizes(char *path, int fd, long long *sz, int *bsz); +void findsizes(char *path, int fd, long long *sz, int *bsz); #endif /* __LIBFROG_PLATFORM_H__ */ diff --git a/libfrog/linux.c b/libfrog/linux.c index ea69b29b..7f4e2a0d 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -40,7 +40,7 @@ static int max_block_alignment; #define CHECK_MOUNT_WRITABLE 0x2 static int -platform_check_mount(char *name, char *block, struct stat *s, int flags) +check_mount(char *name, char *block, struct stat *s, int flags) { FILE *f; struct stat st, mst; @@ -108,26 +108,26 @@ _("%s: %s contains a mounted filesystem\n"), } int -platform_check_ismounted(char *name, char *block, struct stat *s, int verbose) +check_ismounted(char *name, char *block, struct stat *s, int verbose) { int flags; flags = verbose ? CHECK_MOUNT_VERBOSE : 0; - return platform_check_mount(name, block, s, flags); + return check_mount(name, block, s, flags); } int -platform_check_iswritable(char *name, char *block, struct stat *s) +check_iswritable(char *name, char *block, struct stat *s) { int flags; /* Writable checks are always verbose */ flags = CHECK_MOUNT_WRITABLE | CHECK_MOUNT_VERBOSE; - return platform_check_mount(name, block, s, flags); + return check_mount(name, block, s, flags); } int -platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal) +set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal) { int error = 0; @@ -147,7 +147,7 @@ platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fata * success or -1 (with errno set) for failure. */ int -platform_flush_device( +flush_device( int fd, dev_t device) { @@ -172,7 +172,7 @@ platform_flush_device( } void -platform_findsizes(char *path, int fd, long long *sz, int *bsz) +findsizes(char *path, int fd, long long *sz, int *bsz) { struct stat st; uint64_t size; @@ -232,25 +232,25 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz) } char * -platform_findrawpath(char *path) +findrawpath(char *path) { return path; } char * -platform_findblockpath(char *path) +findblockpath(char *path) { return path; } int -platform_direct_blockdev(void) +direct_blockdev(void) { return 1; } int -platform_align_blockdev(void) +align_blockdev(void) { if (!max_block_alignment) return getpagesize(); @@ -259,7 +259,7 @@ platform_align_blockdev(void) /* How many CPUs are online? */ int -platform_nproc(void) +libfrog_nproc(void) { long nproc = sysconf(_SC_NPROCESSORS_ONLN); @@ -271,7 +271,7 @@ platform_nproc(void) } unsigned long -platform_physmem(void) +physmem(void) { struct sysinfo si; diff --git a/libfrog/topology.c b/libfrog/topology.c index b059829e..d6e3aa32 100644 --- a/libfrog/topology.c +++ b/libfrog/topology.c @@ -117,7 +117,7 @@ check_overwrite( fd = open(device, O_RDONLY); if (fd < 0) goto out; - platform_findsizes((char *)device, fd, &size, &bsz); + findsizes((char *)device, fd, &size, &bsz); close(fd); /* nothing to overwrite on a 0-length device */ @@ -296,7 +296,7 @@ void get_topology( char *dfile = xi->volname ? xi->volname : xi->dname; /* - * If our target is a regular file, use platform_findsizes + * If our target is a regular file, use findsizes * to try to obtain the underlying filesystem's requirements * for direct IO; we'll set our sector size to that if possible. */ @@ -312,7 +312,7 @@ void get_topology( fd = open(dfile, flags, 0666); if (fd >= 0) { - platform_findsizes(dfile, fd, &dummy, &ft->lsectorsize); + findsizes(dfile, fd, &dummy, &ft->lsectorsize); close(fd); ft->psectorsize = ft->lsectorsize; } else diff --git a/libxfs/init.c b/libxfs/init.c index d1e87002..120714c9 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -59,9 +59,9 @@ check_isactive(char *name, char *block, int fatal) return 0; if ((st.st_mode & S_IFMT) != S_IFBLK) return 0; - if (platform_check_ismounted(name, block, &st, 0) == 0) + if (check_ismounted(name, block, &st, 0) == 0) return 0; - if (platform_check_iswritable(name, block, &st)) + if (check_iswritable(name, block, &st)) return fatal ? 1 : 0; return 0; } @@ -98,7 +98,7 @@ libxfs_device_open(char *path, int creat, int xflags, int setblksize) readonly = (xflags & LIBXFS_ISREADONLY); excl = (xflags & LIBXFS_EXCLUSIVELY) && !creat; - dio = (xflags & LIBXFS_DIRECT) && !creat && platform_direct_blockdev(); + dio = (xflags & LIBXFS_DIRECT) && !creat && direct_blockdev(); retry: flags = (readonly ? O_RDONLY : O_RDWR) | \ @@ -123,10 +123,10 @@ retry: if (!readonly && setblksize && (statb.st_mode & S_IFMT) == S_IFBLK) { if (setblksize == 1) /* use the default blocksize */ - (void)platform_set_blocksize(fd, path, statb.st_rdev, XFS_MIN_SECTORSIZE, 0); + (void)set_blocksize(fd, path, statb.st_rdev, XFS_MIN_SECTORSIZE, 0); else { /* given an explicit blocksize to use */ - if (platform_set_blocksize(fd, path, statb.st_rdev, setblksize, 1)) + if (set_blocksize(fd, path, statb.st_rdev, setblksize, 1)) exit(1); } } @@ -171,7 +171,7 @@ libxfs_device_close(dev_t dev) fd = dev_map[d].fd; dev_map[d].dev = dev_map[d].fd = 0; - ret = platform_flush_device(fd, dev); + ret = flush_device(fd, dev); if (ret) { ret = -errno; fprintf(stderr, @@ -200,19 +200,19 @@ check_open(char *path, int flags, char **rawfile, char **blockfile) perror(path); return 0; } - if (!(*rawfile = platform_findrawpath(path))) { + if (!(*rawfile = findrawpath(path))) { fprintf(stderr, _("%s: " "can't find a character device matching %s\n"), progname, path); return 0; } - if (!(*blockfile = platform_findblockpath(path))) { + if (!(*blockfile = findblockpath(path))) { fprintf(stderr, _("%s: " "can't find a block device matching %s\n"), progname, path); return 0; } - if (!readonly && !inactive && platform_check_ismounted(path, *blockfile, NULL, 1)) + if (!readonly && !inactive && check_ismounted(path, *blockfile, NULL, 1)) return 0; if (inactive && check_isactive(path, *blockfile, ((readonly|dangerously)?1:0))) @@ -324,7 +324,7 @@ libxfs_init(libxfs_init_t *a) a->ddev= libxfs_device_open(dname, a->dcreat, flags, a->setblksize); a->dfd = libxfs_device_to_fd(a->ddev); - platform_findsizes(dname, a->dfd, &a->dsize, + findsizes(dname, a->dfd, &a->dsize, &a->dbsize); } else { if (!check_open(dname, flags, &rawfile, &blockfile)) @@ -332,7 +332,7 @@ libxfs_init(libxfs_init_t *a) a->ddev = libxfs_device_open(rawfile, a->dcreat, flags, a->setblksize); a->dfd = libxfs_device_to_fd(a->ddev); - platform_findsizes(rawfile, a->dfd, + findsizes(rawfile, a->dfd, &a->dsize, &a->dbsize); } } else @@ -342,7 +342,7 @@ libxfs_init(libxfs_init_t *a) a->logdev = libxfs_device_open(logname, a->lcreat, flags, a->setblksize); a->logfd = libxfs_device_to_fd(a->logdev); - platform_findsizes(dname, a->logfd, &a->logBBsize, + findsizes(dname, a->logfd, &a->logBBsize, &a->lbsize); } else { if (!check_open(logname, flags, &rawfile, &blockfile)) @@ -350,7 +350,7 @@ libxfs_init(libxfs_init_t *a) a->logdev = libxfs_device_open(rawfile, a->lcreat, flags, a->setblksize); a->logfd = libxfs_device_to_fd(a->logdev); - platform_findsizes(rawfile, a->logfd, + findsizes(rawfile, a->logfd, &a->logBBsize, &a->lbsize); } } else @@ -360,7 +360,7 @@ libxfs_init(libxfs_init_t *a) a->rtdev = libxfs_device_open(rtname, a->rcreat, flags, a->setblksize); a->rtfd = libxfs_device_to_fd(a->rtdev); - platform_findsizes(dname, a->rtfd, &a->rtsize, + findsizes(dname, a->rtfd, &a->rtsize, &a->rtbsize); } else { if (!check_open(rtname, flags, &rawfile, &blockfile)) @@ -368,7 +368,7 @@ libxfs_init(libxfs_init_t *a) a->rtdev = libxfs_device_open(rawfile, a->rcreat, flags, a->setblksize); a->rtfd = libxfs_device_to_fd(a->rtdev); - platform_findsizes(rawfile, a->rtfd, + findsizes(rawfile, a->rtfd, &a->rtsize, &a->rtbsize); } } else @@ -1030,7 +1030,7 @@ libxfs_destroy( int libxfs_device_alignment(void) { - return platform_align_blockdev(); + return align_blockdev(); } void diff --git a/libxfs/libxfs_io.h b/libxfs/libxfs_io.h index 3cc4f4ee..a81bd659 100644 --- a/libxfs/libxfs_io.h +++ b/libxfs/libxfs_io.h @@ -46,7 +46,7 @@ xfs_buftarg_trip_write( pthread_mutex_lock(&btp->lock); btp->writes_left--; if (!btp->writes_left) - platform_crash(); + crash(); pthread_mutex_unlock(&btp->lock); } diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index f8e4cf0a..85094fe6 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -73,7 +73,7 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len) /* try to use special zeroing methods, fall back to writes if needed */ len_bytes = LIBXFS_BBTOOFF64(len); - error = platform_zero_range(fd, start_offset, len_bytes); + error = zero_range(fd, start_offset, len_bytes); if (!error) { xfs_buftarg_trip_write(btp); return 0; @@ -1143,7 +1143,7 @@ libxfs_blkdev_issue_flush( return 0; fd = libxfs_device_to_fd(btp->bt_bdev); - ret = platform_flush_device(fd, btp->bt_bdev); + ret = flush_device(fd, btp->bt_bdev); return ret ? -errno : 0; } diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c index 1cd399db..4a894f3b 100644 --- a/mdrestore/xfs_mdrestore.c +++ b/mdrestore/xfs_mdrestore.c @@ -182,7 +182,7 @@ usage(void) exit(1); } -extern int platform_check_ismounted(char *, char *, struct stat *, int); +extern int check_ismounted(char *, char *, struct stat *, int); int main( @@ -275,7 +275,7 @@ main( /* * check to make sure a filesystem isn't mounted on the device */ - if (platform_check_ismounted(argv[optind], NULL, &statbuf, 0)) + if (check_ismounted(argv[optind], NULL, &statbuf, 0)) fatal("a filesystem is mounted on target device \"%s\"," " cannot restore to a mounted filesystem.\n", argv[optind]); diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index c6929a83..ffa79b86 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -1263,7 +1263,7 @@ done: } static void -discard_blocks(dev_t dev, uint64_t nsectors, int quiet) +mkfs_discard_blocks(dev_t dev, uint64_t nsectors, int quiet) { int fd; uint64_t offset = 0; @@ -1286,7 +1286,7 @@ discard_blocks(dev_t dev, uint64_t nsectors, int quiet) * not necessary for the mkfs functionality but just an * optimization. However we should stop on error. */ - if (platform_discard_blocks(fd, offset, tmp_step) == 0) { + if (discard_blocks(fd, offset, tmp_step) == 0) { if (offset == 0 && !quiet) { printf("Discarding blocks..."); fflush(stdout); @@ -2664,11 +2664,11 @@ discard_devices( */ if (!xi->disfile) - discard_blocks(xi->ddev, xi->dsize, quiet); + mkfs_discard_blocks(xi->ddev, xi->dsize, quiet); if (xi->rtdev && !xi->risfile) - discard_blocks(xi->rtdev, xi->rtsize, quiet); + mkfs_discard_blocks(xi->rtdev, xi->rtsize, quiet); if (xi->logdev && xi->logdev != xi->ddev && !xi->lisfile) - discard_blocks(xi->logdev, xi->logBBsize, quiet); + mkfs_discard_blocks(xi->logdev, xi->logBBsize, quiet); } static void diff --git a/repair/phase4.c b/repair/phase4.c index 191b4842..1d509187 100644 --- a/repair/phase4.c +++ b/repair/phase4.c @@ -235,7 +235,7 @@ process_rmap_data( if (!rmap_needs_work(mp)) return; - create_work_queue(&wq, mp, platform_nproc()); + create_work_queue(&wq, mp, libfrog_nproc()); for (i = 0; i < mp->m_sb.sb_agcount; i++) queue_work(&wq, check_rmap_btrees, i, NULL); destroy_work_queue(&wq); @@ -243,12 +243,12 @@ process_rmap_data( if (!xfs_sb_version_hasreflink(&mp->m_sb)) return; - create_work_queue(&wq, mp, platform_nproc()); + create_work_queue(&wq, mp, libfrog_nproc()); for (i = 0; i < mp->m_sb.sb_agcount; i++) queue_work(&wq, compute_ag_refcounts, i, NULL); destroy_work_queue(&wq); - create_work_queue(&wq, mp, platform_nproc()); + create_work_queue(&wq, mp, libfrog_nproc()); for (i = 0; i < mp->m_sb.sb_agcount; i++) { queue_work(&wq, process_inode_reflink_flags, i, NULL); queue_work(&wq, check_refcount_btrees, i, NULL); diff --git a/repair/prefetch.c b/repair/prefetch.c index 48affa18..57d5e631 100644 --- a/repair/prefetch.c +++ b/repair/prefetch.c @@ -1024,7 +1024,7 @@ do_inode_prefetch( */ if (check_cache && !libxfs_bcache_overflowed()) { queue.wq_ctx = mp; - create_work_queue(&queue, mp, platform_nproc()); + create_work_queue(&queue, mp, libfrog_nproc()); for (i = 0; i < mp->m_sb.sb_agcount; i++) queue_work(&queue, func, i, NULL); destroy_work_queue(&queue); diff --git a/repair/slab.c b/repair/slab.c index 165f97ef..996f9d80 100644 --- a/repair/slab.c +++ b/repair/slab.c @@ -234,7 +234,7 @@ qsort_slab( return; } - create_work_queue(&wq, NULL, platform_nproc()); + create_work_queue(&wq, NULL, libfrog_nproc()); hdr = slab->s_first; while (hdr) { qs = malloc(sizeof(struct qsort_slab)); diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index af24b356..a112b424 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -882,7 +882,7 @@ phase_end(int phase) /* Fail if someone injected an post-phase error. */ if (fail_after_phase && phase == fail_after_phase) - platform_crash(); + crash(); } int @@ -1030,7 +1030,7 @@ main(int argc, char **argv) } if (ag_stride) { - int max_threads = platform_nproc() * 8; + int max_threads = libfrog_nproc() * 8; thread_count = (glob_agcount + ag_stride - 1) / ag_stride; while (thread_count > max_threads) { @@ -1081,7 +1081,7 @@ main(int argc, char **argv) (mp->m_sb.sb_dblocks >> (10 + 1)) + 50000; /* rough estimate of 50MB overhead */ max_mem = max_mem_specified ? max_mem_specified * 1024 : - platform_physmem() * 3 / 4; + physmem() * 3 / 4; if (getrlimit(RLIMIT_AS, &rlim) != -1 && rlim.rlim_cur != RLIM_INFINITY) { diff --git a/scrub/disk.c b/scrub/disk.c index 8bd2a36d..f6d37b46 100644 --- a/scrub/disk.c +++ b/scrub/disk.c @@ -43,7 +43,7 @@ __disk_heads( { int iomin; int ioopt; - int nproc = platform_nproc(); + int nproc = libfrog_nproc(); unsigned short rot; int error; From patchwork Mon Aug 2 21:50:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12414837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 556CAC4320A for ; Mon, 2 Aug 2021 21:50:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3817860F9C for ; Mon, 2 Aug 2021 21:50:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232492AbhHBVur (ORCPT ); Mon, 2 Aug 2021 17:50:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:25663 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232594AbhHBVuq (ORCPT ); Mon, 2 Aug 2021 17:50:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627941035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSS03Pexje6FSdThX41wuYMaqIUHq2Ovi+iOTi7HTXw=; b=NNcet3GeY0j5iK+8BQ33Wc1w0RRfrkRU52ZvHyv7LaOVMiVz/OLGo13BDPcJjxcS+IfRUm Mu20aLCv8clkYLF8a9itMKVP/kYFBGPFoo2gtDlajKQ7RVFFaulnVY0n8Yd9/w3FuqIw1a jfI2h1Z6Pp0iExFhPTtU2jYhY6GPdKw= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56-0-oR6JV7PQ2NNpfA107raQ-1; Mon, 02 Aug 2021 17:50:33 -0400 X-MC-Unique: 0-oR6JV7PQ2NNpfA107raQ-1 Received: by mail-wr1-f72.google.com with SMTP id s22-20020adf97960000b02901535eae4100so6914044wrb.14 for ; Mon, 02 Aug 2021 14:50:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kSS03Pexje6FSdThX41wuYMaqIUHq2Ovi+iOTi7HTXw=; b=QGojKUzr0tYUxPmwxYFABunk+g2FaEW9ygItoHkC+0yDcbpGF2geGJ+Wn3+MYPsIlL 4ahOa3NpiXtCfiKEkg/kOU28VRVMScNLBf1aJZyRvCHX48Td2o6qSY/Ow3bUbQoRnoRG OuF5+j+rSs1lb2CN9mpaER2joG4iDX2aYoJh1tw59TfONDMqn9FnjCjZMivTYwHRFLQ1 tVabxNlc2nkVH/wrklLRksPSk8cSH4tvh26T8yn8oSN92lUhNcX1f9SsqAXCFPIkvw+j TU2ginOxVS1jTJoBsX5wA26IUK3fm0MLmEjHfApPSrDAplL+6kiYkQWXXJViZzlrjucH firA== X-Gm-Message-State: AOAM531BkgtUsCxjIL+rHOy6iqEKXt+c6Xy0jxYTdZBPZ/Rm2rj43eso nGQUPXC6EXiyh3ZPQu3G2QvvejWhtVrSdQ+uOUqZkWxvL5yKAbsG7+gM+akDhWvG3WNCx1r6dL0 fjFtSn7wc8ouptBDyMVOaoj2TFdtmKwXB+xasErBWja1mn3pW0taFjXfS77Lpl9nm01mfCFk= X-Received: by 2002:adf:eccc:: with SMTP id s12mr19345314wro.331.1627941032330; Mon, 02 Aug 2021 14:50:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/ngAhcAOlM4HhdNbrUEvAPqw5lz+cWGWxxWol56Jrxse03IVfuF14zMb2gMlxSy6LaNxFuw== X-Received: by 2002:adf:eccc:: with SMTP id s12mr19345302wro.331.1627941032133; Mon, 02 Aug 2021 14:50:32 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id u11sm12838418wrt.89.2021.08.02.14.50.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Aug 2021 14:50:31 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH 8/8] xfsprogs: remove platform_ from man xfsctl man page Date: Mon, 2 Aug 2021 23:50:24 +0200 Message-Id: <20210802215024.949616-9-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210802215024.949616-1-preichl@redhat.com> References: <20210802215024.949616-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- man/man3/xfsctl.3 | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/man/man3/xfsctl.3 b/man/man3/xfsctl.3 index 43c2f4eb..dc260bae 100644 --- a/man/man3/xfsctl.3 +++ b/man/man3/xfsctl.3 @@ -6,9 +6,9 @@ xfsctl \- control XFS filesystems and individual files .HP .BI "int\ xfsctl(const char *" path ", int " fd ", int " cmd ", void *" ptr ); .PP -.BI "int platform_test_xfs_fd(int " fd ); +.BI "int test_xfs_fd(int " fd ); .br -.BI "int platform_test_xfs_path(const char *" path ); +.BI "int test_xfs_path(const char *" path ); .SH DESCRIPTION Some functionality specific to the XFS filesystem is accessible to applications through platform-specific system call interfaces. @@ -24,11 +24,6 @@ and .BR fstatfs (2) system calls can be used to determine whether or not an arbitrary path or file descriptor belong to an XFS filesystem. -These are not portable however, so the routines -.BR platform_test_xfs_fd () -and -.BR platform_test_xfs_path () -provide a platform-independent mechanism. .SS File Operations In order to effect an operation on an individual file, the pathname and descriptor arguments passed to