Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp50806pxv; Thu, 24 Jun 2021 02:32:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwX8tXjelRruZ+eo4WbKK3jDVRtSyT6D6A3VRuQZJUknOnrDgvgDdUqi8TbQ0th8fokoqqg X-Received: by 2002:a5e:8a41:: with SMTP id o1mr3255048iom.92.1624527162568; Thu, 24 Jun 2021 02:32:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624527162; cv=none; d=google.com; s=arc-20160816; b=uSVQord4Fk+ljUpVX3Nj1e0B/NxUh7wWvWb5OlQ+7Z9nzuOip4B83MN0uxdejqszf8 bqUCzzmH0cwplRnHDdXLKsf6LmY4plIkYO9sga47EpDjiH+dqgSQJXSbc7jNiPL/5DzS bwTPpZwt8P/EilkFbGk65tM0rNif83Rc7E49BZGR/en5HFk7k2fL2u/ERFjDMyvi1Spc OPVYkeOYJ+ykL26YAlEC7103LGtgJ6FMgDDQMW+IkW0ouxnfipNAv24dDzD8BBHuNQXm xmFHPZhHUibXQICuxS3o3Mp0pO+w9p311JEFc6siDQnJM+GN949Yww1MEk9A2aQjxqCp +tDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1FgVXBRe9Eib/6+6TU724QP2TN13wssG+1MCZOfbyZU=; b=JxrVUbCg36qUnU4+uwt6LEL6FH9L6s1P9upDIF0sR4dddl5vIYkIT448+TY3i8S2+4 KOiTMKA5SSbbKqVs5Ru+KfaqkgE7YuuX6r4dk/RTMqv8pxWfUey/GATS79VEMCUlHhNl f5wlb8Oeuytc+9OLYm1Ea+oOImf+B8Vwlu6YgynO/AM4++O4DMGOkviRftZ1CtWq6RqN GXmG7dBO3mJDYAMTbLOxN9he0QKWNjprd6p/Dwhnpd1g36b2xtl+9sh3bJXJebRuUy35 NepB1V52TL4jn2HIbp9fqdakzfSXvKgC6ykRQ1Nm2btxoy77W4AqbUZH+EOCR3lthgRD xqbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si2417426ilu.2.2021.06.24.02.32.29; Thu, 24 Jun 2021 02:32:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbhFXJdz (ORCPT + 99 others); Thu, 24 Jun 2021 05:33:55 -0400 Received: from mout.kundenserver.de ([212.227.126.131]:57041 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhFXJdy (ORCPT ); Thu, 24 Jun 2021 05:33:54 -0400 Received: from [192.168.1.155] ([77.7.27.132]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1M1aQN-1lzNx301vv-0038oh; Thu, 24 Jun 2021 11:30:02 +0200 Subject: Re: [PATCH 09/14] d_path: introduce struct prepend_buffer To: Justin He , Al Viro , Linus Torvalds Cc: Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel References: <20210519004901.3829541-1-viro@zeniv.linux.org.uk> <20210519004901.3829541-9-viro@zeniv.linux.org.uk> From: "Enrico Weigelt, metux IT consult" Message-ID: Date: Thu, 24 Jun 2021 11:29:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: tl Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:sfvpKXDvULCjkaT9y937Ne5z1GzyOh9VPvzaOLJhF711BVKrxXE f7pUlG4so5Lu5QVaxlpQ2EL9HlPzxRK+AUMobdzoHIoDqRHY1aZB144FoW/ZwiXoEgl48ze AGdnd2i+XzkZyMjmzkqaZNScRJjYVhQ245nlW5NIEt2vw7fLjJq9X4kI4JwNVnJv+1YTwOq dC5faiBRfFkNqGZh+sv/A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:veNOQNF1Dic=:Bw67innQLSKyp38PPApyoz qkcVF04DbgFNG6/wlk4Q6bSVdWbcXxklL5Rt32Vr1L0tXBqbrTfJAgsnBZkCHfqdYwIinD2xs Tn0x1VjHNWOT+9rOglTzxbnuSByKb2XDsa6CXqGPYo5cbiGdC/8aehbtBsftzci2SCZYBip/k TOrplAElsbpsxalCqChiK4APit7eK4g+l0Joen26PAMan8wD1N8j0ysMN2vVYdbk2qIYXUke/ lyNh9KE70mmCBoteyuN5vBMikoAhincbsmp9SEjqiKS5De4DkIY1QH9UVxItKrIDlaI9pfEHD VZ5TJdTSlKliAEIdjj2G0dsofuk8GpnoYWg37blWDuMwESvj7/iSFa0bKbCaWiMuxuvEdD7Fr FBJJoe/Ulm0jSvmdh1WGloCnW7AbngUjUCVesgkNH780rg5CiIJ/Tz0YqFQ2mHTCPdKIjuywk eKqI1GOY3s6TzBTc8J/QXuYAs15vPEGjpuCWjpDXmCcCQk9UNe3Nubc+AIumK6pQTogzKJoam ZNIOVYJtMSeljuF3KU57jY= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi folks, >> We've a lot of places where we have pairs of form (pointer to end >> of buffer, amount of space left in front of that). These sit in pairs of >> variables located next to each other and usually passed by reference. >> Turn those into instances of new type (struct prepend_buffer) and pass >> reference to the pair instead of pairs of references to its fields. >> >> Declared and initialized by DECLARE_BUFFER(name, buf, buflen). >> >> extract_string(prepend_buffer) returns the buffer contents if >> no overflow has happened, ERR_PTR(ENAMETOOLONG) otherwise. >> All places where we used to have that boilerplate converted to use >> of that helper. this smells like a generic enough thing to go into lib, doesn't it ? --mtx -- --- Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren GPG/PGP-Schlüssel zu. --- Enrico Weigelt, metux IT consult Free software and Linux embedded engineering info@metux.net -- +49-151-27565287