From patchwork Fri Jun 28 02:41:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dominique Martinet X-Patchwork-Id: 1953667 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=mRsQWbHu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2607:f8b0:4864:20::439; helo=mail-pf1-x439.google.com; envelope-from=swupdate+bncbcwivbv7sugrbbog7czqmgqe5mibt2a@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-pf1-x439.google.com (mail-pf1-x439.google.com [IPv6:2607:f8b0:4864:20::439]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W9KTk51yBz20Xf for ; Fri, 28 Jun 2024 12:42:18 +1000 (AEST) Received: by mail-pf1-x439.google.com with SMTP id d2e1a72fcca58-70679e6722asf168934b3a.1 for ; Thu, 27 Jun 2024 19:42:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1719542534; cv=pass; d=google.com; s=arc-20160816; b=bJbttDxv6xgZLk/6jVrdlsXPC0akKfbdY10b72uv92SCYzPBZ3V9m1CbvNaM08G2e+ gYlBxEElHyvZTkpvtSmi6i3TcWsgqKLmcM7k6tyAig/aQoZgV6I3Fd6XRPZKpqwtCWwX l4EB2IkyGmnX23gVN+6sQRkREO0EhiXR3LLNDlk3sk+QLR8u92XPhnj15WRdAh4PuxNl TgVlN34/pM1h0TfEHEq36rOsnKeVQD/AleJb/pbcNyM9XBFQDCrYgLgEczYBx3g9cdoY Q8ubiazgu+8ZsGtPC3IJKRQ3lpAl2jcex18CoZ/fUIL9t73KM1XtTEURgOGmHqNTUOmY 9f4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=pNto6WlrBRCFHsClmZVlErG5EkQzdPnj3231NYC+zvs=; fh=Bgs749SkAGSEbRN6jsyWYWzjjHL4hoQpGKWaow2YYiA=; b=rhlacqp0NNwvmXBbk0Om5kDxkHpQu5y5WA4KlSIRfWz8xB7mT/CULoSHLIuT2lbBZe x8pMYo+W7rkAL2oOP56hDiQReQegrT3iqRf855nnEVPEpcihOgpPi5sqTnSiRZhwUG1m sZiXlhCJjAUsAp5pOd6gHjYh4Pad3KFIpjjqUyYWHDnnS+cuYVfgidCX5d5ezDociU0x gnRdWiIwmI5l/s+y35+D0IX11NXWkOfiJDTPY3rdjCJFifrfqZWvMgEPjc+aplfKWmYf vjgKn0L5Ry1hdSFFdd1OsrD147PGtVk9V6O+F5UyJP5abBGidAi/TxQ/SGP81LpyjIEc 6HLQ==; darn=patchwork.ozlabs.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=vKVrjQSL; dkim=pass header.i=@atmark-techno.com header.s=google header.b=fl1ZR5ZX; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1719542534; x=1720147334; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=pNto6WlrBRCFHsClmZVlErG5EkQzdPnj3231NYC+zvs=; b=mRsQWbHuIA97g+Jt6bunqqHNrbnWZqMLsYel2GfbuQAdT9LzeIsJcvu8aIOCF/DotD ZXVhZSs/ndq2hMvQTxXlB619dkstI3F/HYqH3z1jUS7qaXa/te/Zs4vm/Gwhl+pJkXeV U+OoWsnfyKftAzPudDPNBAjLFItcMiZr4atIqgn5CEh3VMY0Aa181xZ+xjbgkQzCuEBH vyYoMEB8ygiv5QPCUS4Z3+qdImKhhwiX8Np23wXtKpzw9CO2h4DEuAwllAT7/mRZtvNV lddqmpXlnbQkwUo3kx52XCb2IuLqLKmEpLpaTmQYfnFf+ZkVrVQdnR2QS0g21rjZnTde anbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719542534; x=1720147334; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-beenthere:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=pNto6WlrBRCFHsClmZVlErG5EkQzdPnj3231NYC+zvs=; b=hwVpensO44ML7wMO73YGd42QjanV/q68VL4OprgQgNzNakmTk+WL3D0tP5bk7aLgrR VE9rqdm4kXXaP2ydwNMIzbQ1vNDopt10+f8r+jALZVBMcSo1ktQCldsoKQtn0daHnsS4 N0nXQJuQL7Za3vR9b7XrKx+3KmTiGnBkQYplCB0kDEHEhg/SJgYSF6dnI4FELeVqHNiY lWbpv07q4sr2mFUoktX1gWiXXl0GJB/sG1QtzfvhJoKeGEZ4nVpOtF9AzfIggrDboYbo MrAYOzZkqd6WGOeGkZBnR0pyYMKc5ZO07sCa8T+kMxdkSbQxc6aH/AcLgv5mDr5Nmv4n 0QKg== Sender: swupdate@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCUS0hCK9mDVO+htFDCfBDoUMpdtVmm7v2MQaoJhmlgkWiioadDFzmX9k0m25huO+lMQAhxGuWa6HNFha3uVfBBVWlx90u5H/40VUtR2sA== X-Gm-Message-State: AOJu0YzaZKNCj/Uyt8OVTTxa0MglaFx9lJueGodjo6bcL057OWsGczRo TP0b6PDuTkwaivg3vMBq9F9fuDkJAIIP4MlhYha0tM0R6lBLAjRT X-Google-Smtp-Source: AGHT+IHOjXjrFXJ8CZr5UNaU37UaCOpNzcYFfP9dOYxmFpN+yBMwEpIT8RlVdjJfhoF7261JfAIAcQ== X-Received: by 2002:a05:6a00:898e:b0:706:7797:27ef with SMTP id d2e1a72fcca58-70851384bb7mr543561b3a.1.1719542534051; Thu, 27 Jun 2024 19:42:14 -0700 (PDT) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a05:6a00:c8a:b0:706:7c96:9d35 with SMTP id d2e1a72fcca58-7081918a96cls229293b3a.1.-pod-prod-00-us; Thu, 27 Jun 2024 19:42:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU3d0Ec43PIdaOHbdT9r0sl03vs3sGyj8KTBM/U4Y87cg67U7gnM8VnsEU9codzEawWPlmKRxzfbMZ1OnwFaQxWYQYjOlpvIn6g X-Received: by 2002:a05:6a00:929e:b0:706:3d61:4b21 with SMTP id d2e1a72fcca58-70851576cbdmr660872b3a.3.1719542532493; Thu, 27 Jun 2024 19:42:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1719542532; cv=none; d=google.com; s=arc-20160816; b=s3tb8ozITGKjRGcQ4AQaWSooq+HWDQ0POCjW/v7ANdz9PtjjoV/l2xX6uq+cwrKnGS TekaDYE06kvD8BWYR76ZLaCZ8Z/l6LCNqGq88VveUTm0trkHiOpEuVN4gGxOVdaxX7iy Z4Qzoiys14IixQz7HMgHZSLU2IS4u+lNwujNuKGqurhgw7Jgrd6atwlYqniCSz2CMkl9 +64r9fjk1q3ZA2CbcZzWhgkPqsCnE42C3npHcvFdMf1/iaCDaJAWSKcLS4ykU9VdqBSw 5SUevg480PwBnhu2Z1HPZypQFU69iBTziHkitGzWKjF1V/iaSa9CKgUWRikuV2D5HC69 Nx/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature:dkim-signature; bh=aTumk1Efi+1g5RfFGNWmTRoxDqUShSle3DRdxcY2pmQ=; fh=SE/gun1UhEzEIFSO0L518Y/hYwludhYYRJqBG4ZFxO8=; b=gYSgDN9FelKwCQl5tvDPbiuoVSYoZYZGOtjo2iMnsKslDg6Qhjm5oDL01NZKIbgfZ1 nAw0kfUiZfRjFVkcKzTA1cN3/MEZdysT0QaC57B9vo/dsdN2/PyObP7A9i61/k3qVb6Z +dTH0ixXY7H8/LK2UJzJE3j3InEMzbsqvn/PhIpr1fDfxLukFIk+64H2K/ISc3xEy0HF hObbLD+aJ8sjsvf7EfdJEPI6MSjR684RsLDMTTAtGLWCo9Hv1b0hTrEZK6wLrtV/KdTh 2DlVyIK4oZ8eldg/mB6rp3xgTLQsc9EcjqV31lsXTumMHMP2d7WqpAQzF3INYg26Llej Ytiw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=vKVrjQSL; dkim=pass header.i=@atmark-techno.com header.s=google header.b=fl1ZR5ZX; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Received: from gw2.atmark-techno.com (gw2.atmark-techno.com. [35.74.137.57]) by gmr-mx.google.com with ESMTPS id d2e1a72fcca58-70800fada07si44125b3a.0.2024.06.27.19.42.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 19:42:12 -0700 (PDT) Received-SPF: pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) client-ip=35.74.137.57; Received: from gw2.atmark-techno.com (localhost [127.0.0.1]) by gw2.atmark-techno.com (Postfix) with ESMTP id D68C12AF for ; Fri, 28 Jun 2024 11:42:10 +0900 (JST) Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by gw2.atmark-techno.com (Postfix) with ESMTPS id 8537D2AF for ; Fri, 28 Jun 2024 11:42:10 +0900 (JST) Received: by mail-pj1-f69.google.com with SMTP id 98e67ed59e1d1-2c7d46d273cso185495a91.1 for ; Thu, 27 Jun 2024 19:42:10 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCWNzaxsTlSGLJ7TB2hDIJNO/JV2WbRkxosQf9SkTMrT47X2vxI292uLIqCHYrlfUfEY1be5Jerz0IQ4wn40aIW2lMiwfCpZ/GEt X-Received: by 2002:a17:90a:17e6:b0:2c8:8bf8:4e24 with SMTP id 98e67ed59e1d1-2c92765b57amr596964a91.8.1719542529498; Thu, 27 Jun 2024 19:42:09 -0700 (PDT) X-Received: by 2002:a17:90a:17e6:b0:2c8:8bf8:4e24 with SMTP id 98e67ed59e1d1-2c92765b57amr596936a91.8.1719542529037; Thu, 27 Jun 2024 19:42:09 -0700 (PDT) Received: from pc-0182.atmarktech (162.198.187.35.bc.googleusercontent.com. [35.187.198.162]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c91d3bc994sm498669a91.46.2024.06.27.19.42.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Jun 2024 19:42:08 -0700 (PDT) Received: from [::1] (helo=pc-0182.atmark.tech) by pc-0182.atmarktech with esmtp (Exim 4.96) (envelope-from ) id 1sN1Yt-007bPN-0R; Fri, 28 Jun 2024 11:42:07 +0900 From: Dominique Martinet To: stefano.babic@swupdate.org, swupdate@googlegroups.com Cc: Dominique Martinet Subject: [swupdate] [PATCH 0/2] further copyfile cleanups Date: Fri, 28 Jun 2024 11:41:58 +0900 Message-Id: <20240628024201.1812065-1-dominique.martinet@atmark-techno.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Original-Sender: dominique.martinet@atmark-techno.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@atmark-techno.com header.s=gw2_bookworm header.b=vKVrjQSL; dkim=pass header.i=@atmark-techno.com header.s=google header.b=fl1ZR5ZX; spf=pass (google.com: domain of dominique.martinet@atmark-techno.com designates 35.74.137.57 as permitted sender) smtp.mailfrom=dominique.martinet@atmark-techno.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=atmark-techno.com Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , These two patches are also part of the serie I had sent as RFC previously, but are more intrusive / have less immediate value so I didn't send them in the first batch of cleanups. The first moves out the hash comparison code in a subfunction, that my later code will also use; on its own there is not much point to it but it doesn't hurt either. The second patch was more of an itch I had, seeing 13 unnamed arguments to a function makes it very hard to update all callers properly without making a mistake so I used a struct to allow for easier updates: adding more optional (0=off) fields is transparent and this will make further additions much easier to do (and allow my off-tree patches to not cause build failures every few months when a new handler is added or modified) Thanks! Dominique Martinet (2): cpio_utils: move out hash comparison in a helper copyfile refactor: replace the 13 arguments by a struct core/cpio_utils.c | 204 ++++++++++++++++-------------------- core/installer.c | 19 ++-- core/stream_interface.c | 24 ++++- handlers/copy_handler.c | 20 ++-- handlers/delta_handler.c | 29 +++-- handlers/readback_handler.c | 20 ++-- include/util.h | 40 +++++-- 7 files changed, 188 insertions(+), 168 deletions(-)