Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751802AbdITIkr (ORCPT ); Wed, 20 Sep 2017 04:40:47 -0400 Received: from mail-wr0-f174.google.com ([209.85.128.174]:49636 "EHLO mail-wr0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751676AbdITIkW (ORCPT ); Wed, 20 Sep 2017 04:40:22 -0400 X-Google-Smtp-Source: AOwi7QC6BjTBCETZS5xFb2HXhSL9X/dK8h7KWqv+cKfSYZLCXhbITN2tPb1/wZdTJstBXUnPc3CQGg== From: Miklos Szeredi To: linux-fsdevel@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Al Viro , David Howells , Eric Van Hensbergen , Ron Minnich , Latchesar Ionkov Subject: [PATCH 10/10] 9p: honor AT_STATX_DONT_SYNC Date: Wed, 20 Sep 2017 10:40:05 +0200 Message-Id: <1505896805-12055-11-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> References: <1505896805-12055-1-git-send-email-mszeredi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1637 Lines: 44 The description of this flag says "Don't sync attributes with the server". In other words: always use the attributes cached in the kernel and don't send network or local messages to refresh the attributes. Signed-off-by: Miklos Szeredi Cc: Eric Van Hensbergen Cc: Ron Minnich Cc: Latchesar Ionkov --- fs/9p/vfs_inode.c | 4 +++- fs/9p/vfs_inode_dotl.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 2a5de610dd8f..0a7063f12c0b 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -1065,7 +1065,9 @@ v9fs_vfs_getattr(const struct path *path, struct kstat *stat, p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry); v9ses = v9fs_dentry2v9ses(dentry); - if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) { + + if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE || + (flags & AT_STATX_DONT_SYNC)) { generic_fillattr(d_inode(dentry), stat); return 0; } diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index 70f9887c59a9..92bf43981a0d 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -478,7 +478,8 @@ v9fs_vfs_getattr_dotl(const struct path *path, struct kstat *stat, p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry); v9ses = v9fs_dentry2v9ses(dentry); - if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) { + if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE || + (flags & AT_STATX_DONT_SYNC)) { generic_fillattr(d_inode(dentry), stat); return 0; } -- 2.5.5