Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp909263imm; Fri, 28 Sep 2018 08:45:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV62G3TLyHrgSzVxiAUaamg+xeBvMee+V8NgBvKzAub9ov0vT3Svzv2BdqZwBRnEtFS04sfkm X-Received: by 2002:a62:565c:: with SMTP id k89-v6mr17282024pfb.212.1538149501777; Fri, 28 Sep 2018 08:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538149501; cv=none; d=google.com; s=arc-20160816; b=cucbdleth85zWC9dgwexSb/33U14XGmsoH6xxGmNLeH08faE874+zUgxKzYJJGJ71Q G8a/TjFUQnWI/0vrPZupdiEZGAlG8r1/JG+vnNZiWTsQtxQG4nDknb2w+wC8UNZ9rI91 xku4MUpsgzJnNjDre6NI2pnn000kADKkVNR2PtFfDNGHCJJAkAWt83Ydidy1Lv7Ybwz0 JpPTNb0Lcmjf+Ay4H9QG3vGaZytVQ9O8X7gU9Wew+wzdhvXP1QO8Img60ino5vmGL31Z 3mB9TJ+6odf8BEnoobHu+Bl9h58Ka4eoNsKQboCYk1HLgIdtqM2CLW/NIXdQBhFW0hrP AtPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=6kSjpHgzA6z91vgrja6vThHugEbFBwVE8go3dvJ9CMo=; b=cYz0ED3olPE9tZAqqGFBjNKxJhgh4y/X1IT3r0dOkwD6HkAmQmpHM9I5PXt3YVTM5m VG3GRStmaEx9WfkswdrM8u/gaT6bgdfZy5xaRh4YxAKQhLYCsxaJ1NShuFTPHdFtbS+k YAh66Z0O4X/sY0x8YOnJSyHkJIQYdDdHdX+1tUiXl9agbyhnzZEhc5T6kkLcpV9taYVo Nx45UDXpnfLFmbg/04lWrGdvUWhA7U75mK0cJrqUSN1noCHqyx4uhV/yKlc3YpxdwmFQ KJeHUJ59lj0fV/wYPYJbI9dcAQuE3fBeFi8h0JvahHO9HAN+HXIRY2iNyfH7lS/Xa4/V j1XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p15-v6si5320372pll.42.2018.09.28.08.44.46; Fri, 28 Sep 2018 08:45:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729574AbeI1WHE (ORCPT + 99 others); Fri, 28 Sep 2018 18:07:04 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:37530 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729561AbeI1WHD (ORCPT ); Fri, 28 Sep 2018 18:07:03 -0400 Received: by mail-wr1-f65.google.com with SMTP id u12-v6so6880001wrr.4 for ; Fri, 28 Sep 2018 08:42:43 -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=6kSjpHgzA6z91vgrja6vThHugEbFBwVE8go3dvJ9CMo=; b=LDpXiZztmOLqgfOKR3xQ2Fu7cPtloeELsh/zf4lcNS0OKZC+sPFm123YmqD5bmExIi n5X94+f9v7bA2aIH+u3ScKZblPnVNXTfWaqhpXElln0aqMdHoD5PR9rw887PAoOFo3ou 7MXw9+TlYTwMGzDZnxzplGj7gfdGTMYKg+HVvPrJZNq4Z+p2J8JVa3UKIGL5sQXSl9p/ fde1f7V0+TLyWHSwttSfkkaNxUoC7Ciw+lniLvKE+7JnXqjKT8e4W+wL8sjZF7IVg7N0 Gn8h0zU1qA49WuZfw+4c+6LTmtzbfeNLJ6T75EJ0zNipKOyCgHq0HNXHSrdDs4YQTW1P Y9SA== X-Gm-Message-State: ABuFfogCXPDhTfzExr0wVp9C5Qd8WqC7sDDmRnFjunI2dZzobXUadDSG lFbwFqjoyPo/h5HlAcxXs/tuES3GEA8= X-Received: by 2002:adf:e2c5:: with SMTP id d5-v6mr12855022wrj.139.1538149362815; Fri, 28 Sep 2018 08:42:42 -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 v2-v6sm2009877wme.36.2018.09.28.08.42.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 08:42:41 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/9] fuse: add FOPEN_CACHE_DIR Date: Fri, 28 Sep 2018 17:42:27 +0200 Message-Id: <20180928154234.19270-3-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180928154234.19270-1-mszeredi@redhat.com> References: <20180928154234.19270-1-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add flag returned by OPENDIR request to allow kernel to cache directory contents in page cache. The effect of FOPEN_CACHE_DIR is twofold: a) if not already cached, it writes entries into the cache b) if already cached, it allows reading entries from the cache The FOPEN_KEEP_CACHE has the same effect as on regular files: unless this flag is given the cache is cleared upon completion of open. So FOPEN_KEEP_CACHE and FOPEN_KEEP_CACHE flags should be used together to make use of the directory caching facility introduced in the following patches. The FUSE_AUTO_INVAL_DATA flag returned in INIT reply also has the same affect on the directory cache as it has on data cache for regular files. Signed-off-by: Miklos Szeredi --- include/uapi/linux/fuse.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/fuse.h b/include/uapi/linux/fuse.h index 92fa24c24c92..e30e3a6868cd 100644 --- a/include/uapi/linux/fuse.h +++ b/include/uapi/linux/fuse.h @@ -116,6 +116,9 @@ * * 7.27 * - add FUSE_ABORT_ERROR + * + * 7.28 + * - add FOPEN_CACHE_DIR */ #ifndef _LINUX_FUSE_H @@ -151,7 +154,7 @@ #define FUSE_KERNEL_VERSION 7 /** Minor version number of this interface */ -#define FUSE_KERNEL_MINOR_VERSION 27 +#define FUSE_KERNEL_MINOR_VERSION 28 /** The node ID of the root inode */ #define FUSE_ROOT_ID 1 @@ -219,10 +222,12 @@ struct fuse_file_lock { * FOPEN_DIRECT_IO: bypass page cache for this open file * FOPEN_KEEP_CACHE: don't invalidate the data cache on open * FOPEN_NONSEEKABLE: the file is not seekable + * FOPEN_CACHE_DIR: allow caching this directory */ #define FOPEN_DIRECT_IO (1 << 0) #define FOPEN_KEEP_CACHE (1 << 1) #define FOPEN_NONSEEKABLE (1 << 2) +#define FOPEN_CACHE_DIR (1 << 3) /** * INIT request/reply flags -- 2.14.3