linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fuse: move attr_version to a more relevant place
@ 2019-04-29  8:20 zhangliguang
  0 siblings, 0 replies; 2+ messages in thread
From: zhangliguang @ 2019-04-29  8:20 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-fsdevel

Move attr_version assignment code to the more relevant place.

Signed-off-by: zhangliguang <zhangliguang@linux.alibaba.com>
---
 fs/fuse/dir.c     | 10 ++++------
 fs/fuse/readdir.c |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index dd0f64f..9a16064 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -191,8 +191,6 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
 		if (!forget)
 			goto out;
 
-		attr_version = fuse_get_attr_version(fc);
-
 		parent = dget_parent(entry);
 		fuse_lookup_init(fc, &args, get_node_id(d_inode(parent)),
 				 &entry->d_name, &outarg);
@@ -218,6 +216,8 @@ static int fuse_dentry_revalidate(struct dentry *entry, unsigned int flags)
 			goto invalid;
 
 		forget_all_cached_acls(inode);
+		
+		attr_version = fuse_get_attr_version(fc);
 		fuse_change_attributes(inode, &outarg.attr,
 				       entry_attr_timeout(&outarg),
 				       attr_version);
@@ -292,8 +292,6 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
 	if (!forget)
 		goto out;
 
-	attr_version = fuse_get_attr_version(fc);
-
 	fuse_lookup_init(fc, &args, nodeid, name, outarg);
 	err = fuse_simple_request(fc, &args);
 	/* Zero nodeid is same as -ENOENT, but with valid timeout */
@@ -306,6 +304,7 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name
 	if (!fuse_valid_type(outarg->attr.mode))
 		goto out_put_forget;
 
+	attr_version = fuse_get_attr_version(fc);
 	*inode = fuse_iget(sb, outarg->nodeid, outarg->generation,
 			   &outarg->attr, entry_attr_timeout(outarg),
 			   attr_version);
@@ -873,8 +872,6 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
 	FUSE_ARGS(args);
 	u64 attr_version;
 
-	attr_version = fuse_get_attr_version(fc);
-
 	memset(&inarg, 0, sizeof(inarg));
 	memset(&outarg, 0, sizeof(outarg));
 	/* Directories have separate file-handle space */
@@ -898,6 +895,7 @@ static int fuse_do_getattr(struct inode *inode, struct kstat *stat,
 			make_bad_inode(inode);
 			err = -EIO;
 		} else {
+			attr_version = fuse_get_attr_version(fc);
 			fuse_change_attributes(inode, &outarg.attr,
 					       attr_timeout(&outarg),
 					       attr_version);
diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c
index 574d03f..8b74fe0 100644
--- a/fs/fuse/readdir.c
+++ b/fs/fuse/readdir.c
@@ -320,7 +320,6 @@ static int fuse_readdir_uncached(struct file *file, struct dir_context *ctx)
 	req->pages[0] = page;
 	req->page_descs[0].length = PAGE_SIZE;
 	if (plus) {
-		attr_version = fuse_get_attr_version(fc);
 		fuse_read_fill(req, file, ctx->pos, PAGE_SIZE,
 			       FUSE_READDIRPLUS);
 	} else {
@@ -340,6 +339,7 @@ static int fuse_readdir_uncached(struct file *file, struct dir_context *ctx)
 			if (ff->open_flags & FOPEN_CACHE_DIR)
 				fuse_readdir_cache_end(file, ctx->pos);
 		} else if (plus) {
+			attr_version = fuse_get_attr_version(fc);
 			err = parse_dirplusfile(page_address(page), nbytes,
 						file, ctx, attr_version);
 		} else {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] fuse: move attr_version to a more relevant place
@ 2019-04-29  7:02 zhangliguang
  0 siblings, 0 replies; 2+ messages in thread
From: zhangliguang @ 2019-04-29  7:02 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-fsdevel

Move attr_version assignment code to the more relevant place.

Signed-off-by: zhangliguang <zhangliguang@linux.alibaba.com>
---
 fs/fuse/readdir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/readdir.c b/fs/fuse/readdir.c
index 574d03f..8b74fe0 100644
--- a/fs/fuse/readdir.c
+++ b/fs/fuse/readdir.c
@@ -320,7 +320,6 @@ static int fuse_readdir_uncached(struct file *file, struct dir_context *ctx)
 	req->pages[0] = page;
 	req->page_descs[0].length = PAGE_SIZE;
 	if (plus) {
-		attr_version = fuse_get_attr_version(fc);
 		fuse_read_fill(req, file, ctx->pos, PAGE_SIZE,
 			       FUSE_READDIRPLUS);
 	} else {
@@ -340,6 +339,7 @@ static int fuse_readdir_uncached(struct file *file, struct dir_context *ctx)
 			if (ff->open_flags & FOPEN_CACHE_DIR)
 				fuse_readdir_cache_end(file, ctx->pos);
 		} else if (plus) {
+			attr_version = fuse_get_attr_version(fc);
 			err = parse_dirplusfile(page_address(page), nbytes,
 						file, ctx, attr_version);
 		} else {
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-29  8:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29  8:20 [PATCH] fuse: move attr_version to a more relevant place zhangliguang
  -- strict thread matches above, loose matches on Subject: below --
2019-04-29  7:02 zhangliguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).