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 | |
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')
-rw-r--r-- | xlators/cluster/dht/src/dht-linkfile.c | 9 | ||||
-rw-r--r-- | xlators/features/gfid-access/src/gfid-access.c | 17 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.c | 14 |
3 files changed, 5 insertions, 35 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c index 57cc202dadb..dbc9d0b3c7b 100644 --- a/xlators/cluster/dht/src/dht-linkfile.c +++ b/xlators/cluster/dht/src/dht-linkfile.c @@ -148,15 +148,6 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk, goto out; } - ret = dict_set_uint32 (dict, GLUSTERFS_CREATE_MODE_KEY, - DHT_LINKFILE_MODE); - if (ret < 0) { - gf_log (frame->this->name, GF_LOG_WARNING, - "%s: failed to set mode in xdata", - loc->path); - goto out; - } - local->link_subvol = fromvol; /* Always create as root:root. dht_linkfile_attr_heal fixes the * ownsership */ 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); } diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index fc7c259e948..3c7816cfb8c 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -842,7 +842,6 @@ posix_mknod (call_frame_t *frame, xlator_t *this, struct iatt preparent = {0,}; struct iatt postparent = {0,}; void * uuid_req = NULL; - mode_t st_mode = 0; DECLARE_OLD_FS_ID_VAR; @@ -918,19 +917,6 @@ real_op: strerror (op_errno)); goto out; } - } else { - op_ret = dict_get_uint32 (xdata, GLUSTERFS_CREATE_MODE_KEY, - &st_mode); - - if (op_ret >= 0) { - op_ret = chmod (real_path, st_mode); - if (op_ret < 0) { - gf_log (this->name, GF_LOG_WARNING, - "chmod failed (%s)", strerror (errno)); - } - - dict_del (xdata, GLUSTERFS_CREATE_MODE_KEY); - } } op_ret = posix_gfid_set (this, real_path, loc, xdata); |