diff options
| author | Anand Avati <avati@redhat.com> | 2013-08-12 09:41:06 -0700 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2013-09-09 17:19:09 -0700 | 
| commit | 64c84723064ed9ef9f2a7755d3afffd1ecf08af4 (patch) | |
| tree | 4afc9f2a32e8f1c6a3103d5b67c3fa6a9bf8e4c8 /xlators/mount/fuse/src/fuse-bridge.c | |
| parent | d3c5463bdc8597ce3a70fded6c80f20e900752f4 (diff) | |
mount/fuse: perform lookup() on inodes linked through readdirplus
Some xlators still require lookup() fop to be sent for proper working.
This patch remembers inodes which have been linked through readdiprlus
and makes the resolver send lookups on them.
Also, introduce and use context count for inode table.
Change-Id: Ibe8a04a659539d90dfc794521b51bf2bda017a0b
BUG: 979910
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/5267
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-on: http://review.gluster.org/5806
Diffstat (limited to 'xlators/mount/fuse/src/fuse-bridge.c')
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 37 | 
1 files changed, 36 insertions, 1 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 8c4edb1e8..00f2a625a 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -51,6 +51,39 @@ fuse_invalidate(xlator_t *this, inode_t *inode)          return 0;  } +void +fuse_inode_set_need_lookup (inode_t *inode, xlator_t *this) +{ +	uint64_t          need_lookup = 1; + +	if (!inode || !this) +		return; + +	inode_ctx_set (inode, this, &need_lookup); + +	return; +} + + +gf_boolean_t +fuse_inode_needs_lookup (inode_t *inode, xlator_t *this) +{ +	uint64_t          need_lookup = 0; +	gf_boolean_t      ret = _gf_false; + +	if (!inode || !this) +		return ret; + +	inode_ctx_get (inode, this, &need_lookup); +	if (need_lookup) +		ret = _gf_true; +	need_lookup = 0; +	inode_ctx_set (inode, this, &need_lookup); + +	return ret; +} + +  fuse_fd_ctx_t *  __fuse_fd_ctx_check_n_create (xlator_t *this, fd_t *fd)  { @@ -2600,6 +2633,8 @@ fuse_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,  		feo->nodeid = inode_to_fuse_nodeid (linked_inode); +		fuse_inode_set_need_lookup (linked_inode, this); +  		inode_unref (linked_inode);  		feo->entry_valid = @@ -5314,7 +5349,7 @@ struct volume_options options[] = {          },          { .key = {"use-readdirp"},            .type = GF_OPTION_TYPE_BOOL, -          .default_value = "no" +          .default_value = "yes"          },          { .key = {NULL} },  };  | 
