Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp332022lqd; Wed, 24 Apr 2024 03:59:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV8xRgMzsdzUgeGUOY16f3SKp5MSpra6zGukvUHExR5GA0n2369ubaAHRoNVxoaT6nhq3phuVlPo0dqoMbLXlK0neTo8xBrc0TlzLfICw== X-Google-Smtp-Source: AGHT+IF7sjXsbPPDKvhUDO8cPbINjEszBpPO5MT/ceFqhM2oVGjsg80zUTe3TWkvUntXBiiLcLpe X-Received: by 2002:a17:90a:b28a:b0:2a5:d301:8df8 with SMTP id c10-20020a17090ab28a00b002a5d3018df8mr2078397pjr.34.1713956340548; Wed, 24 Apr 2024 03:59:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713956340; cv=pass; d=google.com; s=arc-20160816; b=pEGxBcyv9II/iBe96N7HohKhzJJXY3dGPjMAcvqmb3GIATOtWPVb8HdZFVXfRESEgS 4G5Yp0dpSlhlNlENufii3/WWSdvdwgaxUa3xyltlZ8IgRr501SnL9x0KOzifqIPa+78+ ayAXXuAeOJfQiFSSLtpfK6Cq9nr1bsLZcYi7Da7HpULqArwSlbh08yTQY6mGNvrF/zzi xXlr8smRh+IhpofcP8gMSEUHni/noj2sv4lmPSVPo2scpmOvz/g3hS8oWslDDRe6NC32 ccy4Fh8bdG8Cpls0Yk7aXlzPFh1ocnpiq8xgYtKLbTCJqqI7Fhhs14lJDYs9Oggckiaf 5sAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=4BFA1sAD3ohdn1FKW4iPGQkacFKBfyHkGIvKIFJupi0=; fh=NySCH7/axDSsvKH5eWjD8oGxIOmKr43BTh8gGkXCIC8=; b=cFyWU/avJdk/HGBde8zGf2Jsaq3tvfz0giMkQBg5CqZ4JLwOoJYf9rLW48sRswJn4m 50Clqjntyu7n8ECF2EekxmGxDyEz7WyYWibEZVAJdYPW45RZugjBSqX519igxoEISGkq vMWKXYtZC0SMSY1N+n37JjSP4DWbZ13KhgtygyT4uaE7rLI7Inc82UgPOljmZwpq7pmk SeIzO/+fPwhHa9OgYM/CSuTIHFPABHNtaYmwiSml3EtTIIWaabfYjUkNy/wFVgWnPS0D DXKYO2cJBqqqRCfQm9490fjdavDVPmAQt+Mg0Mqwr6HOR2NfxayrNIvBXHIaCrWYuUJh KdHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=OADCJtgd; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-kernel+bounces-156765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id g6-20020a17090ae58600b002a64eb193d2si10952101pjz.69.2024.04.24.03.59.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 03:59:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@yandex.ru header.s=mail header.b=OADCJtgd; arc=pass (i=1 spf=pass spfdomain=yandex.ru dkim=pass dkdomain=yandex.ru dmarc=pass fromdomain=yandex.ru); spf=pass (google.com: domain of linux-kernel+bounces-156765-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156765-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yandex.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 34509282512 for ; Wed, 24 Apr 2024 10:59:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FF9A15A49B; Wed, 24 Apr 2024 10:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b="OADCJtgd" Received: from forward502b.mail.yandex.net (forward502b.mail.yandex.net [178.154.239.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DFE715959D; Wed, 24 Apr 2024 10:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.154.239.146 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956324; cv=none; b=rJsak6qgPGwNqGZ2IHjxPuASjgZ6CwZlEiS7q5fxH3/eEix0Btlrynjuw0CcQHw9eWlmcsGmgwlQw9Mb+/kmfgAf0h6lwwTanYVCdNVLciK5YEkeScz4/stpoh9fYOEB0BjVy8y+4g4s5Ry/w3T0d+tfczLYBJngZx1teTd1++E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713956324; c=relaxed/simple; bh=6LVH3PMc3HV4V2K+Dpc6Qj7ZwEmZNYbYIZFfgi+/FHc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Ua4vG0/DctKB/DQRXVwUeZafKHIYcOGIbk4HLibXM8M8Gqnml0fCHSa4cCjVPoVms5s21srI2dpNF4W+XdZfCdo9WuMkaqA/CDBCwGzn0veL9JMJJtav3My8FM7hvgZtsJix2JkNuLTo9JpzmsyydECXSWHPvpOP55ITtUh6Ri4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru; spf=pass smtp.mailfrom=yandex.ru; dkim=pass (1024-bit key) header.d=yandex.ru header.i=@yandex.ru header.b=OADCJtgd; arc=none smtp.client-ip=178.154.239.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=yandex.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yandex.ru Received: from mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:b1a0:0:640:e983:0]) by forward502b.mail.yandex.net (Yandex) with ESMTPS id 178145E9F6; Wed, 24 Apr 2024 13:58:40 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id cwIcqh6n3Cg0-0uZpi2sj; Wed, 24 Apr 2024 13:58:39 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1713956319; bh=4BFA1sAD3ohdn1FKW4iPGQkacFKBfyHkGIvKIFJupi0=; h=From:In-Reply-To:Cc:Date:References:To:Subject:Message-ID; b=OADCJtgd9oliRn+jzQHPuuXfudrvWU+UTsJrTT3QfKTBqJ0y0vuQwlDb9diZRqda2 hDlXLaJQ0y6aN8W9udExpL2ldrd8i4qhMY/dZH8gicqlfaNLhCdqIX8GkwtZw+t9xU JiQaarBJixNpo54b9KU65AjYgRR0I26pwfY5pH78= Authentication-Results: mail-nwsmtp-smtp-production-main-85.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Message-ID: <6c9e5914-8dee-4929-b574-f59f50305f4a@yandex.ru> Date: Wed, 24 Apr 2024 13:58:38 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] fs: reorganize path_openat() Content-Language: en-US To: David Laight , "linux-kernel@vger.kernel.org" Cc: Eric Biederman , Alexander Viro , Christian Brauner , Jan Kara , Andy Lutomirski , "linux-fsdevel@vger.kernel.org" References: <20240422084505.3465238-1-stsp2@yandex.ru> <858f6fb6afcd450d85d1ff900f82d396@AcuMS.aculab.com> From: stsp In-Reply-To: <858f6fb6afcd450d85d1ff900f82d396@AcuMS.aculab.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 24.04.2024 12:17, David Laight пишет: > You probably ought to merge the two 'unlikely' tests. > Otherwise there'll be two conditionals in the 'hot path'. > (There probably always were.) > So something like: > if (unlikely(op->open_flag & (__O_TMPFILE | O_PATH))) { > file = alloc_empty_file(op->open_flag, current_cred()); > if (IS_ERR(file)) > return file; > if (op->open_flag & __O_TMFILE) > error = do_tmpfile(nd, flags, op, file); > else > error = do_o_path(nd, flags, file); > } else { Posted v4 with this code verbatim. > Copying op->open_flag to a local may also generate better code. Done this as well. Thank you.