From patchwork Fri Sep 28 15:42:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10620117 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 CB6F615E8 for ; Fri, 28 Sep 2018 15:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C40C02BE3E for ; Fri, 28 Sep 2018 15:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C22BB2BE8A; Fri, 28 Sep 2018 15:42:43 +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 7926E2BE8A for ; Fri, 28 Sep 2018 15:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729463AbeI1WHA (ORCPT ); Fri, 28 Sep 2018 18:07:00 -0400 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35229 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729344AbeI1WHA (ORCPT ); Fri, 28 Sep 2018 18:07:00 -0400 Received: by mail-wm1-f65.google.com with SMTP id o18-v6so2696505wmc.0 for ; Fri, 28 Sep 2018 08:42:40 -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; bh=Ko/6pZM5qyC5tUYIuQ2NdJlXSEdirTohEeN5+ByLYX0=; b=PiM9Mh/b238QUrGC6Q3T2ZhRXboyiwdUuLFMRqUIDp9HcFFPkri0v+xKCtfTYLY2hi cTO3hoqJRW0uu9NJDkmusXcHCnPJ9BEC3UYkQChDKnQZXR72Joly6ZU7B5RirsmI+DR6 OEx9SUCZiSuBjyBKzvPXmzuscK3LvDkSKrB0i0j3oLeUu45X5gB0YIJL8PC40vGjAO4B LzeX243dl8SyHCJcdrRhR2UGFQ2ZJwuye3jS0LruU6BLM7F55wU7tgqEk/t1tYP/d2E/ 3tXaUrVXMePcAjL/izo5F5KWiRvqQYnazmscb3LaR4bk2zrvwmQF+f8Im1MICFcqFjZg EJQA== X-Gm-Message-State: ABuFfoiqp2TmjE6kYmiJ9rinQzkHyRGAfNvRXUeX2uF2+SmpZbNU1gU0 miewIE9XRuuP+AAmzzC1qbFr3RHLI0M= X-Google-Smtp-Source: ACcGV60gNkKTFneV8ohnchGRGRMPg0l+fY0NCflEW+p0d8scL9N3MEFAtN96rvazqaJljpyVat4uBQ== X-Received: by 2002:a1c:c708:: with SMTP id x8-v6mr2198699wmf.116.1538149359555; Fri, 28 Sep 2018 08:42:39 -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.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Sep 2018 08:42:38 -0700 (PDT) From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 0/9] fuse: readdir caching Date: Fri, 28 Sep 2018 17:42:25 +0200 Message-Id: <20180928154234.19270-1-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 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 Allow caching readdir in fuse. Use the page cache for this, which solves cache shrinking on memory pressure. I think it might make sense to extract something like this into a set of VFS helpers, so that other filesystems can also make use of this facility. Thanks, Miklos --- Miklos Szeredi (9): fuse: split out readdir.c fuse: add FOPEN_CACHE_DIR fuse: extract fuse_emit() helper fuse: allow caching readdir fuse: allow using readdir cache fuse: add readdir cache version fuse: use mtime for readdir cache verification fuse: use iversion for readdir cache verification fuse: reduce size of struct fuse_inode fs/fuse/Makefile | 2 +- fs/fuse/dir.c | 293 +++--------------------- fs/fuse/file.c | 10 + fs/fuse/fuse_i.h | 83 ++++++- fs/fuse/inode.c | 11 +- fs/fuse/readdir.c | 567 ++++++++++++++++++++++++++++++++++++++++++++++ include/uapi/linux/fuse.h | 7 +- 7 files changed, 688 insertions(+), 285 deletions(-) create mode 100644 fs/fuse/readdir.c