Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1262816rwb; Thu, 19 Jan 2023 08:28:38 -0800 (PST) X-Google-Smtp-Source: AMrXdXsmsJ11WjBDpOey/s3rYA4WmWsu1/jvCQu5OTwc4SxkFycdtnsPl1KWGF4j7LtOFmCD1uGk X-Received: by 2002:a17:907:c307:b0:84c:c121:dc53 with SMTP id tl7-20020a170907c30700b0084cc121dc53mr12840628ejc.34.1674145718368; Thu, 19 Jan 2023 08:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674145718; cv=none; d=google.com; s=arc-20160816; b=uT053sKIUoSwt0VuEfufaDT8WIHVvyL9ImwrK+a7W/y7Sinswbcj+Ke8pPKGYxMW1+ Mt2NTrKfFDL8d5MuwJrVwBdo+ryM6EVvG21tBpkQL6udZVvvIyRGLHNvvYaa4zJ9ph/A ZbmQZ8LrThv9ZMexa0LAo6fxrrkAVan6fGmzudVRd0ViE/k9cqGrf/aFxm2qiXWOLHqV 3ezg/sqG4CDZTXJw8dNdhro1gq3ohCxFNUj8dnXHgiTBBXFQH1Cy1/1R+pQI9Fu5hLFG e7DzLExrfyiJXRZiTliaRP6kpuZN5X4y2gUcWQsYv5L735ths5Rngh8C1k/f3G02GGz4 EhnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZBbyUyezGmLPHORAlrPKLDLc/sGr6JdTGOI5HCWdOJI=; b=yOZ5P75BmG7s4BEMJTKGVhNY17syEq5E8GL9JYeRQFAO3GmywcbWyM+/vmIi+dabpk JlmB+Vl+wj9vv84EoOoCiZHE6kcItPDH90x7TWtVR4UzoFyIMQ7kzxdy1fmUeNMajmsT Xz8sVsS3nwm4GbsacHTiYSHXkXpD6miDk+uvJFWTJlG6Wt4HkEagzse1ruTAOfXFASsH p54wNTuOag9n6UsuWrbT3O7JZhFXva0WHilGYFAkAbZjoozif3m2gJvyEKpawt2KOX1u jSTDA1Jm5d5elPFYeEnMxxE6nCTmXsxyIIQRhCiyhl/EcEiwBZNFdJeHzQopsKQmf/CF 65QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Zb4W1DR0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb8-20020a1709077e8800b00870d15ac2d9si14958929ejc.163.2023.01.19.08.28.27; Thu, 19 Jan 2023 08:28:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Zb4W1DR0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229615AbjASPdR (ORCPT + 45 others); Thu, 19 Jan 2023 10:33:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231151AbjASPcq (ORCPT ); Thu, 19 Jan 2023 10:32:46 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D42D5829A2; Thu, 19 Jan 2023 07:32:42 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id o17-20020a05600c511100b003db021ef437so1530522wms.4; Thu, 19 Jan 2023 07:32:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZBbyUyezGmLPHORAlrPKLDLc/sGr6JdTGOI5HCWdOJI=; b=Zb4W1DR0WbGbQaQFmXiwmCKgvqi+27mlbiyT9j0pPjUba1LC5ofQ9Zp+rj0MfYujmg qUzVIEnz/BW9G+Nri0LPa+70ypVEweExCJaMleEhyjuEl0TR5XzvNwnbYouQ2mgu0aFy gm7jnUlgw9pPMdfI1whxla15dgw3yvITz19ehjGhyWb9f1l3prafBHCAUR8M7khjZJ/8 h7Ffi7dfljxThwoYCAql8ZZG72eGwXwvZV6/o75EP/EElO0qeOwQX+Fijwvgpupvmb2A TcT8iglRPveJzh4p6BOGWrZiGqd3FyG3Xerm9pVdRX62Zu1X6p2e4rnSwoCScToFXosf 8rWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZBbyUyezGmLPHORAlrPKLDLc/sGr6JdTGOI5HCWdOJI=; b=awsX0iYCQB5b2Ei3jYs2SSulCNogcbdG7/thWEKCRj7OwakdD9321IeqrBGNAvWigh LWr/QhB9qK50hywV8c5W7xZ2mWPsi9CB6KrDueAUYSh9MeJCvqjIjFU8WYLEnyUVoNbu UKEVyFELwL1qc+w0aOeSYVcuXdwzEjnngHT9+cUsPL4ryFc/bMXn0q8hwM83UnR7ztZx UYXgkwXSmvk2N04TyhmUg2f0W9VdrsRGaIfVx7f5TSbxtXL8d9TJoKp1R2hbYZrRRHau X6p0en3+DnTSsUAK2lVbe+p3qcoCGsv+Papl/eLqU7GcOxnuwLe8wMlqel4c5pQg4oql hSmg== X-Gm-Message-State: AFqh2kqQVgNlCKMHyNmdCDllXCtw7pSBj8A3bVDLS/lce2pr4pmEHKoW YXftyOzfkGQMlryad7dLNm0= X-Received: by 2002:a05:600c:511f:b0:3d0:bd9:edd4 with SMTP id o31-20020a05600c511f00b003d00bd9edd4mr10683912wms.0.1674142361117; Thu, 19 Jan 2023 07:32:41 -0800 (PST) Received: from localhost.localdomain (host-82-55-106-56.retail.telecomitalia.it. [82.55.106.56]) by smtp.gmail.com with ESMTPSA id k34-20020a05600c1ca200b003cfd4e6400csm5827815wms.19.2023.01.19.07.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Jan 2023 07:32:40 -0800 (PST) From: "Fabio M. De Francesco" To: Christoph Hellwig , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro , Ira Weiny Cc: "Fabio M. De Francesco" Subject: [PATCH v3 3/4] fs/sysv: Use dir_put_page() in sysv_rename() Date: Thu, 19 Jan 2023 16:32:31 +0100 Message-Id: <20230119153232.29750-4-fmdefrancesco@gmail.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119153232.29750-1-fmdefrancesco@gmail.com> References: <20230119153232.29750-1-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use the dir_put_page() helper in sysv_rename() instead of open-coding two kunmap() + put_page(). Cc: Al Viro Suggested-by: Ira Weiny Signed-off-by: Fabio M. De Francesco --- fs/sysv/dir.c | 2 +- fs/sysv/namei.c | 9 +++------ fs/sysv/sysv.h | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/fs/sysv/dir.c b/fs/sysv/dir.c index 8d14c6c02476..2e35b95d3efb 100644 --- a/fs/sysv/dir.c +++ b/fs/sysv/dir.c @@ -28,7 +28,7 @@ const struct file_operations sysv_dir_operations = { .fsync = generic_file_fsync, }; -static inline void dir_put_page(struct page *page) +inline void dir_put_page(struct page *page) { kunmap(page); put_page(page); diff --git a/fs/sysv/namei.c b/fs/sysv/namei.c index b2e6abc06a2d..981c1d76f342 100644 --- a/fs/sysv/namei.c +++ b/fs/sysv/namei.c @@ -250,13 +250,10 @@ static int sysv_rename(struct user_namespace *mnt_userns, struct inode *old_dir, return 0; out_dir: - if (dir_de) { - kunmap(dir_page); - put_page(dir_page); - } + if (dir_de) + dir_put_page(dir_page); out_old: - kunmap(old_page); - put_page(old_page); + dir_put_page(old_page); out: return err; } diff --git a/fs/sysv/sysv.h b/fs/sysv/sysv.h index 99ddf033da4f..b250ac1dd348 100644 --- a/fs/sysv/sysv.h +++ b/fs/sysv/sysv.h @@ -148,6 +148,7 @@ extern void sysv_destroy_icache(void); /* dir.c */ +extern void dir_put_page(struct page *page); extern struct sysv_dir_entry *sysv_find_entry(struct dentry *, struct page **); extern int sysv_add_link(struct dentry *, struct inode *); extern int sysv_delete_entry(struct sysv_dir_entry *, struct page *); -- 2.39.0