diff options
author | Amar Tumballi <amarts@redhat.com> | 2013-08-21 18:54:05 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-08-23 12:04:58 -0700 |
commit | cb533fc296e37ffbd7937a8550611d557b89ae0b (patch) | |
tree | 0c0d918fb931e21fb997bc0e37b9f4e162f14855 /xlators/features/gfid-access/src/gfid-access.c | |
parent | d3bbbbb158942a974414b021e3320c72c49d0cfe (diff) |
core: remove GLUSTERFS_CREATE_MODE_KEY usage
Change-Id: I23b8cb7223b91a55af1cd4214f61bbe0e87351f6
BUG: 952029
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Reviewed-on: http://review.gluster.org/5683
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/features/gfid-access/src/gfid-access.c')
-rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 62103b05ad4..755add52265 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -337,6 +337,7 @@ ga_new_entry (call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *data, ga_newfile_args_t *args = NULL; loc_t tmp_loc = {0,}; call_frame_t *new_frame = NULL; + mode_t mode = 0; args = ga_newfile_parse_args (this, data); if (!args) @@ -369,21 +370,13 @@ ga_new_entry (call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *data, args->args.symlink.linkpath, &tmp_loc, 0, xdata); } else { - if (S_ISREG (args->st_mode)) { - ret = dict_set_uint32 (xdata, - GLUSTERFS_CREATE_MODE_KEY, - args->args.mknod.mode); - if (ret < 0) { - gf_log (THIS->name, GF_LOG_ERROR, - "failed to set the create-mode-key"); - goto out; - } - args->args.mknod.mode = IA_IFREG; - } + /* use 07777 (4 7s) for considering the Sticky bits etc) */ + mode = (S_IFMT & args->st_mode) | + (07777 | args->args.mknod.mode);; STACK_WIND (new_frame, ga_newentry_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->mknod, - &tmp_loc, args->args.mknod.mode, + &tmp_loc, mode, args->args.mknod.rdev, args->args.mknod.umask, xdata); } |