From patchwork Fri Aug 6 21:22:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423871 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 7DCE7C4320A for ; Fri, 6 Aug 2021 21:23:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6104960E78 for ; Fri, 6 Aug 2021 21:23:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232048AbhHFVXl (ORCPT ); Fri, 6 Aug 2021 17:23:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49604 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239689AbhHFVXl (ORCPT ); Fri, 6 Aug 2021 17:23:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285004; 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=GrSKFhdhNfcWWR+6qo9Dyv+AZX5XL7h1JGUiG8mbJe4=; b=XWx6+feLJmDWEEmH5Y9KlePIUJmgpvwmcLRIP7EqIw2lK7HRTsC486hfcQm1J+qZj47I+C VaU07BRGMuOuBYAJXl8oUQcLPESMqHmwgs8LlZ1HvZ5lDYa1He63m/A+g28IlBM+yedx5x W/fkyeYH/b5pXRlqICrBpmWpj0Lep7U= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-491-CBtgNbrEPZWn6YkdOD3x_Q-1; Fri, 06 Aug 2021 17:23:23 -0400 X-MC-Unique: CBtgNbrEPZWn6YkdOD3x_Q-1 Received: by mail-ed1-f69.google.com with SMTP id dn10-20020a05640222eab02903bd023ea9f6so5554850edb.14 for ; Fri, 06 Aug 2021 14:23:23 -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=GrSKFhdhNfcWWR+6qo9Dyv+AZX5XL7h1JGUiG8mbJe4=; b=iy8CJXnASWPL+x2iR1H0KUnKt955xwTx5+XOUWYgvp5+ALrFhfVkgSZxmAHxZi5o0x daD1EOipnnOlyLmkolVCsnIDcOucUfeF6ZHdN4lpZnC/LKCZC9Wyi7jt6NheKvDCX9fD ilc+RjGo1+1oBU7al6PvaQg5VMJOtPC9dAtnGlssnJhuPHeivhSEoOlxynmqz7PbxVw9 nomUVfRgxxOzfgMCCLxa1y6qbecPhQZAbn6n5cOPgDq1nriVOTpCmKLYBRQenwMDfQM4 96OTpX2/aF4Bwh6yGl7odpWb4jrtkoS0/h6dl5LbRBYmQZLmtiWKSZ6haWDMieYlkr6j Al3w== X-Gm-Message-State: AOAM5311upsyLysMiA6q9FJx3oTk4nJfmLkQoJB7qltQsQqa6MHhqn4x pcg+yed1kWLHZJIbbHPaU+8EB7Q+i27nqp1RIywchGXYWOJXZkN0Jfh98fa1QkHiMKnV39ZOAe3 42/AP6ouTbaUSFva7Jum7wQf/ZOWYWQGb166i6mvkUE+TDUj6+FDX3+O3PjFPz0SMO3jmkMM= X-Received: by 2002:a05:6402:1202:: with SMTP id c2mr15314625edw.216.1628285002556; Fri, 06 Aug 2021 14:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCZUW6VM8IKaCrjkjNR/55M9jBSPs2iMKPruNsZkPN23ZSTNGIzq8eEhhmjoGbH5hFMaB24w== X-Received: by 2002:a05:6402:1202:: with SMTP id c2mr15314616edw.216.1628285002379; Fri, 06 Aug 2021 14:23:22 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:21 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 01/29] xfsprogs: Stop using platform_uuid_compare() Date: Fri, 6 Aug 2021 23:22:50 +0200 Message-Id: <20210806212318.440144-2-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org platform_uuid_compare() only calls uuid_compare() thus in should be replaced by uuid_compare() deprecated and removed in the future. --- copy/xfs_copy.c | 2 +- db/sb.c | 2 +- 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 ++-- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index fc7d225f..841ab7e4 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -15,7 +15,7 @@ #include "libfrog/platform.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/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index e37d5933..782bb006 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 Fri Aug 6 21:22:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423873 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 45186C4338F for ; Fri, 6 Aug 2021 21:23:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2B54260EE8 for ; Fri, 6 Aug 2021 21:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239842AbhHFVXn (ORCPT ); Fri, 6 Aug 2021 17:23:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41611 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239689AbhHFVXn (ORCPT ); Fri, 6 Aug 2021 17:23:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285006; 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=LAwmK9sacBckibMLg2B6+/VZERYsEOUwhX4zIrBnx5o=; b=L8FOZXNEp9togIzzbPe567FHMXrB9d7dmd4kkUBMcxJCXaDrzXQnOXye5zra+OxfIo+nQU 0/uezevzc1BEwNEhddDWy1959iliHNDRAW6zRwWn0893DB9WYP+uhkA135YXOSbfKQD05K KzhhrW7LvsQU8KQcZVMTPWLkGDh9WIE= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-234-sg6zSQz1PuKI95YWlJcdQw-1; Fri, 06 Aug 2021 17:23:25 -0400 X-MC-Unique: sg6zSQz1PuKI95YWlJcdQw-1 Received: by mail-ed1-f72.google.com with SMTP id a23-20020a50ff170000b02903b85a16b672so5601158edu.1 for ; Fri, 06 Aug 2021 14:23:25 -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=LAwmK9sacBckibMLg2B6+/VZERYsEOUwhX4zIrBnx5o=; b=ZwfV/JQe+pGjTVdpC1gW0PiTAqHdHVT0kxuMsLCY71Zp4eXLUQiIx8T39kfGXepaHy qAOlw/1lLd6baIYwqf9SV7Ps1q883JAAR6VcAjkwpBAXGT40jQh/hY97B3TmCagAWUsd YqcSTbzMM3jqxZSlMBpA0IMdGuoYlXuvRBYo0Q1NluRCqyCj8Oz4929RJbhGgVKkcPX4 B2UgRDZyUEHsvP36H5qyUcl3Q80/Fcog8kPDVfCtpLiTL5uqj9lY3JGYpS6/p2l1SDD0 eNF3bvsiVolbZqTjDd2pc8CIiEzSnK8+aele/bRq+Nsy7T5Oe825gvCyF1tsrc0Lk0k4 gHoQ== X-Gm-Message-State: AOAM530u8v18+Km6a2Lcx7DmoDtC6gfsxSEPbvc/GC1g8oFRrc4cVHKd Vv1QNaRWeIjk1JGIsIo6C46819mLUubyAH9nVGSUBOfQboHDS0FsfdpPPwg49zudBxeTyQVY8pj XwZA4rXOI4kddVj2hOnx6bbKe5PIdJ4NT9pqF4h06WWNeq4zIFiIiUT1ivVyfVD7cwvxN344= X-Received: by 2002:aa7:dbc3:: with SMTP id v3mr15564490edt.63.1628285004542; Fri, 06 Aug 2021 14:23:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxukS5egR9oWssvNImUG3hAg2Tp24LGh7idKa0/UjKyQhqeYQZuE9V7Mkf/qYtr6KwQ0Doltg== X-Received: by 2002:aa7:dbc3:: with SMTP id v3mr15564477edt.63.1628285004350; Fri, 06 Aug 2021 14:23:24 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:22 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 02/29] xfsprogs: Stop using platform_test_xfs_fd() Date: Fri, 6 Aug 2021 23:22:51 +0200 Message-Id: <20210806212318.440144-3-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-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 ++-- growfs/xfs_growfs.c | 2 +- include/linux.h | 7 ++++++- io/init.c | 2 +- io/open.c | 4 ++-- spaceman/init.c | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 841ab7e4..a7cbae02 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/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 a22f7812..f48ec823 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,6 +60,11 @@ static __inline__ int platform_test_xfs_fd(int fd) return (statfsbuf.f_type == 0x58465342); /* XFSB */ } +static __inline__ int platform_test_xfs_fd(int fd) +{ + return test_xfs_fd(fd); +} + static __inline__ int platform_test_xfs_path(const char *path) { struct statfs statfsbuf; diff --git a/io/init.c b/io/init.c index 033ed67d..bd31b474 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/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 Fri Aug 6 21:22:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423875 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 E16F7C432BE for ; Fri, 6 Aug 2021 21:23:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA10960E78 for ; Fri, 6 Aug 2021 21:23:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239849AbhHFVXp (ORCPT ); Fri, 6 Aug 2021 17:23:45 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44588 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239689AbhHFVXo (ORCPT ); Fri, 6 Aug 2021 17:23:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285008; 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=jDKGORGKtQ5lYuHgHmZzT24rU5ww73fVbS/QDzYrmM4=; b=YZs9eIcxkiyFBqGct3AD6D9KbV2J8MTOSTbdsIs9jsk0x3Eb9/N0gKjFvnMkeofz2xcUMc d65eYIXjjSmLAEcFZTEzXkMEfaobosurJKigtOj+KA9LlDw+SRo2Ew5RMv6RteY6c1wMH5 Zu5qaQdHn7Uk9VqqbiW/f3D2gDd8BF4= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-2VP4-O00OA68SBvSij0QdQ-1; Fri, 06 Aug 2021 17:23:27 -0400 X-MC-Unique: 2VP4-O00OA68SBvSij0QdQ-1 Received: by mail-ed1-f69.google.com with SMTP id s8-20020a0564025208b02903bd8539e1caso5566802edd.22 for ; Fri, 06 Aug 2021 14:23:26 -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=jDKGORGKtQ5lYuHgHmZzT24rU5ww73fVbS/QDzYrmM4=; b=D5rDJ+R6XjGRUKg7+5xQdypyMoixUeNjPL3VUS0roRm+Oz/PmOxTPL+fV/H5niOIYp QjDAgSUXxPDPeGMQVPWXQZqYMhLkX8I6wjzHGZxdCEIuWexedn8FUar1B8zJEKrCrKcQ 3r11pw3M5IJJtrbIw9w/PumqI8OQV5a3nfqJN174THTn5BXrg0wu8glkejJ16zet5PZy 9gDeaPoOTBPck++VTqxPPO+pPHOgCJ8OtWkvN/ULOEjT9ooCAjzjW/T02+V9TfRhzO1c 6/2bS45p7YhGFAzrEEcXO22wQMckIXfDwue4fVXgwnFGBk+nq24V5agVxgMxU0+rHa/l skOA== X-Gm-Message-State: AOAM532/KYZkxnoRZE3wggyooy9sChGv7OLOLXAsAZSzYC4BSOqnOdnn QXWu4dEw8k74PXdVSKq7ir+QJXCa8k6cWNG0QyKLZhHaobB8WaR5QbH1s2Phk3YD0cUpd7rFBw5 Vf/EWscWG9MpMLifh+fU054BokfwZcfn3FJxgNd0MPIir7eClaxGZin0Tg3MMx6fyvPXR/+w= X-Received: by 2002:a17:906:1ccf:: with SMTP id i15mr11793365ejh.120.1628285005806; Fri, 06 Aug 2021 14:23:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMjx9NaJfyA3Q5y0kaM8ekpuORlNRfskU6pA/AoMBczgugRIGMnODDXukBxS/ZQVbAk0YyUg== X-Received: by 2002:a17:906:1ccf:: with SMTP id i15mr11793354ejh.120.1628285005602; Fri, 06 Aug 2021 14:23:25 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:25 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 03/29] xfsprogs: Stop using platform_test_xfs_path() Date: Fri, 6 Aug 2021 23:22:52 +0200 Message-Id: <20210806212318.440144-4-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- fsr/xfs_fsr.c | 2 +- include/linux.h | 7 ++++++- libfrog/paths.c | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) 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/include/linux.h b/include/linux.h index f48ec823..1617174c 100644 --- a/include/linux.h +++ b/include/linux.h @@ -65,7 +65,7 @@ static __inline__ int platform_test_xfs_fd(int fd) return test_xfs_fd(fd); } -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; @@ -79,6 +79,11 @@ static __inline__ int platform_test_xfs_path(const char *path) return (statfsbuf.f_type == 0x58465342); /* XFSB */ } +static __inline__ int platform_test_xfs_path(const char *path) +{ + return test_xfs_path(path); +} + static __inline__ int platform_fstatfs(int fd, struct statfs *buf) { return fstatfs(fd, buf); 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; /* From patchwork Fri Aug 6 21:22:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423877 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 D4908C4338F for ; Fri, 6 Aug 2021 21:23:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B680F60E78 for ; Fri, 6 Aug 2021 21:23:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239851AbhHFVXq (ORCPT ); Fri, 6 Aug 2021 17:23:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28102 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239689AbhHFVXp (ORCPT ); Fri, 6 Aug 2021 17:23:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285009; 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=Sp2MRH5qGYhAbse9qqf1+j5ost/R+AcSAjRw+N+nEcw=; b=G7k64RXrJwMwheoIvn6MmOgaLjAXqm5tg/u9pFxAlr9nbNeQlVQh/inbYPURhoD5+hbKo7 h9jCc3cMPBhaoRxqMu0fZ/6pxRRBkuB0QvFjSGXObKPNz6jjrnQUrr7DE8HVagSegKSTrA jPRyYpoF3au3bUtickCN2l9a3QfFT00= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-38-sfi-Qr_nOzuH8YZ6_hRWHA-1; Fri, 06 Aug 2021 17:23:28 -0400 X-MC-Unique: sfi-Qr_nOzuH8YZ6_hRWHA-1 Received: by mail-ej1-f70.google.com with SMTP id zp23-20020a17090684f7b02905a13980d522so3526734ejb.2 for ; Fri, 06 Aug 2021 14:23: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=Sp2MRH5qGYhAbse9qqf1+j5ost/R+AcSAjRw+N+nEcw=; b=fhZIBXAwO9jjyXVTQORm+Mg9HPO2gWnWKWBuXy2X/hZF7SuJwB/1WhDpWskUzGCKSb k3xmCRZ8UAx49Ic0H4odYxaEST1QBWewzABWMCLbt6F5LitQaisRO6mPyg4sxHwenNEH CwYbUFdZlQnOOu1HZoFX9amXerozIzjXmQR+FZtJk9NSFF8PL83LKSG3m3camkrWKnZc TsXIyVbx/ypIDLK9s+N93ackB3ifUnbC1k2FVAQkpmJBojRFPWKWHlV9+oirHDWofUwJ ISJr3/y9UG5yFxG4WQKBvYRj7DLEgIAQ7oxDehwIW2k+SDDPK/nXlaSImq38e09j4C/e mAkA== X-Gm-Message-State: AOAM530D8d/N7i2094FARBaJxXLdUa4aeQCtiTr8LeKHyTXsXdcUzOwf xR61JqffR6Kl2r6/QKu/C3LqBdNwashP7qZLFvSa1iYreJdLIR9e0gsyLHV+Dlfn2ooT0eFr1Pd CDzTWEx30nHvzGYspWLHIGNQBthStZi6ktsuv6Yw1+1UdqkTJ7iOghTw1TnV27zthRMqCxWA= X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr15547355eds.166.1628285006893; Fri, 06 Aug 2021 14:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0yo5VNQ6xnT5c/kLaqQK/hBtuVp/NC9WEkOWA8EDgfAuwQ06bT+7BzJ/7Pu57NwMZWExt1Q== X-Received: by 2002:aa7:c7c2:: with SMTP id o2mr15547343eds.166.1628285006715; Fri, 06 Aug 2021 14:23:26 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:26 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 04/29] xfsprogs: Stop using platform_fstatfs() Date: Fri, 6 Aug 2021 23:22:53 +0200 Message-Id: <20210806212318.440144-5-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- io/stat.c | 2 +- quota/free.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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; From patchwork Fri Aug 6 21:22:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423879 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 00686C4338F for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAF4E60EE8 for ; Fri, 6 Aug 2021 21:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239969AbhHFVXx (ORCPT ); Fri, 6 Aug 2021 17:23:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:26030 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239689AbhHFVXr (ORCPT ); Fri, 6 Aug 2021 17:23:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285010; 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=l1Pv7woJZa7hFoLGgDvTspaRzjzWtC20VdtR5OgpKqI=; b=TIgOvcNwqNHDnmtBs6CSCvqUd9aUXR5VIr16dtMS7tJMP1wK4SH87J/sZyl3p9XAOpL2EJ NJp7df1F+NscreX0u8UTcnt78MqRtaVXWNcwayoTDLH7FvBmryXu1Yec951toePb2bTL7l hc7Svu4qqFg7sLMQ43WAZDlCGfFbCug= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-576-UKdQ0tXHO4G3rjeMx2omSA-1; Fri, 06 Aug 2021 17:23:29 -0400 X-MC-Unique: UKdQ0tXHO4G3rjeMx2omSA-1 Received: by mail-ej1-f71.google.com with SMTP id a17-20020a1709062b11b02905882d7951afso3524409ejg.4 for ; Fri, 06 Aug 2021 14:23: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=l1Pv7woJZa7hFoLGgDvTspaRzjzWtC20VdtR5OgpKqI=; b=QTDMgI58AKAs79oRSGnDK2rV7+9Rd1jB4WOcR+lq09Vb5eNwYhLACP9uAkafPUlsp8 rwi8R3vUSuLly6+O5EyRoaShNA+Zfr8jbq1plow52o+oloLbH28bgNX/MPk+YyxyMQTA hvIfvqnKRXpXJlX16re8qODFmhDTcBeRGTzQOyr2OYQd3erzaiD2arX3brn/sqUJAaGH GuIisq+wM+DwtWdQ8Ul9paJGmIvzxnNceWK4QfU2QSj09wkR9d/UNQF5lBBFr/HKvKrJ JEKkOn7H2MQnDijbNz1DTM44SOFO9WfaoG7QXYJ1NK/jk0aHicv0h+4NVYisYp0bh8x7 yQoQ== X-Gm-Message-State: AOAM532ODuuvQPw5L0/B8UgWF1pNvzwx5wNNlGw1R5dlaEFS6THddy3j wYcUtnCHoIN4ieroMMsG7ez+kQAonONGNCXG9HsFESe5efMlwzfGV/axU0YJSmwitqCeoq2psju hDCQAn0NeOZjq8sVYqBxOG6AXEfOUSyObhSR3kP4EKkPl1+GMb/HLnp9rvQz+mKo2TP6tndw= X-Received: by 2002:a17:906:2c45:: with SMTP id f5mr11364419ejh.464.1628285008302; Fri, 06 Aug 2021 14:23:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLPV1CakMJbkQr6g657bOY/3gru8lMNF6EVDzJH8RhigoCaW1jBaGY5T9RZMJs1OA286bIzg== X-Received: by 2002:a17:906:2c45:: with SMTP id f5mr11364407ejh.464.1628285008147; Fri, 06 Aug 2021 14:23:28 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:27 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 05/29] xfsprogs: Stop using platform_getoptreset() Date: Fri, 6 Aug 2021 23:22:54 +0200 Message-Id: <20210806212318.440144-6-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-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 | 7 ++++++- libxcmd/command.c | 2 +- 3 files changed, 8 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 1617174c..ae32f0e0 100644 --- a/include/linux.h +++ b/include/linux.h @@ -89,12 +89,17 @@ static __inline__ int platform_fstatfs(int fd, struct statfs *buf) return fstatfs(fd, buf); } -static __inline__ void platform_getoptreset(void) +static __inline__ void getoptreset(void) { extern int optind; optind = 0; } +static __inline__ void platform_getoptreset(void) +{ + platform_getoptreset(); +} + static __inline__ int platform_uuid_compare(uuid_t *uu1, uuid_t *uu2) { return uuid_compare(*uu1, *uu2); diff --git a/libxcmd/command.c b/libxcmd/command.c index a76d1515..3fa3d6e6 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 Fri Aug 6 21:22:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423881 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 4B9C6C4320A for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2ECFE611C5 for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239689AbhHFVXx (ORCPT ); Fri, 6 Aug 2021 17:23:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42455 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239864AbhHFVXu (ORCPT ); Fri, 6 Aug 2021 17:23:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285012; 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=2ivoHi3gr1mOJlfI7FCUjafE/bV7R234d2NTAWy4CEg=; b=VHSVw5QbbamwYwMHCYFTNU/A1ZpxH34azczDE9T+ThcUTTjtKLDFo5tgGd5yfl4gPrCey0 Bpj6hlwisrb6NUZLeNRu5RGKUFpi5/iTRgje5g0Q0BrG3Z1tzwpEpAI/iAvdeyEgHRZLk4 8a1wjvUE23LIsxugwU5xMTJwIOAprfU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-1WAKcadNPEGNP_oMYnJSow-1; Fri, 06 Aug 2021 17:23:31 -0400 X-MC-Unique: 1WAKcadNPEGNP_oMYnJSow-1 Received: by mail-ej1-f69.google.com with SMTP id ju25-20020a17090798b9b029058c24b55273so3557803ejc.8 for ; Fri, 06 Aug 2021 14:23:31 -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=2ivoHi3gr1mOJlfI7FCUjafE/bV7R234d2NTAWy4CEg=; b=RDqjWgENy06PTqh7vRIDPpf/M+5F47FCRlY1PRV2b0WXxbefuK7fqlbUAcOgZoYKuP N81K1eUwT9V0wPKzXvfgg+U2ij1XOxV4NTl1E+61hj+kMnz64cr0VzxDzRtQ2L1uR4y1 vQxQxOSOdDAwGRCwM5qjr5ORLGSOjIkEpCdMK003gxC7A7Q62UTE0eh/D8kdrB0FWOVI 1QakjdLXXQVMZKnRGTqGo78oEFJ+UzjxnZvvxy/UetQZ1o0s61S5tGp0VIlimBvoqjgp w/CTg241nvC2+XQbxloz9bsoLuguPi93re7auKl3QQSRToeMK5L7VuF5Vrf527aTbx0c gN6g== X-Gm-Message-State: AOAM533A5VAd1ECh3zYtQXswj8v9IQ0547b1CQgWjZQopFEDGRYOzfuv UgjafNFqtczSlwjrcU1UWjDT4rZicGGzcG9g9SUdIGongOnscNyHtK5PRYohFCHaFfbCju2zgHa 9c9T5L6QOSWtfkkdh9JbdGGnDc9BoItqMmPwAhuyUXnopZEXCiOoCV/o3/VlAcEz3MdKlJro= X-Received: by 2002:a05:6402:289b:: with SMTP id eg27mr15883893edb.90.1628285009618; Fri, 06 Aug 2021 14:23:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeJIiR6X2kYjSxO/VoM0nsE7LuG70OzQk5qwzAZa0eh+BhpFQ9kvjwH1+EnxdK5mJQ070rDA== X-Received: by 2002:a05:6402:289b:: with SMTP id eg27mr15883870edb.90.1628285009315; Fri, 06 Aug 2021 14:23:29 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:28 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 06/29] xfsprogs: Stop using platform_uuid_copy() Date: Fri, 6 Aug 2021 23:22:55 +0200 Message-Id: <20210806212318.440144-7-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-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 ++++---- 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 +- mkfs/xfs_mkfs.c | 6 +++--- repair/agheader.c | 8 ++++---- repair/dinode.c | 2 +- repair/phase5.c | 6 +++--- 20 files changed, 35 insertions(+), 36 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index a7cbae02..1f57399a 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)) @@ -948,7 +948,7 @@ main(int argc, char **argv) if (!duplicate) platform_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/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h index 782bb006..d4fd7bcd 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/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index f84a42f9..c4e3e054 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -2192,7 +2192,7 @@ _("cowextsize not supported without reflink support\n")); */ cfg->sb_feat = cli->sb_feat; if (!platform_uuid_is_null(&cli->uuid)) - platform_uuid_copy(&cfg->uuid, &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; diff --git a/repair/agheader.c b/repair/agheader.c index 1c4138e4..b13b7323 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -108,8 +108,8 @@ verify_set_agf(xfs_mount_t *mp, xfs_agf_t *agf, xfs_agnumber_t i) 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; } @@ -187,8 +187,8 @@ verify_set_agi(xfs_mount_t *mp, xfs_agi_t *agi, xfs_agnumber_t agno) 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 Fri Aug 6 21:22:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423887 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 93BA2C432BE for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7813860E78 for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239864AbhHFVXy (ORCPT ); Fri, 6 Aug 2021 17:23:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34698 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239884AbhHFVXu (ORCPT ); Fri, 6 Aug 2021 17:23:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285012; 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=ycdEAcjYD7TREmMlSkOnxVpezsUxM4WrBcwKIA80d2Y=; b=FAmJh+4LWyR7yz9mwqjtfSQfM1pfNBSMc3CLVAUMfnjCU+6HG5UnQJyzPERxn9gDH0t5n3 SdILbwAz345QOKZjxgxDVntjBHDE9nrZ53RN77MgxssRlDfARruFKsenOExy18+dIILGyU tB0CjpTOsojHwjVKQ/SfON2xpb7FBnY= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-319-5wTgvLEmOsOdbvae7MqVCg-1; Fri, 06 Aug 2021 17:23:31 -0400 X-MC-Unique: 5wTgvLEmOsOdbvae7MqVCg-1 Received: by mail-ej1-f72.google.com with SMTP id zp23-20020a17090684f7b02905a13980d522so3526765ejb.2 for ; Fri, 06 Aug 2021 14:23:31 -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=ycdEAcjYD7TREmMlSkOnxVpezsUxM4WrBcwKIA80d2Y=; b=DJ4WVm5SYMqqMKgCCjD5GPSrQMYglH8KMKRtNzhZyu0FmQnWYX5opBkPyMwNReQfGj hh3QbQI2mE2dfkrCmkLJgztmYpU8m4GjQXWqE7aDUINHeUBi1HwSZoUnJVm9NEHUpI31 CUDytc4RlPKIiGT1ge5HunSzPgDggXH6PkLwBJolTkRCsE2qD1SLYfkPYkOVucQqcUSc sU31m9FPKYHYlq3t2ARUbgoQtQjoQ8hpf2NlPxIpPomAkklhukzN1r0RM3TpwQjbdoq4 BwsmOJqDqjjE2KWgDiO4vD2z01imi64Ed7YwUis8vOm7S4RaBWRzgVv36lfTRBTrJsQy uzvg== X-Gm-Message-State: AOAM531qo5x19Dv3qiqowhRxVPZbWOxv3HfYNPhJNxZdQlIzIvrsK8+n ki72SFI9kEXxGU8KZUQx6UeTbRcqtNDP8I2aTLh3Yf1pLyEn32flI/5bRrl27JjtaZd5th7xHZa X4zSi/qWhkgFgyycB1T5J/5mRyMP6+Rfj1iCNySEOQgkSUajZxE1tQHypQMx0TjVPkCBlMvQ= X-Received: by 2002:a17:906:3b97:: with SMTP id u23mr11794534ejf.437.1628285010363; Fri, 06 Aug 2021 14:23:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYNTC9iFI9WbND7qlQRpzqAiJ+MLhdpDERXNEv2frnhjaC8bQ84HrtSeJWeJZyGhbsu4rjmw== X-Received: by 2002:a17:906:3b97:: with SMTP id u23mr11794527ejf.437.1628285010153; Fri, 06 Aug 2021 14:23:30 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:29 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 07/29] xfsprogs: Stop using platform_uuid_generate() Date: Fri, 6 Aug 2021 23:22:56 +0200 Message-Id: <20210806212318.440144-8-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-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 +- mkfs/xfs_mkfs.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 1f57399a..5f8b5c57 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -946,7 +946,7 @@ 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 uuid_copy(tcarg->uuid, mp->m_sb.sb_uuid); diff --git a/db/sb.c b/db/sb.c index 7017e1e5..b668fc68 100644 --- a/db/sb.c +++ b/db/sb.c @@ -386,7 +386,7 @@ uuid_f( } if (!strcasecmp(argv[1], "generate")) { - platform_uuid_generate(&uu); + uuid_generate(uu); } else if (!strcasecmp(argv[1], "nil")) { platform_uuid_clear(&uu); } else if (!strcasecmp(argv[1], "rewrite")) { diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index c4e3e054..dd7849fd 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -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); From patchwork Fri Aug 6 21:22:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423885 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 EB302C4320E for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFB5660EE8 for ; Fri, 6 Aug 2021 21:23:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239961AbhHFVXy (ORCPT ); Fri, 6 Aug 2021 17:23:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:37642 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239926AbhHFVXu (ORCPT ); Fri, 6 Aug 2021 17:23:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285014; 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=L5JmAK8RMhKNzbrNJ28is0kF+GcJou77diUltXqS3GI=; b=ZZxHxu4LhEtFRGjptdlw/x8fCQx609a75Q1LwKqhF18y+ZmEI+lg4gk/aZkpDDVgHXQM3e LnWqZ0Zrq8aVO+w8riBYDTR9IGqrnjiVn61S5IPHQFfcVZasCl+ZOWeGRSiZggO7tUlLWw ePoVYVxhUmhv6D5SxsSTrUTlOA8Q02A= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-Q-3NAPL4ODyEncFDqEu_wg-1; Fri, 06 Aug 2021 17:23:33 -0400 X-MC-Unique: Q-3NAPL4ODyEncFDqEu_wg-1 Received: by mail-ed1-f71.google.com with SMTP id eg53-20020a05640228b5b02903bd6e6f620cso5595529edb.23 for ; Fri, 06 Aug 2021 14:23: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=L5JmAK8RMhKNzbrNJ28is0kF+GcJou77diUltXqS3GI=; b=J3eVbu47LKhvL2ST90PQ9EdUrVHaDzz5n4JRhnlbmMbrNzvnJpmlpIwIasFMCg0wOF +hj7kfQj6fRpZr6Sm6hSU0x6l82lmvTH85WqnhyJ0h4r+pd4Yh7HZGz9GFRPlKsD77o9 nFLXCSsdAtBJXT7DV6FbWNwGCqyh1uoI6mDJegDMzNcssq0i2t2osEMyg4xbWFLkIz/b ts1J6FsRQwaSqiBX8I1ez/TgO8Phdbi3e5pEt3sATkRNzoMC0I3lXUGdzp9qZ3XY6T6o yg3kRuXHTHPOwnsaCI4VjzmeOYEFcBVM20x826jF0jZT2faMuQMDe1bhQWqnhRLtQVqk j0sg== X-Gm-Message-State: AOAM533hNFgr7MKOHk2B6mr2IvvbE6tj5lK0XuffzqFwZ6hQZUg8ALjz e3LPcaWd+N1KxV8FnneUfYikKN04kXUJTPrL993w8DE0aFV9Na729+KnRdaCjAJZ2JQX8kW2Zvw CTmpG+eq5060YAakQ9HlszlIKgs+NE3uc0yRnIki5JUS/I3opOIgQV2lamNX5N+18dT2kMdY= X-Received: by 2002:aa7:cdcf:: with SMTP id h15mr15531490edw.45.1628285011670; Fri, 06 Aug 2021 14:23:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqe065/+kLq10Zfddn09608rZv0hW2EF0UkhKq6HOQfzEmxALHO9sxGJ+jGiSoMCr9fau0DQ== X-Received: by 2002:aa7:cdcf:: with SMTP id h15mr15531467edw.45.1628285011410; Fri, 06 Aug 2021 14:23:31 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:30 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 08/29] xfsprogs: Stop using platform_uuid_unparse() Date: Fri, 6 Aug 2021 23:22:57 +0200 Message-Id: <20210806212318.440144-9-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- db/fprint.c | 2 +- db/sb.c | 6 +++--- libxlog/util.c | 4 ++-- logprint/log_misc.c | 2 +- repair/agheader.c | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) 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 b668fc68..4e4b1f57 100644 --- a/db/sb.c +++ b/db/sb.c @@ -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; @@ -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/libxlog/util.c b/libxlog/util.c index b4dfeca0..7c10474b 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"), 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/repair/agheader.c b/repair/agheader.c index b13b7323..7e596a66 100644 --- a/repair/agheader.c +++ b/repair/agheader.c @@ -104,7 +104,7 @@ 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) @@ -183,7 +183,7 @@ 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) From patchwork Fri Aug 6 21:22:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423883 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 8AAFFC43214 for ; Fri, 6 Aug 2021 21:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6735560EE8 for ; Fri, 6 Aug 2021 21:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239926AbhHFVXy (ORCPT ); Fri, 6 Aug 2021 17:23:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34880 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239943AbhHFVXv (ORCPT ); Fri, 6 Aug 2021 17:23:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285015; 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=lEM+GRI7Rs8kLuE3nOMhSnagcstfUsJyCQdH2bCX4KI=; b=EJaSEUoUicGh3zxdU+JUVf9wOrNNOPlUepe+zrZRkk6TKGpqiBECUz4kTjS0pAIhPE2kcM 0WJP0W7EZk5vyFyC+YSS8NC5mnVRhWK07k96bsspyA+43QUpufMqTOqWFHBtFmPDtn95MN 08XBD03zsf/VvY5dmk5OyIEavXNya9c= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-195-_KTWlrXVNT-n1o_Y0zsv0w-1; Fri, 06 Aug 2021 17:23:34 -0400 X-MC-Unique: _KTWlrXVNT-n1o_Y0zsv0w-1 Received: by mail-ej1-f71.google.com with SMTP id n9-20020a1709063789b02905854bda39fcso1718451ejc.1 for ; Fri, 06 Aug 2021 14:23:34 -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=lEM+GRI7Rs8kLuE3nOMhSnagcstfUsJyCQdH2bCX4KI=; b=oqHh7xpyN4Csix2hlCS4paurk5YLhW6CD9WftYw+eTlYe7kE8d3TlALccGxXUbxGnw vyPjv4ZfXvOl2WdY4V5kPK+8zVdifnlk/+4V71ZWRLNpVxrXH1IAhK4+gT5/VwKXRDrG RbD2Sh7AbuCCMwwncXkzVsdjhDqrPTSkvAVyyCNUxjN/U/+YauwYazpkmOwX/rIH8P1Z qrY3+wYQG+2E9tDpxH0WwSGJVdLsbIpSDyuwndICAvJnptNHy3jW9JtQ6B563AkdiHYF g2pHkGXRpf0cSUMhNKox5iJ60M4klkKpjzTSaNQyOuLOdu9epjuEJHrPwnxSuqgcOPkc emtw== X-Gm-Message-State: AOAM531yivdFWfhjUJAFGnUX4+DLfEhwlZzGKBg7JWZ0jMKTv9SK/KwM bSOn1HngM7na05az4fuiB/0+rVnXG0SEFcoNn2snOFnyMSu0dSvSF3PvAarMwFoqRrX6g+cNLFO s6zTq5NC+dUhOZG9GiWnutU0e0G2ndIDBJjVOoITFxQ+fK1tJCI4+EezdwWktMHLl++BidbY= X-Received: by 2002:a17:906:aed3:: with SMTP id me19mr11374271ejb.187.1628285013058; Fri, 06 Aug 2021 14:23:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuBCFY4v1TXnupC9XDx5ctNYWZrCyFkHEMQX/0nIYlz6T5XU3z0/kTCdNk2+mpCii/unGmJw== X-Received: by 2002:a17:906:aed3:: with SMTP id me19mr11374263ejb.187.1628285012925; Fri, 06 Aug 2021 14:23:32 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:31 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 09/29] xfsprogs: Stop using platform_uuid_clear() Date: Fri, 6 Aug 2021 23:22:58 +0200 Message-Id: <20210806212318.440144-10-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- db/sb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/sb.c b/db/sb.c index 4e4b1f57..36c7db39 100644 --- a/db/sb.c +++ b/db/sb.c @@ -388,7 +388,7 @@ uuid_f( if (!strcasecmp(argv[1], "generate")) { 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) { From patchwork Fri Aug 6 21:22:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423889 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 EC96BC43216 for ; Fri, 6 Aug 2021 21:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C72A160E78 for ; Fri, 6 Aug 2021 21:23:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240001AbhHFVXz (ORCPT ); Fri, 6 Aug 2021 17:23:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51163 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239972AbhHFVXx (ORCPT ); Fri, 6 Aug 2021 17:23:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285016; 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=cqbp0ZIa5NXSHA2pzyu71VgWdqvhXbdjxzvZc2LLOyk=; b=N68+i8pVLMzABlftW5bcsgnkXntAKp5eNJQ8iN+rF5Hxda5TJRtgbmAF9zd30DNPL7gZo7 +28cVetK93IYSr5OXdctqhnPyXR/mnWLyLD7sRbbaLq1CdY9EuRTpvtHf+Pk7p+KgyUc06 dcPNFb/a9IMqMEUIOmn1p28yoaA9i1c= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-498-OtjGsE98PJGpaibU_Ndgmw-1; Fri, 06 Aug 2021 17:23:35 -0400 X-MC-Unique: OtjGsE98PJGpaibU_Ndgmw-1 Received: by mail-ej1-f71.google.com with SMTP id zp23-20020a17090684f7b02905a13980d522so3526796ejb.2 for ; Fri, 06 Aug 2021 14:23:35 -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=cqbp0ZIa5NXSHA2pzyu71VgWdqvhXbdjxzvZc2LLOyk=; b=FrTR1UG782BomCAIYDbp+LFkxoGPz/MFYmyeRi0fbMaQ6krS0quryzYfIc7VkLiCP1 U0OSFd2Da5XIZcoR049GqIPe9vU7qqzTzgoOJ9XfaXT1478UD6QT/Tg3/acwG0f0Z48r GO1ZCAPuYKEcn8oDES0MFAq2tutq6sPDc+WqNAyr7DqFtefUuVVVCSytDHGocVtosuT5 a33hIfArn0oooRt54UbU/E/qDHk9Vacce6VeyWhA9VydL8fOnT/XPIHsePMSKwGOIhrm fL4IZ8CgKu5k/ctf4YcUsuV7PvO8YsaiiGdiIKq3BpVkGOhRWL7q3nZJ3yafR8CsWn4Z EBGQ== X-Gm-Message-State: AOAM533dtU05KODOweVVqErazsHLZ7L4ww4eLJ+wOIKmLT5lBznnbvf5 DDz2D6ChbhxMQrtRFaLQTkkzKgWOIPvnDBpDianRFLmoC7bmyOGVVYmCIGCbzNp2ohisyBJ05Ig 2Oui3rA/UFOUyOcis4l4iwt7nQWQwtX88YPxSVxnHGnXkh0Ql28aNZ4ImsPLpFXuFlQdh2qA= X-Received: by 2002:a05:6402:220d:: with SMTP id cq13mr15759245edb.318.1628285014238; Fri, 06 Aug 2021 14:23:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGdyG3pvp+L1ylwrD/CugutFA5JsO/P46YEOsty8UGWqZE1yZwEKEfdj7ztL+NoQu3YTVFng== X-Received: by 2002:a05:6402:220d:: with SMTP id cq13mr15759240edb.318.1628285014101; Fri, 06 Aug 2021 14:23:34 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:33 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 10/29] xfsprogs: Stop using platform_uuid_parse() Date: Fri, 6 Aug 2021 23:22:59 +0200 Message-Id: <20210806212318.440144-11-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- db/sb.c | 2 +- mkfs/xfs_mkfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/sb.c b/db/sb.c index 36c7db39..63f43ea4 100644 --- a/db/sb.c +++ b/db/sb.c @@ -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; } diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index dd7849fd..2771a641 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: From patchwork Fri Aug 6 21:23:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423891 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 50151C4338F for ; Fri, 6 Aug 2021 21:23:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E1CF60EE8 for ; Fri, 6 Aug 2021 21:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239972AbhHFVXz (ORCPT ); Fri, 6 Aug 2021 17:23:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56220 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239974AbhHFVXy (ORCPT ); Fri, 6 Aug 2021 17:23:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285018; 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=c+90aBKoFjing+Q2LzT4bHGkCfiXxZm6K2cxe+pfpMk=; b=E2sIQYGm6lorZ/HPvsTdLLu0FleyRPJmaw95nGwYmWcM9Kv5CgwdP/x6G3lFJpyVbVP88S zivfyUizp1VKPknaITdbBQJ2rto1316ffR1GJdsaRWAU1euh/teecB1nUrBeL6hbkV2SG1 5r8ZShzaDqmCe7RMuRnvr7sc6pXK4aY= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-L0YNGjlBPTOOy92ZheAliw-1; Fri, 06 Aug 2021 17:23:37 -0400 X-MC-Unique: L0YNGjlBPTOOy92ZheAliw-1 Received: by mail-ej1-f72.google.com with SMTP id rv22-20020a17090710d6b029058c69e3adbbso3514176ejb.6 for ; Fri, 06 Aug 2021 14:23:36 -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=c+90aBKoFjing+Q2LzT4bHGkCfiXxZm6K2cxe+pfpMk=; b=lmAT0O6Od8qn5/5vhlUEuvVtiD8qc7QwGdsrZ1DfAxLtW+1TtMe6ufGQM2OyS+h+6c uKMX4Le5TcaE1JBCjQwdRaY+o3X8lDXzKELVzRvDw2ujdJSJGfNNEFmS1f8Yi4faXEGo f8BbdU4et5HDFHCJptF5SBdsUiSnAPWA5tOG6lciKL0leEbhF2SqffVMKWbVxmpprX7o oqG8Dsa12DcoPE0KcKCliqSNRpkQywmatah7TF2fFRSNYJttykMeCsuP8K0d28uuoJQd D4NRclgfm5RfzZDtx0jbgPLJnptpFSXJycvn+Hp7RXmT21BICS7M9Jeyb33iKw+OgeJK 0Gew== X-Gm-Message-State: AOAM532D89X7ybgkTetXyhYgfZiL5yp1Rg9sYJdzA9w9zNxugLDiZw+I yX+N7ul6br95zMzA+yQJIflpITBkYj9P6YAUQ2DSR4nMcuM2WWEZXqRnNdeFwlvdGttppJK2COe 6moeOT+SXHmYiyEg0uVOZ1H4w3pkDxzTPtoXLo7wnwuhppxnUk1WKx87DuZaYHwovwCviGj0= X-Received: by 2002:aa7:c542:: with SMTP id s2mr15971429edr.41.1628285015729; Fri, 06 Aug 2021 14:23:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYqiooJuyPwJMbH6rqR08vYwApFkUgfCp0zrT5pl3dt4JOA7OdAfy45fyOsQQumv83K8qsWg== X-Received: by 2002:aa7:c542:: with SMTP id s2mr15971414edr.41.1628285015511; Fri, 06 Aug 2021 14:23:35 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:34 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 11/29] xfsprogs: Stop using platform_uuid_is_null() Date: Fri, 6 Aug 2021 23:23:00 +0200 Message-Id: <20210806212318.440144-12-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libxlog/util.c | 2 +- mkfs/xfs_mkfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libxlog/util.c b/libxlog/util.c index 7c10474b..84c6f99a 100644 --- a/libxlog/util.c +++ b/libxlog/util.c @@ -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/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index 2771a641..c6929a83 100644 --- a/mkfs/xfs_mkfs.c +++ b/mkfs/xfs_mkfs.c @@ -2191,7 +2191,7 @@ _("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)) + if (!uuid_is_null(cli->uuid)) uuid_copy(cfg->uuid, cli->uuid); } From patchwork Fri Aug 6 21:23:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423893 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 D548CC3F6A3 for ; Fri, 6 Aug 2021 21:23:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B47E060EE8 for ; Fri, 6 Aug 2021 21:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239974AbhHFVX4 (ORCPT ); Fri, 6 Aug 2021 17:23:56 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49857 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240131AbhHFVXz (ORCPT ); Fri, 6 Aug 2021 17:23:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285019; 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=gj+Nvb7yWn3UFpYSZkmPbcjY8ebgd6IpQLXA6HhhpQY=; b=JxUZ+cpMa+XECSOJx4dUXW2mEJDta+U5w3wVoOfNZ2ja4CYsuN3sT0eXHGUNpBF5r+2hc6 UTl7Dk1pFMVBO55HhYimhM0MMKQE7PBAVFcII/kE3ZH3YIOHOfsOVhz1jTLhdc5z2OYfQy Yj93GnLtMpI7xCXcnD04mLWRPT/NZaM= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-383-j8VQbahhNKSxMSqWQjArMw-1; Fri, 06 Aug 2021 17:23:38 -0400 X-MC-Unique: j8VQbahhNKSxMSqWQjArMw-1 Received: by mail-ed1-f71.google.com with SMTP id s8-20020a0564025208b02903bd8539e1caso5567019edd.22 for ; Fri, 06 Aug 2021 14:23:37 -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=gj+Nvb7yWn3UFpYSZkmPbcjY8ebgd6IpQLXA6HhhpQY=; b=J9G0K3kJfhil3c1+tQNRUH9Ra5bn4lw2PLPCmI00lP8c/XswdbaqUu/RwF5JM0ckZw 58Sc+tRzUdl7NmyNRIe02xOlCCZQPcfVdtMX8wift9ZqWafJf6BEpwdBcJtlsMNsE9E5 P3lPWIEcXW03yfPzUAK2Ol0Bo00U0DGSAz/TMhl1JLe7XgBVJtBO9aXLzJMTS9hZ30Bp +OUCjhWEUz+Ir5gvLVhMAaec5y4oWvhPFcwOm1bKkpOcEt0RmffEJF5BWybPPSs7z2LO XKP6U4b37Oxr2JXbcPIHTKpxFGYxwV2CazZae5LSCHBWUPTn9lMNMff7L4zcUVieUn9p gdqA== X-Gm-Message-State: AOAM531utu3u1p2mhCHzX9polux8P2ncBpw8IEiLGihOLyBlqLtF8BuD zwgWKp4cWrLJsrR23Sjsctzuna4v58wstrkz+Nkt6yQDH7zi/TqfhlllynlDL7FQemRHQWM6AQz XuRzBmWyN9hryEwOVz/1NXBdQXbbNoMOXV2Q6ZkxQtQ/Mi2K8iVj/vLcdzdbGXy1w8LuUzN0= X-Received: by 2002:a50:d548:: with SMTP id f8mr15882559edj.357.1628285016704; Fri, 06 Aug 2021 14:23:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzaZUmQAgZl+0hyRxtJPJSwYTyga9bijni+PwM1vEjc8Ob0mHa4p2761zyWJsXwY3j7sPAN6g== X-Received: by 2002:a50:d548:: with SMTP id f8mr15882551edj.357.1628285016543; Fri, 06 Aug 2021 14:23:36 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:35 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 12/29] xfsprogs: Stop using platform_check_mount() Date: Fri, 6 Aug 2021 23:23:01 +0200 Message-Id: <20210806212318.440144-13-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index a45d99ab..f7fac2c8 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; @@ -107,13 +107,19 @@ _("%s: %s contains a mounted filesystem\n"), return 1; } +static int +platform_check_mount(char *name, char *block, struct stat *s, int flags) +{ + return check_mount(name, block, s, flags); +} + int platform_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 @@ -123,7 +129,7 @@ platform_check_iswritable(char *name, char *block, struct stat *s) /* 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 From patchwork Fri Aug 6 21:23:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423895 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 5D757C4320A for ; Fri, 6 Aug 2021 21:23:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35CCB60E78 for ; Fri, 6 Aug 2021 21:23:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240131AbhHFVX5 (ORCPT ); Fri, 6 Aug 2021 17:23:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59092 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239884AbhHFVX5 (ORCPT ); Fri, 6 Aug 2021 17:23:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285020; 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=gdZXVpj+kCd9MQa16294BDxZ0QeZQFpgACiyZUzRuNE=; b=asxe9HeNHY1de9APDbVs+4yrHH+RyG7TzOPL7w9/AIV74sAd6xI66rY78r4Qx+80+1pRaJ 9WsQNOkWTIMbjKVup72pCcPhCLr/w9zvvY8cHUFl0Q9SOTuj/AANAGIeJSIB9XWf/Bd8eZ JQN0Ymlg6PTXsrCt+0irV3iIsRYQlbo= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-315-q_VYor1yMQWCwwQA0UWF0A-1; Fri, 06 Aug 2021 17:23:39 -0400 X-MC-Unique: q_VYor1yMQWCwwQA0UWF0A-1 Received: by mail-ej1-f69.google.com with SMTP id a19-20020a1709063e93b0290551ea218ea2so93234ejj.5 for ; Fri, 06 Aug 2021 14:23:39 -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=gdZXVpj+kCd9MQa16294BDxZ0QeZQFpgACiyZUzRuNE=; b=kMFRhzMjwAuRQtbXfhzpdkLAVv7yGRcGa+OhIfjYRT3br+kCTeomH6W8Bfn7XMuCwk 13wLgilLP5nk+g32E4e05T4vfDUl914+MK1IPAot34jWw5YvRl1dE+DdJLkTfIlE/AvA BHbmPSDL+2RrKQfspC8KY6mQEMkaz334823QWFFy0xyGnxSRLTLMXduFpMqZysFaPOoy NEpZr7pWOViq9i07AE6A9ZQt7kXk0ucNcQu3znAa4Ww82/dnAMMZFnc7fWfRixI7e3Zg weLW134wJeiyS2bAHZ8JXkzv6sNq5SAMk3zSThH8jhw9W+7Nf5G/l2tTfVlczBVTQlrF Gi8w== X-Gm-Message-State: AOAM531WV5TbsCwWpykPGN25V3f8clUtZlAvjMWZjxktymf1uPQPyXN6 Ps5SoSJFgp6Q9FwaMZ73o7BY8ujFtdIua4HKb5vc2oo4357YQZeXOkm9N45s0hSXQI/ujyfnZyk sK2JYsNDLHAmu3gS8vrhZ+Td1rzEsqwOTSBda30b88Wg76BZ5pHP+6dOhaME8Cf/S872cg9A= X-Received: by 2002:a05:6402:3507:: with SMTP id b7mr15722036edd.293.1628285017898; Fri, 06 Aug 2021 14:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx436InHQF+rhR6tgd08gi0mDSLJmwGXvp7Q+XIw/8hW1HptFFHqbjX97CjVoqSgQqZ3LmB7w== X-Received: by 2002:a05:6402:3507:: with SMTP id b7mr15722019edd.293.1628285017736; Fri, 06 Aug 2021 14:23:37 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:37 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 13/29] xfsprogs: Stop using platform_check_ismounted() Date: Fri, 6 Aug 2021 23:23:02 +0200 Message-Id: <20210806212318.440144-14-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- copy/xfs_copy.c | 6 +++--- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 4 ++-- mdrestore/xfs_mdrestore.c | 4 ++-- 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 5f8b5c57..f864bc31 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; @@ -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/libfrog/linux.c b/libfrog/linux.c index f7fac2c8..6a933b85 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -114,7 +114,7 @@ platform_check_mount(char *name, char *block, struct stat *s, int flags) } 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; @@ -122,6 +122,12 @@ platform_check_ismounted(char *name, char *block, struct stat *s, int verbose) return check_mount(name, block, s, flags); } +int +platform_check_ismounted(char *name, char *block, struct stat *s, int verbose) +{ + return check_ismounted(name, block, s, verbose); +} + int platform_check_iswritable(char *name, char *block, struct stat *s) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 0aef318a..8a38aa45 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -9,6 +9,7 @@ int platform_check_ismounted(char *path, char *block, struct stat *sptr, int verbose); +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 fatal); diff --git a/libxfs/init.c b/libxfs/init.c index 1ec83791..0d833ab6 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -59,7 +59,7 @@ 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)) return fatal ? 1 : 0; @@ -212,7 +212,7 @@ check_open(char *path, int flags, char **rawfile, char **blockfile) 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))) 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]); From patchwork Fri Aug 6 21:23:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423897 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 58671C4338F for ; Fri, 6 Aug 2021 21:23:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 407CA60EE8 for ; Fri, 6 Aug 2021 21:23:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240154AbhHFVX6 (ORCPT ); Fri, 6 Aug 2021 17:23:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28603 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239884AbhHFVX6 (ORCPT ); Fri, 6 Aug 2021 17:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285021; 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=UOjw3119lCzSE/An947N4FLDVj64tH3egfYV/12xPkk=; b=GupBUoJ+CTLnA8c5S4GavQjIk3bM0Yh3ItYGayYjLtRpIXP8nNm6YGBYg7bs+cQ0e2xvOt NvOBjkKfHSoOLfi3ZYkJBVCe8aT+r8L5LjUbyJGojY7LGbNK4ANED5qnYkAutHzX2Q7Not /+L9XQHHiW4c5VM/KRkKy84IDekb/S8= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-386-gRKh2XHiO-KpUI4sd7KmMg-1; Fri, 06 Aug 2021 17:23:40 -0400 X-MC-Unique: gRKh2XHiO-KpUI4sd7KmMg-1 Received: by mail-ed1-f71.google.com with SMTP id k14-20020a05640212ceb02903bc50d32c17so5623475edx.12 for ; Fri, 06 Aug 2021 14:23:40 -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=UOjw3119lCzSE/An947N4FLDVj64tH3egfYV/12xPkk=; b=tZpMHIZr98/eZZAR8T55JjHfV+1T/pOM+KQEyzImBQr/sINtCmKscin2rZOBQuvyfY 505HFf5lX9JwROpVHQcHtXa/GVBmx9IEjBHwnrZvPGTpq5Kw012fKLG+JVM8+J4cMXDP V0lwVkVOiOZ2YOAckD9U6/TGYwWAwBiRrbzDoO6uu5jJgBPUlP8s1P2hPGE8iXQu0vHM TlBfyLjndSylctw8rCosd3poPBYfsiEUfVftczwEFEMfQZhyvSj1DDbl/nRvmxc3PzWX q/HwMFVoAH9/Ar26G3ErnqIC7IbLu6PPqm35eGcn57u5Q/2GRsNGQl541n9bG01P1uMe yNbQ== X-Gm-Message-State: AOAM533e5/HbB2bS3svKhtg423hpsTT44DSpS4Q7ZUwo0RIcFtfOuWl7 njYI7N3QeMQzUAnyCIV7HOwOJ2FO1Dku3sEQWGh/Ojr2SW2RlEuAJxKalqxd9RsU8kdN4hq9FZM 5j4q998W0jm10evbjzp7z9zxu+GfqeJ1Si0joj2gXldEqs0u9ZCeAvzQhVHHMnOtti9zPWlo= X-Received: by 2002:a17:906:b0c8:: with SMTP id bk8mr11671424ejb.412.1628285019225; Fri, 06 Aug 2021 14:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFeGO876Zrya1qcNK9d6WWevDoIkwDVKk7dsDrRZZshgCbTTMcCmlUy3oRb2S2yzhPYX/Elg== X-Received: by 2002:a17:906:b0c8:: with SMTP id bk8mr11671414ejb.412.1628285019069; Fri, 06 Aug 2021 14:23:39 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:38 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 14/29] xfsprogs: Stop using platform_flush_device() Date: Fri, 6 Aug 2021 23:23:03 +0200 Message-Id: <20210806212318.440144-15-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-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 +- libfrog/linux.c | 10 +++++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- libxfs/rdwr.c | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index f864bc31..4b22e290 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -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; diff --git a/libfrog/linux.c b/libfrog/linux.c index 6a933b85..3e4f2291 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -159,7 +159,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) { @@ -183,6 +183,14 @@ platform_flush_device( return 0; } +int +platform_flush_device( + int fd, + dev_t device) +{ + return flush_device(fd, device); +} + void platform_findsizes(char *path, int fd, long long *sz, int *bsz) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 8a38aa45..1705c1c9 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -14,6 +14,7 @@ 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 fatal); int platform_flush_device(int fd, dev_t device); +int flush_device(int fd, dev_t device); char *platform_findrawpath(char *path); char *platform_findblockpath(char *path); int platform_direct_blockdev(void); diff --git a/libxfs/init.c b/libxfs/init.c index 0d833ab6..784f15e2 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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, diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index fd456d6b..022da518 100644 --- a/libxfs/rdwr.c +++ b/libxfs/rdwr.c @@ -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; } From patchwork Fri Aug 6 21:23:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423899 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 6F87EC432BE for ; Fri, 6 Aug 2021 21:23:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5868B60E78 for ; Fri, 6 Aug 2021 21:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239943AbhHFVX7 (ORCPT ); Fri, 6 Aug 2021 17:23:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:22049 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239884AbhHFVX7 (ORCPT ); Fri, 6 Aug 2021 17:23:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285023; 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=AO5TTOJAm+OwCOWEQSNnKihTdrq6kDBXXwo5DuvgPX4=; b=bfl2+5fLqyltl7UWgcXVIDYbj84sMtBUR3SaZPBzq/hVD1xn4UChANDn18XvJnTamtEm8y CebigkQCYjehWO+DKcvybbxfIZaKDwOl2PXt2dYi98IVZnyxbGAIdpvbl7K56UukxwGvQ/ +v1LHV/j+HhW5nJm7RtVLfuCoL0K0AM= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-486--Dqu-ybAMSCS72mZRhw_Sw-1; Fri, 06 Aug 2021 17:23:41 -0400 X-MC-Unique: -Dqu-ybAMSCS72mZRhw_Sw-1 Received: by mail-ed1-f69.google.com with SMTP id y39-20020a50bb2a0000b02903bc05daccbaso5582239ede.5 for ; Fri, 06 Aug 2021 14:23:41 -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=AO5TTOJAm+OwCOWEQSNnKihTdrq6kDBXXwo5DuvgPX4=; b=h7jbrLesf995H7YdLgTtzH1i+cfXgMTcbXF8NuBMU4qrxwWqUacsHi9ujNIZcTD1hs WYzVDqiqtmK2i0CS6/bZa0xU1Z297fLL6jTlhahxh5G5c05UWZfvYWZu9V5u0XGYcs42 JTHvY+hOcnh7OzBrfzbhUEq+HyYDm74r1+dhJPy08n6dCPN8dKwqsnM/HqSPMPVnWN/h Xywt21T6JduVDQJL/5rNxfiNoc1T2deuy8UByymS93LC0YTKCPNXoeBWG23g//kpde6D nIa5Zx1zJiuc0IBKJPsuC44sihUBlWeJE1CWYbUrwjZELogXpKe+kU82ydx+Gy0GuwzN 1aGw== X-Gm-Message-State: AOAM533Pp9yFSGK1p4K5CVBRVWSIbbW3iER/yB3r+p1rygBkQn06c1Dr PNGVMMInQF10A6dbDqprAtv61MVG0qiVrjc4XaycXvlBkU49g3Ylg49EXR8+jBbVsQMEEH1sVrj fXHTGYnqkgpyuMZ0W5xv8tl7cnsv7jx+0/sI1w8HkUs2Z9kzA1B6a/UwN/d4tZ0/SmWQyXVs= X-Received: by 2002:a17:907:b11:: with SMTP id h17mr11698247ejl.93.1628285020318; Fri, 06 Aug 2021 14:23:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlJdRtlug97WR70k/FjTKtaFMWZ3dJEoqmKsaFpaIoAClYKtX2JvnkupjlRiT/IlT0pygrqA== X-Received: by 2002:a17:907:b11:: with SMTP id h17mr11698238ejl.93.1628285020173; Fri, 06 Aug 2021 14:23:40 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:39 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 15/29] xfsprogs: Stop using platform_mntent_open() Date: Fri, 6 Aug 2021 23:23:04 +0200 Message-Id: <20210806212318.440144-16-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- fsr/xfs_fsr.c | 2 +- include/linux.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 25eb2e12..38afafb1 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -314,7 +314,7 @@ 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); } diff --git a/include/linux.h b/include/linux.h index ae32f0e0..b6249284 100644 --- a/include/linux.h +++ b/include/linux.h @@ -166,7 +166,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) { @@ -176,6 +176,11 @@ static inline int platform_mntent_open(struct mntent_cursor * cursor, char *mtab return 0; } +static inline int platform_mntent_open(struct mntent_cursor * cursor, char *mtab) +{ + return mntent_open(cursor, mtab); +} + static inline struct mntent * platform_mntent_next(struct mntent_cursor * cursor) { return getmntent(cursor->mtabp); From patchwork Fri Aug 6 21:23:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423901 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 17066C4338F for ; Fri, 6 Aug 2021 21:23:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F360B60E78 for ; Fri, 6 Aug 2021 21:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240201AbhHFVYB (ORCPT ); Fri, 6 Aug 2021 17:24:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55007 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239884AbhHFVYB (ORCPT ); Fri, 6 Aug 2021 17:24:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285024; 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=//ZwlA7NdQH/3Qxyf2tK689v94I01ftwTMsaImCV8gs=; b=J1Yfbg5Ytjp0owgew1zC2aNbYYFpLu7u7NdZU8FisGiv/3lJPxEQHCOP7/cRFlQFvRMNgr Eywt9GylI03tZ8r2g+AftXuQX/JAEaagxqr4XMrrhOSWaQSf1TYK1QpSUZcpRk62mwI2gZ sMTuatdxtQWqRA3hk9/aLhH1hWAOuAw= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-252-aeM7YPAoNUGAC-QyHED8Qw-1; Fri, 06 Aug 2021 17:23:43 -0400 X-MC-Unique: aeM7YPAoNUGAC-QyHED8Qw-1 Received: by mail-ej1-f71.google.com with SMTP id r21-20020a1709067055b02904be5f536463so3542859ejj.0 for ; Fri, 06 Aug 2021 14:23:43 -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=//ZwlA7NdQH/3Qxyf2tK689v94I01ftwTMsaImCV8gs=; b=ArpgKLj7bkJpWwMQPIPTjwd9YEqLda8NMPQLJ40ja/p2GIjtO5EAePlDro7Ll4Aa3E Yur06Ddl0CuUJbB2T6ljLbrVz4g+6UIfLK4FehVPZsab3BNnPaR+UkKCYc1XKcHVAWIH Q27KEK+WkKJSQ+i/kGDWJJG+Bhok/hPhcEdxJxYNt0RE42isbcS5z6BUyn+oXI4qj/15 qHoVgY5FZLcG42i0gVPmHoJ+kA0NeC8KnuIifkSEPSfzAH998RH3vhEqkf/IOn5yxgVF dYFoHYAXAgsRQBwIJ3XuYev1Bm8PJHwEa0tQxJ8zbaeEPHIOM2IrwRRVON+x2qMKiBU7 YDAw== X-Gm-Message-State: AOAM532WLUYlSCKqYElEGyYyu+TIN/7swgM4iLtLf6RQ8hAUvPXjTEOu MtG3bOswWuu9hImbWbJztLKIl0q38Ed/Iqt4IiBlh3Jne2aJGhTM4TmNIVPrlBjnek1LJayy46N PJy1It+MW3Xu9enJmxinbav6sKEZyU/UTZIpEJMb/oT/npUp5M/ISSIoYFtvmUr8EB8Bg3Zs= X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr15948145edb.367.1628285022096; Fri, 06 Aug 2021 14:23:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2NEFoHt3r1CcoCF0ZUcYgRC+1cnNicX3dIZU0JC4qXK9rRLRcXfW9ewYhmmHoDEJWfIPq7g== X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr15948134edb.367.1628285021923; Fri, 06 Aug 2021 14:23:41 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:40 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 16/29] xfsprogs: Stop using platform_mntent_next() Date: Fri, 6 Aug 2021 23:23:05 +0200 Message-Id: <20210806212318.440144-17-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- fsr/xfs_fsr.c | 2 +- include/linux.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 38afafb1..825ec395 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -319,7 +319,7 @@ initallfs(char *mtab) 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 || diff --git a/include/linux.h b/include/linux.h index b6249284..07121e2b 100644 --- a/include/linux.h +++ b/include/linux.h @@ -181,11 +181,16 @@ static inline int platform_mntent_open(struct mntent_cursor * cursor, char *mtab return mntent_open(cursor, mtab); } -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 struct mntent * platform_mntent_next(struct mntent_cursor * cursor) +{ + return mntent_next(cursor); +} + static inline void platform_mntent_close(struct mntent_cursor * cursor) { endmntent(cursor->mtabp); From patchwork Fri Aug 6 21:23:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423903 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=-11.7 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, UNWANTED_LANGUAGE_BODY,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 94B67C4338F for ; Fri, 6 Aug 2021 21:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71B0060EE8 for ; Fri, 6 Aug 2021 21:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240243AbhHFVYE (ORCPT ); Fri, 6 Aug 2021 17:24:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48730 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240209AbhHFVYE (ORCPT ); Fri, 6 Aug 2021 17:24:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285028; 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=6B0yb7v6PKgk06U5usz2NFFgSoPgZA0GB5BpYO6ioKU=; b=DoJ0amIm7peyH56O26A1JqjLtCdywEl6MSpkFrnmbGiCjWhKZDoH+sAPwrdMwLNp0vz22D FUDXHoHosReX1FjxO9l45VROhJgDAlMm7esLkJQ2dyMT/1ec15s0E1SMoHfEGiAmxo5iy8 H6RVpBjifI8UqobEONYIktNluLyz0xw= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-284-M3SquknFNXe8_xcbnzxfMw-1; Fri, 06 Aug 2021 17:23:46 -0400 X-MC-Unique: M3SquknFNXe8_xcbnzxfMw-1 Received: by mail-ed1-f72.google.com with SMTP id g3-20020a0564024243b02903be33db5ae6so1422534edb.18 for ; Fri, 06 Aug 2021 14:23:46 -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=6B0yb7v6PKgk06U5usz2NFFgSoPgZA0GB5BpYO6ioKU=; b=ru+w+L3Mr1cjpjtpHVvPuLJYgSMqBO8Y9lXCmcgzX3QT6aZCCxp8/l7Xm0RawkWPs2 8hi9ycAE3JoSiiw1vfwhtsn0zeg1DQZSd13LMllFyIKxwJ97A3jtmly/H7zreFWXffgM AbhDXATg8VqCA+XVHptUU2LMumbjvNIBcycSJDtPjxYJV1xvaPCZpkHXpnGAbwOR7uOD ihnV+25cEDsiN2A56PXmYTKYR0S9+kf+9P/Usrs1tZDyYcqn00JL1vZWtfZkrjHVRdDV zeu2HE4ze6gzGweuCj2gcuui8IyHYu54J4w+Qwbx15akxns0jdobwbrKwlgOUrBJ1hbH ZcVA== X-Gm-Message-State: AOAM531nzLfGbfj1aafD8E3+Ztkn/fMDhq7bROxFBtdZlHC4v2q4mc3j wPR6QwjXgqsddndrD7i7E/4WtRfyTcuRnTy/RvPBo3zVkZEpmGq0UFgs6//2F+j3IVD1mCReuse P2Di36gEE/WvnuXdlJPDMZNgtUsvK/u52U/o4vwWx2/XWpl2mfQC82QcCZxXdgE2uXTiLfwA= X-Received: by 2002:a05:6402:60b:: with SMTP id n11mr16064209edv.235.1628285025084; Fri, 06 Aug 2021 14:23:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRC2O/76SkYg9K4b6lF+KqB5z/9chBiQNBCw6jmYB3fYeGOos6M/FPcjXqD77YmaVP4syy4A== X-Received: by 2002:a05:6402:60b:: with SMTP id n11mr16064196edv.235.1628285024856; Fri, 06 Aug 2021 14:23:44 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:43 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 17/29] xfsprogs: Stop using platform_mntent_close() Date: Fri, 6 Aug 2021 23:23:06 +0200 Message-Id: <20210806212318.440144-18-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- fsr/xfs_fsr.c | 2 +- include/linux.h | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 825ec395..42f477e8 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -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/linux.h b/include/linux.h index 07121e2b..7940fe8c 100644 --- a/include/linux.h +++ b/include/linux.h @@ -191,11 +191,16 @@ static inline struct mntent * platform_mntent_next(struct mntent_cursor * cursor return mntent_next(cursor); } -static inline void platform_mntent_close(struct mntent_cursor * cursor) +static inline void mntent_close(struct mntent_cursor * cursor) { endmntent(cursor->mtabp); } +static inline void platform_mntent_close(struct mntent_cursor * cursor) +{ + return platform_mntent_close(cursor); +} + #if defined(FALLOC_FL_ZERO_RANGE) static inline int platform_zero_range( From patchwork Fri Aug 6 21:23:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423905 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 67263C4338F for ; Fri, 6 Aug 2021 21:23:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C12F60EE8 for ; Fri, 6 Aug 2021 21:23:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239811AbhHFVYG (ORCPT ); Fri, 6 Aug 2021 17:24:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28162 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240279AbhHFVYG (ORCPT ); Fri, 6 Aug 2021 17:24:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285029; 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=Bct8bOHoBon/hoiLR13K/+hChaFT9X0FxGbehSQyWtc=; b=HDuLKRIZje535Q7dKNdu7fqDx+CTxHVwqhAwT8OcTxheRQgYG9kIU7kNJVw/xdvMCdBKSQ vrmfp08o9GoeL4d2L00rkEmX6+8FNiBfm7HD+W5tc2ckzXwAcyuku4KXysUSSYmaVcJbZl POHXS9dR6D2LGrNg26VwlrgbLusX3Rc= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-341-gjuqrqv_Pg2r_6DniGxBmw-1; Fri, 06 Aug 2021 17:23:48 -0400 X-MC-Unique: gjuqrqv_Pg2r_6DniGxBmw-1 Received: by mail-ej1-f70.google.com with SMTP id k21-20020a1709062a55b0290590e181cc34so3535098eje.3 for ; Fri, 06 Aug 2021 14:23:48 -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=Bct8bOHoBon/hoiLR13K/+hChaFT9X0FxGbehSQyWtc=; b=l9E98UFmHmO6jvZYhY72i53jwVc1Q+UH1eeBChnBaKbIc80rBWSZdEoMIn0HbbDqkK ua5MEoi426ZeCYk+DC4mz0Vu8NIIvgvyc4mUOv+GZ8aI4RkmYPK5S0cara+pKq6qzYyb VCVM7AV93nhBZg7bugWzzrewzBazLeyqLfr60P8pBWQ3DJxDatJHMaVBnwPcnojoctCD 02bNPILtFtxYxCCaF2iMn8eDcmBqT8cRWt2B7K1581neKroAfM6Ue6EPTzXuW3lyadOa 38sLJ6MtbFshH1sp9ljS/INi9C1gDeSsJiyG+NoD54CTYdeiqw/e4kasHQt3bjW/AxK7 FFDA== X-Gm-Message-State: AOAM532epa4axS4NuS7Hdxeu0J008WwwFOFeel0K7uvYylOpjLxfYs60 SczF9BYdrroUy6BCbDxeti1AfbWeFpUuLySZiwPK5PzYt9fQOozVfkeATC49+fWep4C3XR0joMC KWcGeR094rsUcqLOmt7gYXEb4zVx1mEJZKuX0lxT2p/kgBT6Go4CYnwgCvQ2aQdVuA2ILEo8= X-Received: by 2002:a17:907:2108:: with SMTP id qn8mr11445095ejb.549.1628285027467; Fri, 06 Aug 2021 14:23:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMytThQmIvTfapO3G/6qSNxhryVslWSSS/mGAZEAqfOgppqJ/Ju6OHBUwtd93/mwJJKCDTOw== X-Received: by 2002:a17:907:2108:: with SMTP id qn8mr11445088ejb.549.1628285027287; Fri, 06 Aug 2021 14:23:47 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:45 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 18/29] xfsprogs: Stop using platform_findsizes() Date: Fri, 6 Aug 2021 23:23:07 +0200 Message-Id: <20210806212318.440144-19-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 2 +- libfrog/topology.c | 6 +++--- libxfs/init.c | 12 ++++++------ 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 3e4f2291..891373c6 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -192,7 +192,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; @@ -251,6 +251,12 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz) max_block_alignment = *bsz; } +void +platform_findsizes(char *path, int fd, long long *sz, int *bsz) +{ + findsizes(path, fd, sz, bsz); +} + char * platform_findrawpath(char *path) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 1705c1c9..914da2c7 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -21,8 +21,8 @@ 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); +void findsizes(char *path, int fd, long long *sz, int *bsz); int platform_nproc(void); -void platform_findsizes(char *path, int fd, long long *sz, int *bsz); #endif /* __LIBFROG_PLATFORM_H__ */ diff --git a/libfrog/topology.c b/libfrog/topology.c index b1b470c9..a21ba6c6 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 784f15e2..7bc3b59d 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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 From patchwork Fri Aug 6 21:23:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423907 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 46234C432BE for ; Fri, 6 Aug 2021 21:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 22F4C61184 for ; Fri, 6 Aug 2021 21:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240279AbhHFVYI (ORCPT ); Fri, 6 Aug 2021 17:24:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46710 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240308AbhHFVYH (ORCPT ); Fri, 6 Aug 2021 17:24:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285031; 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=cUGEXRCzb6w2Ws2sS1zDgMNCuH/1F4t27JjerpAaI+k=; b=e9PdY35PuOhc345DgTI4Q7+3Dtx+YcvwDrXPuOJp4ehOouzMwa4w6WHiZJ2g/5DS7v/ocJ /0lO4D69uT+Y3xGKvjUvqr4igkNSF0I0TinVer2fFPlX9q0KLc7tQdqB9zbULgF0YjZ78u sf1YxDohBbVi+NafI6bT1r78PUqFHm8= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-550-1O6s2V2kNtGQwQBu8D0nVQ-1; Fri, 06 Aug 2021 17:23:50 -0400 X-MC-Unique: 1O6s2V2kNtGQwQBu8D0nVQ-1 Received: by mail-ed1-f70.google.com with SMTP id x1-20020a05640218c1b02903bc7f97f858so5578158edy.2 for ; Fri, 06 Aug 2021 14:23:50 -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=cUGEXRCzb6w2Ws2sS1zDgMNCuH/1F4t27JjerpAaI+k=; b=UPYbahvOVZ2yWWN3UkGVRT4EpC8Yyv0x/EgoSzmviPH9V+rLaJvFH6h+SgKBxEqLaa Ve6Is85A1xkd4xPExAvy9LqQvlAUQimbp1rmd1so4oxjKr8kr43YPDgJFoHkkuEacdPW BlOoFpnepYOkQEmC9OP4E7aLok7CjbbzgneNrVPVhm3KUVPzHHYMI8TK/bBcH3t3994S +N7rJ1+w1V4n1xF+cJjHMVqykmlWf4XabbxVRDKcMAt3+rhsySlm1mRYXBxbyt3502Ac axzR4+JIOpJcx2c7eD3AcUXG/5D7J4bweyRwqJrG6seNYmsJ306fLDCGvlktOhO2eWty FRjg== X-Gm-Message-State: AOAM532ls1mGEx9tf3jeHcePgbYjXgafukeeMUP8G8uEkC2jaCNSxyIP m8dW95KnylvmsxSDrRIx7FArxgm4Z8MVzDUP83miJd8ZcPkqfp4TqEh3yi8dxq8/IxMq9CjX4DF yqbb+zpSPZfM5F4DpVDzxRsQjbWCy0Y1DzRBz8P3FWaNP6jUoTQxHmZgUq/YNgdOoIDJh3rQ= X-Received: by 2002:a17:906:405:: with SMTP id d5mr11555422eja.189.1628285028841; Fri, 06 Aug 2021 14:23:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6psWm60i+I6XbsgDfWZ33dXgJQVM+Y0nG4/CuvqA8RD/HRbHKhUcvkQsuX3CRzGnL10oKMw== X-Received: by 2002:a17:906:405:: with SMTP id d5mr11555412eja.189.1628285028681; Fri, 06 Aug 2021 14:23:48 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:47 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 19/29] xfsprogs: Stop using platform_discard_blocks Date: Fri, 6 Aug 2021 23:23:08 +0200 Message-Id: <20210806212318.440144-20-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- include/linux.h | 7 ++++++- mkfs/xfs_mkfs.c | 10 +++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/linux.h b/include/linux.h index 7940fe8c..97882161 100644 --- a/include/linux.h +++ b/include/linux.h @@ -140,7 +140,7 @@ static __inline__ void platform_uuid_copy(uuid_t *dst, uuid_t *src) #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 }; @@ -149,6 +149,11 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len) return 0; } +static __inline__ int +platform_discard_blocks(int fd, uint64_t start, uint64_t len) +{ + return discard_blocks(fd, start, len); +} #define ENOATTR ENODATA /* Attribute not found */ #define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */ #define EFSBADCRC EBADMSG /* Bad CRC detected */ diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c index c6929a83..fc672a10 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) +discard_batch_of_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); + discard_batch_of_blocks(xi->ddev, xi->dsize, quiet); if (xi->rtdev && !xi->risfile) - discard_blocks(xi->rtdev, xi->rtsize, quiet); + discard_batch_of_blocks(xi->rtdev, xi->rtsize, quiet); if (xi->logdev && xi->logdev != xi->ddev && !xi->lisfile) - discard_blocks(xi->logdev, xi->logBBsize, quiet); + discard_batch_of_blocks(xi->logdev, xi->logBBsize, quiet); } static void From patchwork Fri Aug 6 21:23:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423909 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 EA722C4338F for ; Fri, 6 Aug 2021 21:23:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C603060E78 for ; Fri, 6 Aug 2021 21:23:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239884AbhHFVYJ (ORCPT ); Fri, 6 Aug 2021 17:24:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:51764 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240308AbhHFVYJ (ORCPT ); Fri, 6 Aug 2021 17:24:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285032; 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=BHosT4ai/RSb3peV1ycUzHP+d1QOR1DbAUILujJwPKw=; b=LYq2ZZmHX0aoQp9ehFLIy748wJR7l76wzG6Arl3vnuckOn5yfjI6NpbGKAacq4ArHU7htG aAyFKrv8PCJnTSW7kHimf6D3uK6m8CIEuP4nCnhFrNJ/xwdR/3Feozg1pmPyd04gDPcOPN lZSpFRDYdwcliW7tLVP5/qURx9sz9qU= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-495-ig3nwGakN66v8ybY039r0g-1; Fri, 06 Aug 2021 17:23:51 -0400 X-MC-Unique: ig3nwGakN66v8ybY039r0g-1 Received: by mail-ed1-f71.google.com with SMTP id c16-20020aa7d6100000b02903bc4c2a387bso1115825edr.21 for ; Fri, 06 Aug 2021 14:23:51 -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=BHosT4ai/RSb3peV1ycUzHP+d1QOR1DbAUILujJwPKw=; b=kHZ6OzDqF+vgre9hnyret9UugjY1Mn147UzvbnM0lcDrS/HtJTv7EaPFLxHomwHUtk ss0S0504tvh7qU+KPG8I4z0SVJVI7CN3NhGsUOnBx3GWmf9lJ34az4/Vux3qGuoAAGHi Un96a3kZyLRt1BW0I29NxSk3TA9hiC7JKe8FhaUga/oAnGt1dNfDXlWGYTN/0rGh6u77 ERWFlJ2fsTu2hRfP8lOqRley7RcaCnlYvNdv03H1jPI9YYu0NvP7U1vxCXYHrq93tCTR to6tslwAmCDCmx5Ps6v9WEzjakpoAZ0thQyrfrx9yNd78LPGgh6GQzLutYgg8AGo4JrO aR9g== X-Gm-Message-State: AOAM5324V+HAFHZn2CjhRCUveaQZbd1AuDZEEM+5KZ0vfv7kbkrPfMAy LSxnRfsD59EWIXvZP1n0YqBsU5GpPzWRl62AqBx7LUVh6B53pKq8e0pOsnynJSiDVOovpz0aAKr ZdHMRxq/V0v5jQIWAdFW2tjZL5TkGd80Ym7f32YthG1ZD53lhRaKY92hW8HyA/A87Zzepynk= X-Received: by 2002:aa7:db94:: with SMTP id u20mr15441690edt.381.1628285030081; Fri, 06 Aug 2021 14:23:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSGgDozczmD4cSUR1tw57KgA+O7smV1i5+tAuehGZAKbCefZ4W9q+GLloD78ZSrDPlRsxEuA== X-Received: by 2002:aa7:db94:: with SMTP id u20mr15441679edt.381.1628285029957; Fri, 06 Aug 2021 14:23:49 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:49 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 20/29] xfsprogs: Stop using platform_zero_range() Date: Fri, 6 Aug 2021 23:23:09 +0200 Message-Id: <20210806212318.440144-21-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- include/linux.h | 14 ++++++++++++-- libxfs/rdwr.c | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/include/linux.h b/include/linux.h index 97882161..4ee4288f 100644 --- a/include/linux.h +++ b/include/linux.h @@ -208,7 +208,7 @@ static inline void platform_mntent_close(struct mntent_cursor * cursor) #if defined(FALLOC_FL_ZERO_RANGE) static inline int -platform_zero_range( +zero_range( int fd, xfs_off_t start, size_t len) @@ -220,8 +220,18 @@ platform_zero_range( return 0; return -errno; } + +static inline int +platform_zero_range( + int fd, + xfs_off_t start, + size_t len) +{ + return zero_range(fd, start, len); +} #else -#define platform_zero_range(fd, s, l) (-EOPNOTSUPP) +#define zero_range(fd, s, l) (-EOPNOTSUPP) +#define platform_zero_range(fs, s, l) zero_range(fd, s, l) #endif /* diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c index 022da518..a92c909e 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; From patchwork Fri Aug 6 21:23:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423911 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 AA9F6C4338F for ; Fri, 6 Aug 2021 21:23:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 82D7760E78 for ; Fri, 6 Aug 2021 21:23:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240209AbhHFVYN (ORCPT ); Fri, 6 Aug 2021 17:24:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28861 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240393AbhHFVYK (ORCPT ); Fri, 6 Aug 2021 17:24:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285034; 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=04CbzjSMSrMjbDV1k2ePM/U0Y9Ze5uEaNMQfi54gpdc=; b=ASlRdayAQhDH/YJ7Uk7F279BRYnm6DrntW5Tadly+rqYsTCu6fZ+oE9Rti7ZxMtrRXYJiE N4lqXLw9EbLZ9Aq8qg0SH9w+iiQev8RtS949GJtEWjO3YxS/m0IO797opN91MQZc2ka582 lsCwX2D3OEbtIrY7i35IbKAciiLkKo0= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-291-pISID1FJP2CYL2FSjyCsKA-1; Fri, 06 Aug 2021 17:23:53 -0400 X-MC-Unique: pISID1FJP2CYL2FSjyCsKA-1 Received: by mail-ed1-f72.google.com with SMTP id y22-20020a0564023596b02903bd9452ad5cso5550488edc.20 for ; Fri, 06 Aug 2021 14:23:52 -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=04CbzjSMSrMjbDV1k2ePM/U0Y9Ze5uEaNMQfi54gpdc=; b=Or7TvxAMjmJ+OjGH6cSYUuJKKJpMF6WDaz7/Hxt9Ym0zeSKl1rSWO2Z+X1DvdKNgSe KR3SA9RY03BFg+zAQpF0VtmyIz3Y4T4MA9p9aCvkAWFh7+dLU+fpBhNmj8qVd76MT32O VQiyvTdD0ydMFYnwLNV/MIqRGa88PNKR7pxZzCGCffNctZC8G35s9FenGgv7TTtyenPd HSBHYaNZ/yxrIEJfrkIY93TwhkAXKkID8Y90HJu9UHllH9FMaLqo5bMMgiNpUyVFx58G o63yHR6EdoZat7zUFfR7Dnx5KvGLJwprvFVFlXqj06+yYMptIgRmp95WXyL3DGm2a3+i RHSA== X-Gm-Message-State: AOAM530ivpBDViAfMLygFhoiSjo9cPxvk3jlZ7V05xIMBE45b98N0izK ynpVikIFdQQtG996heRLswuoIK8PTFXdNDM1yicjsgGjLTd3dyPCXGCrqfegsbAsjOozhW0hdDe rMdJTK02ViiOne5mdjta3Q5+XkAtIk2GvUmFRqWjqy8Neojgx9sgndkUd8NqFNtHhHneoGL8= X-Received: by 2002:a05:6402:d4e:: with SMTP id ec14mr15179838edb.277.1628285031653; Fri, 06 Aug 2021 14:23:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZOa4lEFTsSta97CwMIKnAO/Uctfpcblp7WRecKeDQWYAuzhI5KetCJ09ZRwa3vZ0fsVWpbw== X-Received: by 2002:a05:6402:d4e:: with SMTP id ec14mr15179828edb.277.1628285031472; Fri, 06 Aug 2021 14:23:51 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:50 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 21/29] xfsprogs: Stop using platform_crash() Date: Fri, 6 Aug 2021 23:23:10 +0200 Message-Id: <20210806212318.440144-22-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- include/linux.h | 8 +++++++- libxfs/libxfs_io.h | 2 +- repair/xfs_repair.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux.h b/include/linux.h index 4ee4288f..591b4b05 100644 --- a/include/linux.h +++ b/include/linux.h @@ -239,12 +239,18 @@ platform_zero_range( * atexit handlers. */ static inline void -platform_crash(void) +crash(void) { kill(getpid(), SIGKILL); assert(0); } +static inline void +platform_crash(void) +{ + return crash(); +} + /* * Check whether we have to define FS_IOC_FS[GS]ETXATTR ourselves. These * are a copy of the definitions moved to linux/uapi/fs.h in the 4.5 kernel, 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/repair/xfs_repair.c b/repair/xfs_repair.c index 38406eea..a5410919 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 From patchwork Fri Aug 6 21:23:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423913 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 03793C4320A for ; Fri, 6 Aug 2021 21:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF81760E78 for ; Fri, 6 Aug 2021 21:23:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240308AbhHFVYN (ORCPT ); Fri, 6 Aug 2021 17:24:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:54556 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240528AbhHFVYL (ORCPT ); Fri, 6 Aug 2021 17:24:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285035; 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=o7N8xPCiLjZqP2AvRCnw3/NKjGYTWvJNpzwNYqXCnSU=; b=aUyPwbMS8DNJ0haUdHzjoxY/IFtwGZGwlTlruS7xpMjAwQ8feYUom8cNFl9tBNi80PfXcp 4CIwbU8sbT29dmU9PxezeWM+H1Zk/w0CSg92bQgvEtN7yKMA+T42x0WsQPx9trzDHZovtf 83uLroaBoFvXciTD6AzqLBFu0kHdNac= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-yKFeaKulMc6xIUzmuuGcKg-1; Fri, 06 Aug 2021 17:23:54 -0400 X-MC-Unique: yKFeaKulMc6xIUzmuuGcKg-1 Received: by mail-ed1-f71.google.com with SMTP id l3-20020aa7c3030000b02903bccf1897f9so5559903edq.19 for ; Fri, 06 Aug 2021 14:23:54 -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=o7N8xPCiLjZqP2AvRCnw3/NKjGYTWvJNpzwNYqXCnSU=; b=T1KV2Hph52hQysnI9J7egmazX2T/0R9miqjI9hio1RP6rIlwaeP9PjZ6F5MtoztCx6 IPBb+xHu7K30+rDmvZslriyT/OFmvm813FRxrvwxZKxVlRgcdTEoY22UqAkeF6FWigNh Fx1ih5aT54Fq0uK2O5/e1VXeoTrQvDuQWtu9uoeqlX1BoV7IQgqL+FdVmXzi75ck57gD tneQM/SasLS3ZO1dMrv1j52yDc+v6+VjyqttzphjcUyuXtoEYjO+apx8kGXL/1ymbizv KshZ05tWsQwX32ph+GlsbuC2RAHyTAOYGarXDhX0F6eSq9rm3wOO62d0caMI1qjJdjPU BAnw== X-Gm-Message-State: AOAM5312hM77CfYGPyiJ2UWhRTCJom8cJte8SU2UILyuoj3AegLJFFb9 okwJzRh5pJ5u/gsnJqgzFYjLPFVTqiR1nbYBE2ru4G4aTEchdSw7D+doxaReG/xwDZobbyUk+WL qKtGu9cr8Srrn+TtJcB93pOTSJLL0uqdTnzyOdff56h+1Q/apvx6Qpk2BlIwgVVLsNSXeVjg= X-Received: by 2002:a05:6402:35d2:: with SMTP id z18mr15815270edc.282.1628285033063; Fri, 06 Aug 2021 14:23:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqO2p+eYvGsFNH6kVjuS/UFeXkJndLz3+aeXS71KSVHqk+GUq1SBlkLHT5esSW2vDeOF9TBQ== X-Received: by 2002:a05:6402:35d2:: with SMTP id z18mr15815255edc.282.1628285032849; Fri, 06 Aug 2021 14:23:52 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:52 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 22/29] xfsprogs: Stop using platform_nproc() Date: Fri, 6 Aug 2021 23:23:11 +0200 Message-Id: <20210806212318.440144-23-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- include/platform_defs.h.in | 1 + libfrog/linux.c | 8 +++++++- repair/phase4.c | 6 +++--- repair/prefetch.c | 2 +- repair/slab.c | 2 +- repair/xfs_repair.c | 2 +- scrub/disk.c | 8 ++++---- 7 files changed, 18 insertions(+), 11 deletions(-) diff --git a/include/platform_defs.h.in b/include/platform_defs.h.in index 539bdbec..03bc255a 100644 --- a/include/platform_defs.h.in +++ b/include/platform_defs.h.in @@ -79,6 +79,7 @@ typedef unsigned short umode_t; #endif extern int platform_nproc(void); +extern int nproc(void); #define NSEC_PER_SEC (1000000000ULL) #define NSEC_PER_USEC (1000ULL) diff --git a/libfrog/linux.c b/libfrog/linux.c index 891373c6..ee163661 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -285,7 +285,7 @@ platform_align_blockdev(void) /* How many CPUs are online? */ int -platform_nproc(void) +nproc(void) { long nproc = sysconf(_SC_NPROCESSORS_ONLN); @@ -296,6 +296,12 @@ platform_nproc(void) return nproc; } +int +platform_nproc(void) +{ + return nproc(); +} + unsigned long platform_physmem(void) { diff --git a/repair/phase4.c b/repair/phase4.c index 191b4842..c496deda 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, 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, 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, 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..f01e1296 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, 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..d9a94a81 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, 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 a5410919..fbbc8c6f 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -1030,7 +1030,7 @@ main(int argc, char **argv) } if (ag_stride) { - int max_threads = platform_nproc() * 8; + int max_threads = nproc() * 8; thread_count = (glob_agcount + ag_stride - 1) / ag_stride; while (thread_count > max_threads) { diff --git a/scrub/disk.c b/scrub/disk.c index a1ef798a..9b91eedd 100644 --- a/scrub/disk.c +++ b/scrub/disk.c @@ -43,19 +43,19 @@ __disk_heads( { int iomin; int ioopt; - int nproc = platform_nproc(); + int n_proc = nproc(); unsigned short rot; int error; /* If it's not a block device, throw all the CPUs at it. */ if (!S_ISBLK(disk->d_sb.st_mode)) - return nproc; + return n_proc; /* Non-rotational device? Throw all the CPUs at the problem. */ rot = 1; error = ioctl(disk->d_fd, BLKROTATIONAL, &rot); if (error == 0 && rot == 0) - return nproc; + return n_proc; /* * Sometimes we can infer the number of devices from the @@ -65,7 +65,7 @@ __disk_heads( if (ioctl(disk->d_fd, BLKIOMIN, &iomin) == 0 && ioctl(disk->d_fd, BLKIOOPT, &ioopt) == 0 && iomin > 0 && ioopt > 0) { - return min(nproc, max(1, ioopt / iomin)); + return min(n_proc, max(1, ioopt / iomin)); } /* Rotating device? I guess? */ From patchwork Fri Aug 6 21:23:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423915 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 4DBFBC432BE for ; Fri, 6 Aug 2021 21:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2F1A8611C6 for ; Fri, 6 Aug 2021 21:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240393AbhHFVYO (ORCPT ); Fri, 6 Aug 2021 17:24:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44432 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240789AbhHFVYM (ORCPT ); Fri, 6 Aug 2021 17:24:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285036; 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=4yPxypyx3wHOtQIdDvVL6aKBrehG8GaUytLS6rTsulY=; b=NzF5jumJX4/eco2prZ+8TvE8vRW7Q9W7+Y+BGrBLc86REblAH5GmWlk97bFOcN4kYG89+L /fRQnVv4x6yOVjTntX+Wf2DEgoFoFV1Apw64Gnk4OiNHDFRjNt4g8oWoCRbN6wHsn1f13P NB98/uuBjQWgp9K5wqVG8Wogn+UxbyU= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-106-KceC57QJNmmZRUd4fTrJjQ-1; Fri, 06 Aug 2021 17:23:55 -0400 X-MC-Unique: KceC57QJNmmZRUd4fTrJjQ-1 Received: by mail-ed1-f71.google.com with SMTP id a23-20020a50ff170000b02903b85a16b672so5601741edu.1 for ; Fri, 06 Aug 2021 14:23:55 -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=4yPxypyx3wHOtQIdDvVL6aKBrehG8GaUytLS6rTsulY=; b=hfSIZzKFbbtF+PukLhODtSUmBAx9klLgmgzeu4rLZ7xIWYgyQuuv0JGVHWaVI7I9IP rPESsxLRKea0ojWkuNsqbNEg62dFA51ZFwyTvMzBBEiWxW8uZUe/8vGAiOOfvdpumvGW EKk63YPQd3tmESgxfztOdScnHr5qTUN1i/ZUE8x/DhFi6TyqLNBugo2VHT/+yvp0yJYA SnH4OeSucPnSqT1AhKOzogP/BemezdVFusjn8k9RnxUQiAfDmgUw8CfheQYju05KVr9O PFJQWmuFW3EoQyLc0hhnAhUbr/o6luNvac7nieDBOhBCBJ57HjVCAxwec3HEpoxssib3 2eaA== X-Gm-Message-State: AOAM532bjjJiqy0F3pJhWqtlOvK4X7VKOyRSqzdx+nOj2I8qVpnhZU+T jpJm/4y2NUynY9PwowAo/CgcUh/lzSGbC/tgaRtUfsAsCZcq4XPL1F/5i5pmVGayKCIViY47OHA M0yK5mWPvoROZ+UVPAxUXTAgJS7Tmsc21ryC1UDX3994tIageDEKXuil9iSNJcCnCLWEMwH0= X-Received: by 2002:aa7:d511:: with SMTP id y17mr15608034edq.341.1628285034116; Fri, 06 Aug 2021 14:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySgniWKv5DHC43YgNcTcTimOE27CluXczvzcR1poNS0Mmgx4rjvC1MX0J4QhTUGVQUjF0sBQ== X-Received: by 2002:aa7:d511:: with SMTP id y17mr15608021edq.341.1628285033929; Fri, 06 Aug 2021 14:23:53 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:53 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 23/29] xfsprogs: Stop using platform_check_iswritable() Date: Fri, 6 Aug 2021 23:23:12 +0200 Message-Id: <20210806212318.440144-24-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index ee163661..4e75247e 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -129,7 +129,7 @@ platform_check_ismounted(char *name, char *block, struct stat *s, int verbose) } int -platform_check_iswritable(char *name, char *block, struct stat *s) +check_iswritable(char *name, char *block, struct stat *s) { int flags; @@ -138,6 +138,12 @@ platform_check_iswritable(char *name, char *block, struct stat *s) return check_mount(name, block, s, flags); } +int +platform_check_iswritable(char *name, char *block, struct stat *s) +{ + return check_iswritable(name, block, s); +} + int platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 914da2c7..69f432f7 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -11,6 +11,7 @@ int platform_check_ismounted(char *path, char *block, struct stat *sptr, int verbose); int check_ismounted(char *path, char *block, struct stat *sptr, int verbose); int platform_check_iswritable(char *path, char *block, struct stat *sptr); +int check_iswritable(char *path, char *block, struct stat *sptr); int platform_set_blocksize(int fd, char *path, dev_t device, int bsz, int fatal); int platform_flush_device(int fd, dev_t device); diff --git a/libxfs/init.c b/libxfs/init.c index 7bc3b59d..9fb4f9d8 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -61,7 +61,7 @@ check_isactive(char *name, char *block, int fatal) return 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; } From patchwork Fri Aug 6 21:23:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423917 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 A1A08C4320E for ; Fri, 6 Aug 2021 21:23:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 844CC60EE8 for ; Fri, 6 Aug 2021 21:23:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240403AbhHFVYO (ORCPT ); Fri, 6 Aug 2021 17:24:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56920 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240338AbhHFVYO (ORCPT ); Fri, 6 Aug 2021 17:24:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285038; 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=TV7Qj9Cd4raX9KM6H4jz/MP/F7OzpXjw6bNGnLkt9j0=; b=RzG+DfTseWvdnNQ73X1apak71ncgt3w7mkRAdDvl3+bAo4k0cmlYRBn17ValPylYMMZnxt zQ5qTwh98Vxs8NPHXx6RDkK8fH10jAEYRqyhirm9fLuro9vbjn1U8WKdfqciVzs5fHdBC3 ZC6rMJ/WxR642IBPEM+0bLHO13m0bBQ= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-176-WlYzO3h8OH6tzwluvTuycA-1; Fri, 06 Aug 2021 17:23:57 -0400 X-MC-Unique: WlYzO3h8OH6tzwluvTuycA-1 Received: by mail-ej1-f70.google.com with SMTP id k22-20020a1709061596b02905a370b2f477so3523756ejd.17 for ; Fri, 06 Aug 2021 14:23:56 -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=TV7Qj9Cd4raX9KM6H4jz/MP/F7OzpXjw6bNGnLkt9j0=; b=KXc2XEDSsBbGwqQkjewiOS06PPcnyGEojK7gM3wC/OddmEdp0r0TtLOEq8w4WQe67E sQi75CV9AzzsSLhNJG/f1snum63zrgRSCLqI2pH0UKnRAu/Zjjc44b6SkwLAJLarYR5g YyJNIfi7G+Rvf6urowdNmYcCCBnEqHSlgBrS3myKo6PmbTPnYtCxeCe09d16LafLPRcA h1WR1VhallSrPzBWf+4e4KF8aO1+q8kkP7f4CXRvK4r/JbSJydnmq3/nfCGdNrPSEUog c8UFbgbNywtKd4WlcyJGLBoYaDB3NS0StusXYsq4OExijhyIt3A0w1t00dq+R8xFvQ0L jIVg== X-Gm-Message-State: AOAM5310I16vju26IX1XvKMZPZLOWX6yqdhwcXVP8PbNqErlx1yabLNa vOOXiPLyNj1oryzswc4fZidasgqrRTxVyeb1vw4XhL8KUJxvvgxU21DWIGVlqICjaM3n556m5fF tAZyNmBQ+ZBG7MBqf9GqOEvdoZvsd0GNAqgArY9WzsR3d4+EDnWGDxG3Jek3HBvP5b5GQEgs= X-Received: by 2002:a17:906:158f:: with SMTP id k15mr11509703ejd.241.1628285035706; Fri, 06 Aug 2021 14:23:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxO3wjJkVCY4BuHvOYq59RFb3tlRtqoMO0BeSs0yHK1UePwI6/H5mCFBFfKJkP6YaWGooB+mw== X-Received: by 2002:a17:906:158f:: with SMTP id k15mr11509690ejd.241.1628285035497; Fri, 06 Aug 2021 14:23:55 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:54 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 24/29] xfsprogs: Stop using platform_set_blocksize() Date: Fri, 6 Aug 2021 23:23:13 +0200 Message-Id: <20210806212318.440144-25-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 4e75247e..796fb890 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -145,7 +145,7 @@ platform_check_iswritable(char *name, char *block, struct stat *s) } 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; @@ -160,6 +160,12 @@ platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fata return error; } +int +platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fatal) +{ + return set_blocksize(fd, path, device, blocksize, fatal); +} + /* * Flush dirty pagecache and disk write cache to stable media. Returns 0 for * success or -1 (with errno set) for failure. diff --git a/libfrog/platform.h b/libfrog/platform.h index 69f432f7..06519a0c 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -14,6 +14,7 @@ int platform_check_iswritable(char *path, char *block, struct stat *sptr); int check_iswritable(char *path, char *block, struct stat *sptr); int platform_set_blocksize(int fd, char *path, dev_t device, int bsz, int fatal); +int set_blocksize(int fd, char *path, dev_t device, int bsz, int fatal); int platform_flush_device(int fd, dev_t device); int flush_device(int fd, dev_t device); char *platform_findrawpath(char *path); diff --git a/libxfs/init.c b/libxfs/init.c index 9fb4f9d8..46e6e225 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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); } } From patchwork Fri Aug 6 21:23:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423919 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 B820AC4338F for ; Fri, 6 Aug 2021 21:24:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9F10060E78 for ; Fri, 6 Aug 2021 21:24:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232302AbhHFVYQ (ORCPT ); Fri, 6 Aug 2021 17:24:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31180 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240338AbhHFVYP (ORCPT ); Fri, 6 Aug 2021 17:24:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285039; 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=HfAktOPlA7PYs6WFbtBi/M9gpwd7ZVMtsNCcv9MwvKY=; b=ACdBchSbvBWUvtj0nutUA+SMJ7FT8PaEcUo0L2eS68dQkxWYsoCd3i8EZPIMDf0L01nfWX eSIHupHaVZigbwBAh+d4WnBk4ZNaFTWMvWDt8PQQ8JgFGu5rvqpSB5wFL0AFwL7/IXUv9q oJOS3gq2xyTjkueRiVfygpm4bD0i8RM= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-ZxBZTSa7OFeD9pa8Vw91og-1; Fri, 06 Aug 2021 17:23:58 -0400 X-MC-Unique: ZxBZTSa7OFeD9pa8Vw91og-1 Received: by mail-ed1-f71.google.com with SMTP id l3-20020aa7c3030000b02903bccf1897f9so5559971edq.19 for ; Fri, 06 Aug 2021 14:23:57 -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=HfAktOPlA7PYs6WFbtBi/M9gpwd7ZVMtsNCcv9MwvKY=; b=QdFIE1pos9J/2moUDgO3XWpcrS4AkNVBh6ESgbPW3TZZki9tT1Sy9YhVwaiwu9Uz4x nW2JZTM6Qys7X3RDstHKYgEaSbGbFPYhn7/EfAKj4WCSWPFvchliQ9cmYjvA1xw3iAJJ J2nZE6+yzUYsQr2jYs1MBjVbOd2wNhZmxnFpX1+f2diXS9kgZWMAFK13Jjb/WHWnERWj kOESUwQtt+DLAmpQrR1nNAJcsyCdinxzgMvdsWhYw57/BKOcoVE/5qMciri3irSZkEBo NB1WZ9aJSq44nFjOemPUU/P7ZvpcnZuJrq5s/CA0oDeWJwvbFp7yV/0eHsZboEoCRylr b8cw== X-Gm-Message-State: AOAM530zdKGeAQKdfZ9U51jwfIcSH6ih8VyLe06Ex9zBOw/3y8iXIN1W BFJnm/3blc/IwhQzv6wdJ/EO+OhF43IrhFrin+GE82bwwT8mKKTPnzMJT0kaYHLXPLMRtkEy5W/ fb8jFFby1Dm3XJdFYPC+Xz4TBb4PNC9DXBHQ7vAHEHHT1q5oxxnEqhgZyXGe9b16TE01PG7U= X-Received: by 2002:a17:906:6d85:: with SMTP id h5mr11647029ejt.305.1628285036783; Fri, 06 Aug 2021 14:23:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrD/gRhMjWlC8iFNOV6larpdMPthF/V9MGMH/r7XDOsIfSfXAgJtoy3lCpgmGcCiWbNzOgCQ== X-Received: by 2002:a17:906:6d85:: with SMTP id h5mr11647021ejt.305.1628285036600; Fri, 06 Aug 2021 14:23:56 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:55 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 25/29] xfsprogs: Stop using platform_findrawpath() Date: Fri, 6 Aug 2021 23:23:14 +0200 Message-Id: <20210806212318.440144-26-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 796fb890..31ed59c9 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -270,11 +270,17 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz) } char * -platform_findrawpath(char *path) +findrawpath(char *path) { return path; } +char * +platform_findrawpath(char *path) +{ + return findrawpath(path); +} + char * platform_findblockpath(char *path) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 06519a0c..832eb41a 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -18,6 +18,7 @@ int set_blocksize(int fd, char *path, dev_t device, int bsz, int fatal); int platform_flush_device(int fd, dev_t device); int flush_device(int fd, dev_t device); char *platform_findrawpath(char *path); +char *findrawpath(char *path); char *platform_findblockpath(char *path); int platform_direct_blockdev(void); int platform_align_blockdev(void); diff --git a/libxfs/init.c b/libxfs/init.c index 46e6e225..d7166b69 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -200,7 +200,7 @@ 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); From patchwork Fri Aug 6 21:23:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423921 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 2D217C432BE for ; Fri, 6 Aug 2021 21:24:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 161B260E78 for ; Fri, 6 Aug 2021 21:24:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240470AbhHFVYR (ORCPT ); Fri, 6 Aug 2021 17:24:17 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28780 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240438AbhHFVYQ (ORCPT ); Fri, 6 Aug 2021 17:24:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285040; 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=ZStkC3pzPK9fIoV5DdEXz3MMtSYFzTPkNePce2HFkM0=; b=D3E/Q436rqeNHd+rsiZDacayHWaY0ZcOqAdIa7di6AxRz0dmXnAAFV5am9+ZLEixMvEE4F vadx7LdyFZ/xvPUcoT1vqz/hlpxypnxvOvuPPzbciy7R95gEOC7LDzTk2axaXSwl4KbQHF iRgG4lTMhPENe17XhjfQ6iPKjO0/bFw= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-390-mCVXpRPcMUaH6lpcKBwxwA-1; Fri, 06 Aug 2021 17:23:59 -0400 X-MC-Unique: mCVXpRPcMUaH6lpcKBwxwA-1 Received: by mail-ej1-f71.google.com with SMTP id ju25-20020a17090798b9b029058c24b55273so3558098ejc.8 for ; Fri, 06 Aug 2021 14:23:59 -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=ZStkC3pzPK9fIoV5DdEXz3MMtSYFzTPkNePce2HFkM0=; b=G0qiRkxXxH0PtNhfm0ujG/RuZEL9bhePTwJDgid/rz13I7z4qGHK6ta6DENfq6R9jk kuTpYFzZ8qUxEGDJcqv+NtzbbdDmG4r9rWG0Lo8pJD8j7xcfIgx4d7N4/5WmvL/Q7W/0 3oQGSvWKHDc5z8Avi2Blb/7iF7X39DBVk8Dty2K/8uLne/l5ts3vBaPQBrnpdRxZ4pIk OMX1WSKWKBe9T3UM7JxRFOi3mzV5BcfYiG8BAQQKZeS4FXkX+dAU8O+Y0bGRmTgOYbYs ViBfTb/uBOAP8lkQIJEuTWVwJpCJGmc+lDsCJY5z47veTLR2LZ9LzRfam5wkZ+jZ2QFL YdNg== X-Gm-Message-State: AOAM532EWY3re84vHEPmcoLTMuPmTAs2BErJvg15UQ+J51o9XJG6gSsv QhNBnqdw4OgtKJduSMQzjinjCKa7aYvRWdgqW4dXEBiShK49RZQNMCQHI7ZN9m0PdBuPmzq36T5 CNK1h2a2h4MrkKrHv4FsloBjrfrUVj0SBqGELuKAyz1lbxHmTc6/bnn3Ir6Ba5oyuuchziUE= X-Received: by 2002:aa7:d8d4:: with SMTP id k20mr15292237eds.373.1628285038084; Fri, 06 Aug 2021 14:23:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJ+A+7S0wEcPrbiHs1KusCrptxyle6od8tBx2WHtcFgI/xVvKmCptB+cp3NcxyqzTXQjhEuw== X-Received: by 2002:aa7:d8d4:: with SMTP id k20mr15292230eds.373.1628285037951; Fri, 06 Aug 2021 14:23:57 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:57 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 26/29] xfsprogs: Stop using platform_findblockpath() Date: Fri, 6 Aug 2021 23:23:15 +0200 Message-Id: <20210806212318.440144-27-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 31ed59c9..e670a5e9 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -282,11 +282,17 @@ platform_findrawpath(char *path) } char * -platform_findblockpath(char *path) +findblockpath(char *path) { return path; } +char * +platform_findblockpath(char *path) +{ + return findblockpath(path); +} + int platform_direct_blockdev(void) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 832eb41a..8f1a3493 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -20,6 +20,7 @@ int flush_device(int fd, dev_t device); char *platform_findrawpath(char *path); char *findrawpath(char *path); char *platform_findblockpath(char *path); +char *findblockpath(char *path); int platform_direct_blockdev(void); int platform_align_blockdev(void); unsigned long platform_physmem(void); /* in kilobytes */ diff --git a/libxfs/init.c b/libxfs/init.c index d7166b69..738e2d2d 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -206,7 +206,7 @@ check_open(char *path, int flags, char **rawfile, char **blockfile) 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); From patchwork Fri Aug 6 21:23:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Reichl X-Patchwork-Id: 12423923 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 3E989C4320E for ; Fri, 6 Aug 2021 21:24:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 27788611B0 for ; Fri, 6 Aug 2021 21:24:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240496AbhHFVYS (ORCPT ); Fri, 6 Aug 2021 17:24:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60097 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240338AbhHFVYS (ORCPT ); Fri, 6 Aug 2021 17:24:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285041; 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=huM/QV7LARaLX069sPb32EYl6rzvDqHg3Et2v25ZzqA=; b=GjzkCMMEY1+KCPTcCfjTofuble/475iyFFfkZWIMsJ26fu/LTOUCkAmmjiy6Wu6J6+PGlY dRgroKaj0Nh2T4RcxBrJqNgSysroq4BOzWfyqYiw4kGX9QKrlKvjNliw7btjwYkgdAot0N 6QCyJqCzy9tCQaJ/LAchjoNJ8CIC65I= Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-157-3tGZdusWP16qoe0KKFLsGw-1; Fri, 06 Aug 2021 17:24:00 -0400 X-MC-Unique: 3tGZdusWP16qoe0KKFLsGw-1 Received: by mail-ed1-f72.google.com with SMTP id y19-20020a0564021713b02903bbfec89ebcso5536828edu.16 for ; Fri, 06 Aug 2021 14:24:00 -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=huM/QV7LARaLX069sPb32EYl6rzvDqHg3Et2v25ZzqA=; b=StaLGOc3jNIy6aZMZMmLd5b19c1NKTuVhdXeN5nGRcPfuRe+cJ3CKaCLDupt9eOgad Sv8JYl5E4I9VIeolx38ituZOXbC7aF9RCjKrHPWBuQ7g39oocQYRF+VUnVUuBpARj9sW W8iBQQNwYMcvQGxfYM0DqkIzfiRmQdCob22zTBdL9UkaS07RQgCB01fKtaSjfAFZZKaN 5Ug0m1TX2xLawnKEDbcOwyK6j6opBO/GQrRp/j2PqpeA5hV+r7i373Y7ZzOoBhXCDWQe edDrV0WYB67QEfH87fmyVt0DzFDE+4LLvEqp8CRHljzuhvk1nIV4b9J7ceh5Nkvxgp5h 9NLg== X-Gm-Message-State: AOAM530zK1U7an2cqn421IBhepFn+YRhbuy06J4YtkO7mRQWFRUw3DS9 lFnLV5KvaFvGh3o5BN476fCH49C8xlp+TLdpoRhXP5+W8C5W/4XbRBqRqvh613RE4yzWZdTzPY+ RaUA/TTHyH9h74oIfTv8Zr4v3ai/jkKE4hZobwTsiRhyKhkcqeE2+04TMROWCn5k3pfQhoRc= X-Received: by 2002:a17:906:2990:: with SMTP id x16mr11373594eje.554.1628285039208; Fri, 06 Aug 2021 14:23:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfI2p4YRfik0FlhSoPyA3iSXQWVdMWpQpvu6yUt5doS8XfGWskIARDy79K9Batl9WT/ZlJ2g== X-Received: by 2002:a17:906:2990:: with SMTP id x16mr11373587eje.554.1628285039055; Fri, 06 Aug 2021 14:23:59 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:58 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 27/29] xfsprogs: Stop using platform_direct_blockdev() Date: Fri, 6 Aug 2021 23:23:16 +0200 Message-Id: <20210806212318.440144-28-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 7 ++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index e670a5e9..59edc260 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -294,11 +294,16 @@ platform_findblockpath(char *path) } int -platform_direct_blockdev(void) +direct_blockdev(void) { return 1; } +int platform_direct_blockdev() +{ + return direct_blockdev(); +} + int platform_align_blockdev(void) { diff --git a/libfrog/platform.h b/libfrog/platform.h index 8f1a3493..ec1a5ab7 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -22,6 +22,7 @@ char *findrawpath(char *path); char *platform_findblockpath(char *path); char *findblockpath(char *path); int platform_direct_blockdev(void); +int 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); diff --git a/libxfs/init.c b/libxfs/init.c index 738e2d2d..e412fd6e 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -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) | \ From patchwork Fri Aug 6 21:23: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: 12423925 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 F3239C4338F for ; Fri, 6 Aug 2021 21:24:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4B9D60E78 for ; Fri, 6 Aug 2021 21:24:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240438AbhHFVYU (ORCPT ); Fri, 6 Aug 2021 17:24:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55710 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240338AbhHFVYT (ORCPT ); Fri, 6 Aug 2021 17:24:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285043; 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=H/H7LM0A6BlsclUTq7ZF8RGd3hkzzUjF953tuuY8xcY=; b=PsWmUAKO7zEjP93ini2v5TZzpdAvQV6vmMBzmE16LUIKwc1WqIrpL+1/N+Tq1d3VmjHAUS 3k/3e7+W9UeQWYehEMhIa6eFpGjma+ZVvHXHSaypN6ckMd3vXi4pXC+ca6edpxqFC8UhYl zhuM7051VfAa+6d1KybbAg8Nkzk3SCc= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-282-Auh77QfdM1OMWvlJC7vM2g-1; Fri, 06 Aug 2021 17:24:02 -0400 X-MC-Unique: Auh77QfdM1OMWvlJC7vM2g-1 Received: by mail-ej1-f70.google.com with SMTP id r21-20020a1709067055b02904be5f536463so3543026ejj.0 for ; Fri, 06 Aug 2021 14:24:02 -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=H/H7LM0A6BlsclUTq7ZF8RGd3hkzzUjF953tuuY8xcY=; b=nu3Ru+wx17a8CvZ80I7eWF5sSD8D30IJkDm/iCxcmIgttBL/HzpDmiiniO2sxNpS3u zSBXaYjQv65bgkg2f3gw1UVgzByHz8hUcFsKJ7lA/SAZOW49ilz7Je1VJrNi2ynynbyd GzEN43Oqxy78rwiDa11fa69KlDAqWNOxINnj2JiYvklpLzt27XBrXN8z8rw3AGuRgloT tbWDUcAXMq+TSwkmB86L8DH2bG7cJ8JWhN4RqFamCzv0nZwcLHOZ6F368708syy8QUHH Hg+CvfFbG06+8AkONmT0wGQ3xza2pJoVaxrOMoHm/fkx4ki+vSwyqjPMceI4GAU5Cngv CSxw== X-Gm-Message-State: AOAM533DamBhpQ0/14+uRKvfEmzJ7MC/i9LJa/EOhKgg2cSN7CCO8LFh UXbusPCc/jedF6/ZNToCHqEKxgoEs7E3K8XMj3MpbtTqrv1WLybCbVlkBkO0ZcsckKEIacLYtIX cWwPTlOp5l9qdiDFZcLssizm+6OcZBltAGxViZTV2FkQzO63TMYFCn1rxBuWvjlY/oCZ7dz4= X-Received: by 2002:a05:6402:1d22:: with SMTP id dh2mr15442786edb.180.1628285040998; Fri, 06 Aug 2021 14:24:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBk9CojT70sjUvyhD6zyooyUV3FOoe/oCfFKheM/VluQ0L4rgVqP+kJ46oRFUh8+lsN/GNHg== X-Received: by 2002:a05:6402:1d22:: with SMTP id dh2mr15442778edb.180.1628285040874; Fri, 06 Aug 2021 14:24:00 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.23.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:23:59 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 28/29] xfsprogs: Stop using platform_align_blockdev() Date: Fri, 6 Aug 2021 23:23:17 +0200 Message-Id: <20210806212318.440144-29-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + libxfs/init.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 59edc260..43ca1e7d 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -305,13 +305,19 @@ int platform_direct_blockdev() } int -platform_align_blockdev(void) +align_blockdev(void) { if (!max_block_alignment) return getpagesize(); return max_block_alignment; } +int +platform_align_blockdev(void) +{ + return align_blockdev(); +} + /* How many CPUs are online? */ int nproc(void) diff --git a/libfrog/platform.h b/libfrog/platform.h index ec1a5ab7..42b0d753 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -24,6 +24,7 @@ char *findblockpath(char *path); int platform_direct_blockdev(void); int direct_blockdev(void); int platform_align_blockdev(void); +int align_blockdev(void); unsigned long platform_physmem(void); /* in kilobytes */ void platform_findsizes(char *path, int fd, long long *sz, int *bsz); void findsizes(char *path, int fd, long long *sz, int *bsz); diff --git a/libxfs/init.c b/libxfs/init.c index e412fd6e..a9b67159 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -1030,7 +1030,7 @@ libxfs_destroy( int libxfs_device_alignment(void) { - return platform_align_blockdev(); + return align_blockdev(); } void From patchwork Fri Aug 6 21:23: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: 12423927 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 9C0CAC4338F for ; Fri, 6 Aug 2021 21:24:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7772860E78 for ; Fri, 6 Aug 2021 21:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240509AbhHFVYV (ORCPT ); Fri, 6 Aug 2021 17:24:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:43239 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240338AbhHFVYV (ORCPT ); Fri, 6 Aug 2021 17:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628285044; 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=1w+P82Tvwhwr5BqTiweZKyZhEfP6JktMBQ5MU886dMM=; b=EBYL7GrA4IX2OKLQv2Cmn/h9gUsMiCZ3DsXuQCtwrc6gDRs9EMsJR1ia4DcIbLpolu+Re1 Pxj2xGjoxD8ZbPlpjtfW0HGyzLlgjdBPvOP2NUj98VNBVUXn+R9pimS14JxZLZ79iZEn5M Baj8DPzyr+1/Bx0wavkQCiVqCm5/Pyw= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-aKGhxRrCOlelScQCfPtmqA-1; Fri, 06 Aug 2021 17:24:03 -0400 X-MC-Unique: aKGhxRrCOlelScQCfPtmqA-1 Received: by mail-ed1-f70.google.com with SMTP id a23-20020a50ff170000b02903b85a16b672so5601947edu.1 for ; Fri, 06 Aug 2021 14:24:03 -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=1w+P82Tvwhwr5BqTiweZKyZhEfP6JktMBQ5MU886dMM=; b=SH3IU0sm3WyJ1GtWSg7fd5QkRIlND5+ww+92FEg0h3K4+5U8w6/HtbFW0ZizjnaZHa +R5umKWx+B9jbd053Z12205NHumvHjwc8YJc1g9wiPUO9QyyCFRiBW5etKWe3VJHckoc 3nnCS0P9JPrHOQtWJvMOptVs+6/V9ChI7pekYqq+twwWuLDum98I8kipcCDkDLh5rk6y FA/KbLCcmBFXvK1h4jZk2oFeLVzRLvxyo0CmRGuc9Dl6xkqI3J2/8Au4AxIIVj94if/y NJ1mVl1XGCAlg5tGfNQzBZECVqfdfBFyKVq+i7fhYdfsT55rPKib7V0jX6B88TRWnPUv k36Q== X-Gm-Message-State: AOAM530oKbXxD/yHCAfLWKQUQtgTBjw+U4lNvzI6sdu25HYMgWKYeHpc tWNamIRM/lDTWvQPX+INpPCUVznv43QX2luKcg5cxKuwol3rbBheKLiFjSuPVdPi+7gB5XM0SB/ PQK0b23G+OMI4FAAADGBb0w+UuoXZ6NunGbslMOf2itFUtUZ8htNlZGG2nf1JrF1IDo9QKeA= X-Received: by 2002:aa7:c40b:: with SMTP id j11mr6480865edq.253.1628285042374; Fri, 06 Aug 2021 14:24:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynv8xJD6ckiQv3zGjeFJIfstSsDqihXf4/Ifg2K2WkniEekOuk5m68ZTVu1zdGqF8zHk3cUg== X-Received: by 2002:aa7:c40b:: with SMTP id j11mr6480855edq.253.1628285042187; Fri, 06 Aug 2021 14:24:02 -0700 (PDT) Received: from localhost.localdomain ([84.19.91.9]) by smtp.gmail.com with ESMTPSA id og35sm3256741ejc.28.2021.08.06.14.24.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 14:24:01 -0700 (PDT) From: Pavel Reichl To: linux-xfs@vger.kernel.org Subject: [PATCH v2 29/29] xfsprogs: Stop using platform_physmem() Date: Fri, 6 Aug 2021 23:23:18 +0200 Message-Id: <20210806212318.440144-30-preichl@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210806212318.440144-1-preichl@redhat.com> References: <20210806212318.440144-1-preichl@redhat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org --- libfrog/linux.c | 8 +++++++- libfrog/platform.h | 1 + repair/xfs_repair.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libfrog/linux.c b/libfrog/linux.c index 43ca1e7d..9b99d1a7 100644 --- a/libfrog/linux.c +++ b/libfrog/linux.c @@ -338,7 +338,7 @@ platform_nproc(void) } unsigned long -platform_physmem(void) +physmem(void) { struct sysinfo si; @@ -349,3 +349,9 @@ platform_physmem(void) } return (si.totalram >> 10) * si.mem_unit; /* kilobytes */ } + +unsigned long +platform_physmem(void) +{ + return physmem(); +} diff --git a/libfrog/platform.h b/libfrog/platform.h index 42b0d753..b034d652 100644 --- a/libfrog/platform.h +++ b/libfrog/platform.h @@ -26,6 +26,7 @@ int direct_blockdev(void); int platform_align_blockdev(void); int align_blockdev(void); unsigned long platform_physmem(void); /* in kilobytes */ +unsigned long physmem(void); /* in kilobytes */ void platform_findsizes(char *path, int fd, long long *sz, int *bsz); void findsizes(char *path, int fd, long long *sz, int *bsz); int platform_nproc(void); diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c index fbbc8c6f..b8d56d9d 100644 --- a/repair/xfs_repair.c +++ b/repair/xfs_repair.c @@ -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) {