From patchwork Fri Oct 19 12:20:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10649207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 35A74109C for ; Fri, 19 Oct 2018 12:21:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 253BD283FF for ; Fri, 19 Oct 2018 12:21:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1988C28922; Fri, 19 Oct 2018 12:21:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B717C283FF for ; Fri, 19 Oct 2018 12:21:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727336AbeJSU0v (ORCPT ); Fri, 19 Oct 2018 16:26:51 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39104 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727303AbeJSU0u (ORCPT ); Fri, 19 Oct 2018 16:26:50 -0400 Received: by mail-wr1-f67.google.com with SMTP id 61-v6so37208878wrb.6 for ; Fri, 19 Oct 2018 05:20:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Oy3EdcsKa921bauMTdkdlc8KG+Gne7gsHnChldkrCS0=; b=FPhuqdMannwka4zN2SsIt2dxBOzad9XikjIlAsL5o8apo6V4R6/KijLz28icFqu/hg hT49wD5qd4d+TRIXBIeYgPQgzzqoLU4O/IcR2To8Q82z+q4tQc6HV20h0ylNbyRuVLGG E+RMOUYrWlF0DR2GgYlKjK//llnnFC8qsWdgEL3Xc2dduPClA9eoekVCZap96ykIGXFT RKvBefVcUBTXfQBTnsGi7jiaolZmF82nIDXgCBhoN6qe+rGNJ6fbJjx6F3EjNbklcp04 4YGbb9aTQGHVCPa9YQTBDAk9p3MHXFpn+QdmA1aAm2K7eIUxxGQnZUryaB0Ac3srjpjD 8CDA== X-Gm-Message-State: ABuFfohBWGcVrZPuTlthxhhqegc/mg0mUZGLbFMX1CFT1yvShtiSJUL+ M2oB0cncS7ksglGV2kM8sbF8oheTOs8= X-Google-Smtp-Source: ACcGV63Q2WNpklcdTTebLgqFJd4fZ4Fxil/zKeUwoZ+vaD3MJ4/FIiPZbARPK5D+O06p84shW32F1w== X-Received: by 2002:adf:84e6:: with SMTP id 93-v6mr35672038wrg.144.1539951656957; Fri, 19 Oct 2018 05:20:56 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-212-96-48-140.catv.broadband.hu. [212.96.48.140]) by smtp.gmail.com with ESMTPSA id s10-v6sm1858283wmf.15.2018.10.19.05.20.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Oct 2018 05:20:56 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, David Howells , Michael Kerrisk , Andreas Dilger , Florian Weimer , Amir Goldstein Subject: [PATCH v2 3/5] statx: add STATX_ATTRIBUTES flag Date: Fri, 19 Oct 2018 14:20:47 +0200 Message-Id: <20181019122049.27121-3-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20181019122049.27121-1-mszeredi@redhat.com> References: <20181019122049.27121-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP FUSE will want to know if stx_attributes is interesting or not, because there's a non-zero cost of retreiving it. This just a "want" flag, since stx_attributes_mask already indicates whether we "got" stx_attributes or not. Signed-off-by: Miklos Szeredi Cc: David Howells Cc: Michael Kerrisk Acked-by: David Howells --- include/uapi/linux/stat.h | 1 + samples/statx/test-statx.c | 2 +- tools/include/uapi/linux/stat.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/stat.h b/include/uapi/linux/stat.h index ed456ac0f90d..7d3cce078652 100644 --- a/include/uapi/linux/stat.h +++ b/include/uapi/linux/stat.h @@ -148,6 +148,7 @@ struct statx { #define STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */ #define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */ #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ +#define STATX_ATTRIBUTES 0x00001000U /* Want stx_attributes */ #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */ diff --git a/samples/statx/test-statx.c b/samples/statx/test-statx.c index e354048dea3c..deef9a68ff68 100644 --- a/samples/statx/test-statx.c +++ b/samples/statx/test-statx.c @@ -211,7 +211,7 @@ int main(int argc, char **argv) struct statx stx; int ret, raw = 0, atflag = AT_SYMLINK_NOFOLLOW; - unsigned int mask = STATX_BASIC_STATS | STATX_BTIME; + unsigned int mask = STATX_BASIC_STATS | STATX_BTIME | STATX_ATTRIBUTES; for (argv++; *argv; argv++) { if (strcmp(*argv, "-F") == 0) { diff --git a/tools/include/uapi/linux/stat.h b/tools/include/uapi/linux/stat.h index ed456ac0f90d..60cd0a3f52e7 100644 --- a/tools/include/uapi/linux/stat.h +++ b/tools/include/uapi/linux/stat.h @@ -148,6 +148,7 @@ struct statx { #define STATX_BLOCKS 0x00000400U /* Want/got stx_blocks */ #define STATX_BASIC_STATS 0x000007ffU /* The stuff in the normal stat struct */ #define STATX_BTIME 0x00000800U /* Want/got stx_btime */ +#define STATX_ATTRIBUTES 0x00001000U /* Want/got stx_attributes */ #define STATX__RESERVED 0x80000000U /* Reserved for future struct statx expansion */