Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp261651pxa; Wed, 12 Aug 2020 00:57:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyS7TPiUSbkYch4gbYcbQv4u4QxWgSHiMc7SACaulxpkm4s/tGd6TG2AVX1EbPGfutEehZu X-Received: by 2002:a50:9fe6:: with SMTP id c93mr28808515edf.286.1597219043551; Wed, 12 Aug 2020 00:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597219043; cv=none; d=google.com; s=arc-20160816; b=OGlMWB3NPpv/o7V293z/xc2kcNmPTRAKIg/gucjutPi3WgNmgTdUK1XcpzlvY2mNRB k14/1Qsc1hy8HVq59Fn4U09Kq/O8e7L7r8jWFJxXQQUPnQ1l2WqpguO5d6z0hq7wByks OZXNL+2HSHn43XxTBGto6KAIxm1XY/TOitdVr4FRbry1azSFk00qDelo8VwxpSHsa+OM 9AfK1RM+oy+k+QBhXI+RNU4tz7EaP0OBNh0dj1pJSHMa6fApVwGxKSxMya806WAhEaLj 6Z3HU5Lpu4Fb9LTTt6cCLnuQunb7O4XrxZ+6iRaeWwPyghzJoga04z5y6/kIJUnf5gUB ob4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NDkDdVENPHITasYSBRU0u7LO8tRkihQ4z/zsle3BKDM=; b=WyKjNSyPiaaiChu20iZ503rDR9jtqii4G/z8CD0q2HmrzAsN4uZsGQ7KbeV6KdxVp4 T4JolF6ZJgpVyw85xd8JSPZeQwAznrvTlIaGoWXvnAc0NV9N76ISKSFUqUEcr2zeobjO VczO8x+moHkMVA8445YV8GWhUXmcq0D3NV9iDgxzRxXalKUPmXbHlueI3ZJCQAWVjUxc BOKPRTtKZWJBjPuvPTfsxWKKuYao9oydYLEstuma4sl3K7B3DCzVEEzq7LVYA91jZk2e /l1BYotSRehyWZM9zMAaIvfZHkog1ClRAo4hrILhV6YthR8wJK2jku1TOVHj5KGiYKfz tzPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=FcyMnz82; 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 a1si768822edn.356.2020.08.12.00.57.00; Wed, 12 Aug 2020 00:57:23 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=FcyMnz82; 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 S1726806AbgHLH4H (ORCPT + 99 others); Wed, 12 Aug 2020 03:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbgHLH4G (ORCPT ); Wed, 12 Aug 2020 03:56:06 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE111C061788 for ; Wed, 12 Aug 2020 00:56:05 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id t10so1210109ejs.8 for ; Wed, 12 Aug 2020 00:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NDkDdVENPHITasYSBRU0u7LO8tRkihQ4z/zsle3BKDM=; b=FcyMnz82AtZrn2stC6Sl+f2PRHcZZoUGt3wuUZSk5ELWTNbgax4eDZ49GeMmHZunvH rljYXQFu7im4PZdzdO0lYZKHRM7iSUO5yQA6L76Zz9QFCkx/6qWH6uVaeCONVQcLz0dD 0HklRpgXSl1s8dN6ptFu4M6YictVBFjo9XKNQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NDkDdVENPHITasYSBRU0u7LO8tRkihQ4z/zsle3BKDM=; b=jkUiS/eyanAwNFHJvTKBmlgKgS/WYwKGP9GAtXb7RDXXyqS2aGCVzltdvD9gYQlcsq W+NuxZl4TRhmo1yppybarp3TO4ob/2ZiFYJF2EHYx9TVC1pZ0FhGsBiOhCcSX/+L7ppL TAWO+m//bqIENLs4I79esEu+cO0IotOrBiOfEPqyyCut3pl5GMdyl2nNEjwx6weIakl9 cq2ebZR+Hor/KfaYi8qdnUPCei95ZhuqA2u5DcaoEOeR6q0hGKUFbm9w3ISMhBepT3Uw XGiP4TyFlvqQG8FwgRxlwrB17niT/HfgtY0Q9U729NdjIFZWXi2hpzNwuEv1zPrayJQh vxmQ== X-Gm-Message-State: AOAM532bm7E0TfqqGBNN60Cl8LoFq4LE+7xVtpBv/X0pCuS8hvDsVLtj pstTXZUhkmab7R/BXoscXxMSFgTLVL3CmQy4n2/k/g== X-Received: by 2002:a17:906:4aca:: with SMTP id u10mr29497913ejt.320.1597218964348; Wed, 12 Aug 2020 00:56:04 -0700 (PDT) MIME-Version: 1.0 References: <1842689.1596468469@warthog.procyon.org.uk> <1845353.1596469795@warthog.procyon.org.uk> <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <52483.1597190733@warthog.procyon.org.uk> In-Reply-To: <52483.1597190733@warthog.procyon.org.uk> From: Miklos Szeredi Date: Wed, 12 Aug 2020 09:55:53 +0200 Message-ID: Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) To: David Howells Cc: Linus Torvalds , linux-fsdevel , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , Ian Kent , LSM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 12, 2020 at 2:05 AM David Howells wrote: > > { > > int fd, attrfd; > > > > fd = open(path, O_PATH); > > attrfd = openat(fd, name, O_ALT); > > close(fd); > > read(attrfd, value, size); > > close(attrfd); > > } > > Please don't go down this path. You're proposing five syscalls - including > creating two file descriptors - to do what fsinfo() does in one. So what? People argued against readfile() for exactly the opposite of reasons, even though that's a lot less specialized than fsinfo(). Worried about performance? Io-uring will allow you to do all those five syscalls (or many more) with just one I/O submission. Thanks, Miklos