summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-helpers.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2013-08-04 13:20:01 +0530
committerAnand Avati <avati@redhat.com>2013-08-21 12:12:07 -0700
commit271804a26ca73c2eab706eff4b3be9a62bec2b13 (patch)
treeed9f0a3ce451ff3879c7861ea59392036ee27015 /xlators/mount/fuse/src/fuse-helpers.c
parent51c6fa7a354826744de98a1c5c747955ae65850c (diff)
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 <amarts@redhat.com> Reviewed-on: http://review.gluster.org/5495 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-helpers.c')
-rw-r--r--xlators/mount/fuse/src/fuse-helpers.c115
1 files changed, 7 insertions, 108 deletions
diff --git a/xlators/mount/fuse/src/fuse-helpers.c b/xlators/mount/fuse/src/fuse-helpers.c
index d29c31651..c5c04044e 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: