All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miklos Szeredi <mszeredi@redhat.com>
To: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	David Howells <dhowells@redhat.com>
Subject: [PATCH 04/10] fuse: honor AT_STATX_DONT_SYNC
Date: Wed, 20 Sep 2017 10:39:59 +0200	[thread overview]
Message-ID: <1505896805-12055-5-git-send-email-mszeredi@redhat.com> (raw)
In-Reply-To: <1505896805-12055-1-git-send-email-mszeredi@redhat.com>

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 <mszeredi@redhat.com>
---
 fs/fuse/dir.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 622081b97426..d2d1dbe1ef75 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -924,12 +924,13 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
 }
 
 static int fuse_update_get_attr(struct inode *inode, struct file *file,
-				struct kstat *stat)
+				struct kstat *stat, unsigned int flags)
 {
 	struct fuse_inode *fi = get_fuse_inode(inode);
 	int err = 0;
 
-	if (time_before64(fi->i_time, get_jiffies_64())) {
+	if (!(flags & AT_STATX_DONT_SYNC) &&
+	    time_before64(fi->i_time, get_jiffies_64())) {
 		forget_all_cached_acls(inode);
 		err = fuse_do_getattr(inode, stat, file);
 	} else if (stat) {
@@ -943,7 +944,7 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
 
 int fuse_update_attributes(struct inode *inode, struct file *file)
 {
-	return fuse_update_get_attr(inode, file, NULL);
+	return fuse_update_get_attr(inode, file, NULL, 0);
 }
 
 int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
@@ -1782,7 +1783,7 @@ static int fuse_getattr(const struct path *path, struct kstat *stat,
 	if (!fuse_allow_current_process(fc))
 		return -EACCES;
 
-	return fuse_update_get_attr(inode, NULL, stat);
+	return fuse_update_get_attr(inode, NULL, stat, flags);
 }
 
 static const struct inode_operations fuse_dir_inode_operations = {
-- 
2.5.5

  parent reply	other threads:[~2017-09-20  8:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  8:39 [PATCH 00/10] honor AT_STATX_DONT_SYNC in netfs Miklos Szeredi
2017-09-20  8:39 ` [PATCH 01/10] ceph: honor AT_STATX_DONT_SYNC Miklos Szeredi
2017-09-20  8:39 ` [PATCH 02/10] cifs: " Miklos Szeredi
2017-09-21 18:14   ` Steve French
     [not found]     ` <CAH2r5mtNGzVsoKw49zxButMNfwTtx1H4CFe9o9=mCxhCHZVFuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-09-21 18:14       ` Fwd: " Steve French
2017-09-20  8:39 ` [PATCH 03/10] coda: " Miklos Szeredi
2017-09-20 20:04   ` Jan Harkes
2017-09-21 12:45     ` Miklos Szeredi
2017-09-20  8:39 ` Miklos Szeredi [this message]
2017-09-20  8:40 ` [PATCH 05/10] gfs2: " Miklos Szeredi
2017-09-20  8:40 ` [PATCH 06/10] lustre: " Miklos Szeredi
2017-09-20  8:40 ` [PATCH 07/10] nfs: " Miklos Szeredi
2017-09-20  8:40 ` [PATCH 08/10] ocfs2: " Miklos Szeredi
2017-09-20  8:40 ` [PATCH 09/10] orangefs: " Miklos Szeredi
2017-09-20  8:40 ` [PATCH 10/10] 9p: " Miklos Szeredi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1505896805-12055-5-git-send-email-mszeredi@redhat.com \
    --to=mszeredi@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.