From 271804a26ca73c2eab706eff4b3be9a62bec2b13 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 4 Aug 2013 13:20:01 +0530 Subject: Revert "fuse: auxiliary gfid mount support" This reverts commit 4c0f4c8a89039b1fa1c9c015fb6f273268164c20. Conflicts: xlators/mount/fuse/src/fuse-bridge.c For build issues added CREATE_MODE_KEY definition in: libglusterfs/src/glusterfs.h Change-Id: I8093c2a0b5349b01e1ee6206025edbdbee43055e BUG: 952029 Signed-off-by: Amar Tumballi Reviewed-on: http://review.gluster.org/5495 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/mount/fuse/src/fuse-helpers.c | 115 +++------------------------------- 1 file changed, 7 insertions(+), 108 deletions(-) (limited to 'xlators/mount/fuse/src/fuse-helpers.c') diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c index d29c31651bc..c5c04044eac 100644 --- a/xlators/mount/fuse/src/fuse-helpers.c +++ b/xlators/mount/fuse/src/fuse-helpers.c @@ -326,31 +326,12 @@ get_call_frame_for_req (fuse_state_t *state) return frame; } -inode_t * -fuse_ino_to_inode_gfid_mount (uint64_t ino, xlator_t *fuse) -{ - inode_t **ptr = NULL, *inode = NULL; - xlator_t *active_subvol = NULL; - - if (ino == 1) { - active_subvol = fuse_active_subvol (fuse); - if (active_subvol) - inode = active_subvol->itable->root; - } else { - ptr = (void *)ino; - - if (ptr != NULL) - inode = inode_ref (*ptr); - } - - return inode; -} inode_t * -fuse_ino_to_inode_normal_mount (uint64_t ino, xlator_t *fuse) +fuse_ino_to_inode (uint64_t ino, xlator_t *fuse) { + inode_t *inode = NULL; xlator_t *active_subvol = NULL; - inode_t *inode = NULL; if (ino == 1) { active_subvol = fuse_active_subvol (fuse); @@ -364,96 +345,15 @@ fuse_ino_to_inode_normal_mount (uint64_t ino, xlator_t *fuse) return inode; } -inode_t * -fuse_ino_to_inode (uint64_t ino, xlator_t *fuse) -{ - inode_t *inode = NULL; - fuse_private_t *priv = NULL; - - priv = fuse->private; - - if (priv->aux_gfid_mount) { - inode = fuse_ino_to_inode_gfid_mount (ino, fuse); - } else { - inode = fuse_ino_to_inode_normal_mount (ino, fuse); - } - - return inode; -} - -inline uint64_t -inode_to_fuse_nodeid_gfid_mount (xlator_t *this, inode_t *inode, - gf_lookup_namespace_t ns) -{ - inode_t **ptr = NULL; - gf_fuse_nodeid_t *nodeid = NULL; - fuse_private_t *priv = NULL; - uint64_t value = 0; - int32_t ret = 0; - - priv = this->private; - - LOCK (&inode->lock); - { - __inode_ctx_get (inode, this, &value); - nodeid = (void *)value; - - if (nodeid == NULL) { - nodeid = mem_get0 (priv->fuse_nodeid_pool); - if (nodeid == NULL) - goto unlock; - - ret = __inode_ctx_set (inode, this, (uint64_t *)nodeid); - if (ret < 0) - goto unlock; - - nodeid->inode_path_ns = nodeid->inode_gfid_ns = inode; - } - } -unlock: - UNLOCK (&inode->lock); - - if (ret < 0) { - mem_put (nodeid); - nodeid = NULL; - } - - if (nodeid != NULL) { - if (ns == GF_FUSE_GFID_NAMESPACE) - ptr = &nodeid->inode_gfid_ns; - else - ptr = &nodeid->inode_path_ns; - } - - return (uint64_t) ptr; -} - -inline uint64_t -inode_to_fuse_nodeid_normal_mount (inode_t *inode) -{ - if (__is_root_gfid (inode->gfid)) - return 1; - - return (unsigned long) inode; -} - uint64_t -inode_to_fuse_nodeid (xlator_t *this, inode_t *inode, gf_lookup_namespace_t ns) +inode_to_fuse_nodeid (inode_t *inode) { - fuse_private_t *priv = NULL; - uint64_t ino = 0; - - priv = this->private; - if (!inode) return 0; + if (__is_root_gfid (inode->gfid)) + return 1; - if (priv->aux_gfid_mount) - ino = inode_to_fuse_nodeid_gfid_mount (this, inode, ns); - else - ino = inode_to_fuse_nodeid_normal_mount (inode); - - return ino; + return (unsigned long) inode; } @@ -689,8 +589,7 @@ fuse_ignore_xattr_set (fuse_private_t *priv, char *key) || (fnmatch ("*.glusterfs.volume-mark", key, FNM_PERIOD) == 0) || (fnmatch ("*.glusterfs.volume-mark.*", - key, FNM_PERIOD) == 0) - || (fnmatch ("glusterfs.gfid.newfile", key, FNM_PERIOD) == 0))) + key, FNM_PERIOD) == 0))) ret = -1; out: -- cgit