diff options
author | Anand Avati <avati@gluster.com> | 2010-12-07 00:19:30 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-12-06 22:19:05 -0800 |
commit | e3232db35a20e5cfd68ab3fb0b7d0931c4cfb67d (patch) | |
tree | 907dddf753e76c63d170c18930cd5b0d02f9e063 /xlators/storage | |
parent | f783ecfbfd8c873d97644b8b6b0d95e3f878b992 (diff) |
gfid: disable setting/getting of gfid from higher level translators
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2196 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2196
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 39441fa7d96..a548081ecc8 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -56,6 +56,8 @@ #include "glusterfs3-xdr.h" #include "hashfn.h" +#define GFID_XATTR_KEY "trusted.gfid" + #undef HAVE_SET_FSID #ifdef HAVE_SET_FSID @@ -216,7 +218,7 @@ posix_fill_gfid_path (xlator_t *this, const char *path, struct iatt *iatt) if (!iatt) return 0; - ret = sys_lgetxattr (path, "trusted.gfid", iatt->ia_gfid, 16); + ret = sys_lgetxattr (path, GFID_XATTR_KEY, iatt->ia_gfid, 16); /* Return value of getxattr */ if (ret == 16) ret = 0; @@ -233,7 +235,7 @@ posix_fill_gfid_fd (xlator_t *this, int fd, struct iatt *iatt) if (!iatt) return 0; - ret = sys_fgetxattr (fd, "trusted.gfid", iatt->ia_gfid, 16); + ret = sys_fgetxattr (fd, GFID_XATTR_KEY, iatt->ia_gfid, 16); /* Return value of getxattr */ if (ret == 16) ret = 0; @@ -388,7 +390,7 @@ posix_gfid_set (xlator_t *this, const char *path, dict_t *xattr_req) if (sys_lstat (path, &stat) != 0) return 0; - ret = sys_lgetxattr (path, "trusted.gfid", uuid_curr, 16); + ret = sys_lgetxattr (path, GFID_XATTR_KEY, uuid_curr, 16); if (ret == 16) return 0; @@ -397,7 +399,7 @@ posix_gfid_set (xlator_t *this, const char *path, dict_t *xattr_req) if (ret) goto out; - ret = sys_lsetxattr (path, "trusted.gfid", uuid_req, 16, XATTR_CREATE); + ret = sys_lsetxattr (path, GFID_XATTR_KEY, uuid_req, 16, XATTR_CREATE); out: return ret; @@ -2903,6 +2905,8 @@ posix_setxattr (call_frame_t *frame, xlator_t *this, MAKE_REAL_PATH (real_path, this, loc->path); + dict_del (dict, GFID_XATTR_KEY); + trav = dict->members_list; while (trav) { @@ -3146,6 +3150,7 @@ posix_getxattr (call_frame_t *frame, xlator_t *this, op_ret = size; if (dict) { + dict_del (dict, GFID_XATTR_KEY); dict_ref (dict); } @@ -3277,6 +3282,7 @@ posix_fgetxattr (call_frame_t *frame, xlator_t *this, op_ret = size; if (dict) { + dict_del (dict, GFID_XATTR_KEY); dict_ref (dict); } @@ -3368,6 +3374,8 @@ posix_fsetxattr (call_frame_t *frame, xlator_t *this, pfd = (struct posix_fd *)(long)tmp_pfd; _fd = pfd->fd; + dict_del (dict, GFID_XATTR_KEY); + trav = dict->members_list; while (trav) { |