From c63979fdd8589483f242a8f450a130d269e907ed Mon Sep 17 00:00:00 2001 From: Kinglong Mee Date: Mon, 16 Jul 2018 16:39:02 +0800 Subject: dht: remove useless argument from dht_iatt_merge The last using of the subvol argument has been removed at 4e1ec35ef4f7 ("core: fill 'ia_ino' from 'ia_gfid' in 'storage/posix' ......") 7 years ago (2011-06-16). Change-Id: I9788d79e2e40cc153cf2960e28c7c1c1033dc8f7 fixes: bz#1601683 Signed-off-by: Kinglong Mee --- xlators/cluster/dht/src/dht-common.c | 52 ++++++++++++++----------------- xlators/cluster/dht/src/dht-common.h | 3 +- xlators/cluster/dht/src/dht-helper.c | 3 +- xlators/cluster/dht/src/dht-inode-read.c | 10 +++--- xlators/cluster/dht/src/dht-inode-write.c | 52 +++++++++++++++---------------- xlators/cluster/dht/src/dht-rename.c | 34 ++++++++++---------- xlators/cluster/dht/src/dht-selfheal.c | 12 +++---- 7 files changed, 78 insertions(+), 88 deletions(-) diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index cd129d0f2d5..d4530829625 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -1096,9 +1096,9 @@ dht_discover_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->inode == NULL) local->inode = inode_ref (inode); - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->postparent, postparent, - prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->postparent, postparent); + if (!dict_get (xattr, conf->mds_xattr_key)) { goto unlock; } else { @@ -1434,8 +1434,8 @@ dht_lookup_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->inode == NULL) local->inode = inode_ref (inode); - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->postparent, postparent); if (!dict_get (xattr, conf->mds_xattr_key)) { gf_msg_debug (this->name, 0, @@ -1811,9 +1811,8 @@ dht_revalidate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, dht_dir_has_layout (xattr, conf->xattr_name) >= 0) || conf->subvolume_cnt == 1) { - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->postparent, postparent, - prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->postparent, postparent); } else { /* copy the gfid anyway */ gf_uuid_copy (local->stbuf.ia_gfid, stbuf->ia_gfid); @@ -2822,8 +2821,8 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (!local->cached_subvol) { /* found one file */ - dht_iatt_merge (this, &local->stbuf, buf, - prev); + dht_iatt_merge (this, &local->stbuf, buf); + local->xattr = dict_ref (xattr); local->cached_subvol = prev; @@ -2832,7 +2831,7 @@ dht_lookup_everywhere_cbk (call_frame_t *frame, void *cookie, xlator_t *this, " %s", prev->name, loc->path); dht_iatt_merge (this, &local->postparent, - postparent, prev); + postparent); gf_uuid_copy (local->skip_unlink.cached_gfid, buf->ia_gfid); @@ -8433,7 +8432,7 @@ dht_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, ((local->call_cnt == 1 && !IS_DHT_MIGRATION_PHASE2 (stbuf)) || (local->call_cnt != 1 && IS_DHT_MIGRATION_PHASE2 (&local->stbuf)))) { - dht_iatt_merge (this, &local->stbuf, stbuf, NULL); + dht_iatt_merge (this, &local->stbuf, stbuf); stbuf_merged = _gf_true; dht_linkfile_attr_heal (frame, this); } @@ -8446,13 +8445,10 @@ dht_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* Preserve the return values, in case the migration decides * to recreate the link on the same subvol that the current * hased for the link was created on. */ - dht_iatt_merge (this, &local->preparent, - preparent, NULL); - dht_iatt_merge (this, &local->postparent, - postparent, NULL); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); if (!stbuf_merged) { - dht_iatt_merge (this, &local->stbuf, - stbuf, NULL); + dht_iatt_merge (this, &local->stbuf, stbuf); stbuf_merged = _gf_true; } @@ -9314,9 +9310,9 @@ dht_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (dir_exists) goto unlock; - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->preparent, preparent, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); } unlock: UNLOCK (&frame->lock); @@ -9548,9 +9544,9 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie, local->op_ret = 0; - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->preparent, preparent, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); local->call_cnt = conf->subvolume_cnt - 1; /* Delete internal mds xattr from params dict to avoid store @@ -9818,8 +9814,8 @@ dht_rmdir_hashed_subvol_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - dht_iatt_merge (this, &local->preparent, preparent, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); } unlock: @@ -9938,8 +9934,8 @@ dht_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* Track if rmdir succeeded on atleast one subvol*/ local->fop_succeeded = 1; - dht_iatt_merge (this, &local->preparent, preparent, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); } unlock: UNLOCK (&frame->lock); diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 02560ef94ab..2520671e35d 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -900,8 +900,7 @@ int dht_deitransform (xlator_t *this, uint64_t y, xlator_t **subvol); void dht_local_wipe (xlator_t *this, dht_local_t *local); dht_local_t *dht_local_init (call_frame_t *frame, loc_t *loc, fd_t *fd, glusterfs_fop_t fop); -int dht_iatt_merge (xlator_t *this, struct iatt *to, struct iatt *from, - xlator_t *subvol); +int dht_iatt_merge (xlator_t *this, struct iatt *to, struct iatt *from); xlator_t *dht_subvol_get_hashed (xlator_t *this, loc_t *loc); xlator_t *dht_subvol_get_cached (xlator_t *this, inode_t *inode); diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 2f2ca1f635e..018389d31eb 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -1094,8 +1094,7 @@ out: int -dht_iatt_merge (xlator_t *this, struct iatt *to, - struct iatt *from, xlator_t *subvol) +dht_iatt_merge (xlator_t *this, struct iatt *to, struct iatt *from) { if (!from || !to) return 0; diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index 7e4aef4ccc6..53215a3d34d 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -299,7 +299,7 @@ dht_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - dht_iatt_merge (this, &local->stbuf, stbuf, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); local->op_ret = 0; } @@ -877,8 +877,8 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, if (local->call_cnt != 1) { if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -899,8 +899,8 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); dht_inode_ctx_get_mig_info (this, inode, &src_subvol, &dst_subvol); diff --git a/xlators/cluster/dht/src/dht-inode-write.c b/xlators/cluster/dht/src/dht-inode-write.c index 226ee95e8b3..4b4f2c2d4a3 100644 --- a/xlators/cluster/dht/src/dht-inode-write.c +++ b/xlators/cluster/dht/src/dht-inode-write.c @@ -69,8 +69,8 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) { /* preserve the modes of source */ if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -122,8 +122,8 @@ dht_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, } } - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); ret = dht_inode_ctx_get_mig_info (this, local->fd->inode, &subvol1, &subvol2); @@ -300,8 +300,8 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) { if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -326,8 +326,8 @@ dht_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); inode = (local->fd) ? local->fd->inode : local->loc.inode; @@ -536,8 +536,8 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) { if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -557,8 +557,8 @@ dht_fallocate_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); dht_inode_ctx_get_mig_info (this, local->fd->inode, &src_subvol, &dst_subvol); @@ -722,8 +722,8 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) { if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -743,8 +743,8 @@ dht_discard_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); dht_inode_ctx_get_mig_info (this, local->fd->inode, &src_subvol, &dst_subvol); @@ -902,8 +902,8 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, if (local->call_cnt != 1) { if (local->stbuf.ia_blocks) { - dht_iatt_merge (this, postbuf, &local->stbuf, NULL); - dht_iatt_merge (this, prebuf, &local->prebuf, NULL); + dht_iatt_merge (this, postbuf, &local->stbuf); + dht_iatt_merge (this, prebuf, &local->prebuf); } goto out; } @@ -923,8 +923,8 @@ dht_zerofill_cbk(call_frame_t *frame, void *cookie, xlator_t *this, /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { - dht_iatt_merge (this, &local->stbuf, postbuf, NULL); - dht_iatt_merge (this, &local->prebuf, prebuf, NULL); + dht_iatt_merge (this, &local->stbuf, postbuf); + dht_iatt_merge (this, &local->prebuf, prebuf); ret = dht_inode_ctx_get_mig_info (this, local->fd->inode, &subvol1, &subvol2); @@ -1183,8 +1183,8 @@ dht_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - dht_iatt_merge (this, &local->prebuf, statpre, prev); - dht_iatt_merge (this, &local->stbuf, statpost, prev); + dht_iatt_merge (this, &local->prebuf, statpre); + dht_iatt_merge (this, &local->stbuf, statpost); local->op_ret = 0; local->op_errno = 0; @@ -1229,8 +1229,8 @@ dht_non_mds_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, goto unlock; } - dht_iatt_merge (this, &local->prebuf, statpre, prev); - dht_iatt_merge (this, &local->stbuf, statpost, prev); + dht_iatt_merge (this, &local->prebuf, statpre); + dht_iatt_merge (this, &local->stbuf, statpost); local->op_ret = 0; local->op_errno = 0; @@ -1281,8 +1281,8 @@ dht_mds_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->op_ret = 0; loc_stbuf = local->stbuf; - dht_iatt_merge (this, &local->prebuf, statpre, prev); - dht_iatt_merge (this, &local->stbuf, statpost, prev); + dht_iatt_merge (this, &local->prebuf, statpre); + dht_iatt_merge (this, &local->stbuf, statpost); local->call_cnt = conf->subvolume_cnt - 1; for (i = 0; i < conf->subvolume_cnt; i++) { diff --git a/xlators/cluster/dht/src/dht-rename.c b/xlators/cluster/dht/src/dht-rename.c index 1d0c2bbc7ed..62b72b7dc29 100644 --- a/xlators/cluster/dht/src/dht-rename.c +++ b/xlators/cluster/dht/src/dht-rename.c @@ -153,11 +153,11 @@ dht_rename_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * FIXME: is this the correct way to build stbuf and * parent bufs? */ - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->preoldparent, preoldparent, prev); - dht_iatt_merge (this, &local->postoldparent, postoldparent, prev); - dht_iatt_merge (this, &local->preparent, prenewparent, prev); - dht_iatt_merge (this, &local->postparent, postnewparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->preoldparent, preoldparent); + dht_iatt_merge (this, &local->postoldparent, postoldparent); + dht_iatt_merge (this, &local->preparent, prenewparent); + dht_iatt_merge (this, &local->postparent, postnewparent); unwind: this_call_cnt = dht_frame_return (frame); @@ -248,11 +248,11 @@ dht_rename_hashed_dir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, * FIXME: is this the correct way to build stbuf and * parent bufs? */ - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->preoldparent, preoldparent, prev); - dht_iatt_merge (this, &local->postoldparent, postoldparent, prev); - dht_iatt_merge (this, &local->preparent, prenewparent, prev); - dht_iatt_merge (this, &local->postparent, postnewparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->preoldparent, preoldparent); + dht_iatt_merge (this, &local->postoldparent, postoldparent); + dht_iatt_merge (this, &local->preparent, prenewparent); + dht_iatt_merge (this, &local->postparent, postnewparent); call_cnt = local->call_cnt = conf->subvolume_cnt - 1; @@ -1071,13 +1071,11 @@ err: /* Merge attrs only from src_cached. In case there of src_cached != * dst_hashed, this ignores linkfile attrs. */ if (prev == src_cached) { - dht_iatt_merge (this, &local->stbuf, stbuf, prev); - dht_iatt_merge (this, &local->preoldparent, preoldparent, - prev); - dht_iatt_merge (this, &local->postoldparent, postoldparent, - prev); - dht_iatt_merge (this, &local->preparent, prenewparent, prev); - dht_iatt_merge (this, &local->postparent, postnewparent, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); + dht_iatt_merge (this, &local->preoldparent, preoldparent); + dht_iatt_merge (this, &local->postoldparent, postoldparent); + dht_iatt_merge (this, &local->preparent, prenewparent); + dht_iatt_merge (this, &local->postparent, postnewparent); } @@ -1245,7 +1243,7 @@ dht_rename_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->op_errno = op_errno; local->added_link = _gf_false; } else - dht_iatt_merge (this, &local->stbuf, stbuf, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); if (local->op_ret == -1) goto cleanup; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index 2aa75bcc4cd..6c526bd6990 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -201,7 +201,7 @@ dht_refresh_layout_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret = dht_layout_merge (this, layout, prev, op_ret, op_errno, xattr); - dht_iatt_merge (this, &local->stbuf, stbuf, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); if (op_ret == -1) { gf_uuid_unparse (local->loc.gfid, gfid); @@ -698,7 +698,7 @@ dht_selfheal_dir_xattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, LOCK (&frame->lock); { - dht_iatt_merge (this, &local->stbuf, stbuf, subvol); + dht_iatt_merge (this, &local->stbuf, stbuf); } UNLOCK (&frame->lock); @@ -1154,8 +1154,8 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, local->loc.path, gfid ); goto out; } - dht_iatt_merge (this, &local->preparent, preparent, prev); - dht_iatt_merge (this, &local->postparent, postparent, prev); + dht_iatt_merge (this, &local->preparent, preparent); + dht_iatt_merge (this, &local->postparent, postparent); ret = 0; out: @@ -1366,7 +1366,6 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie, dht_layout_t *layout = NULL; dht_conf_t *conf = 0; loc_t *loc = NULL; - xlator_t *prev = NULL; int check_mds = 0; int errst = 0; int32_t mds_xattr_val[1] = {0}; @@ -1377,7 +1376,6 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie, local = frame->local; layout = local->layout; loc = &local->loc; - prev = cookie; conf = this->private; if (local->gfid) @@ -1394,7 +1392,7 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie, } if (!op_ret) { - dht_iatt_merge (this, &local->stbuf, stbuf, prev); + dht_iatt_merge (this, &local->stbuf, stbuf); } check_mds = dht_dict_get_array (xattr, conf->mds_xattr_key, mds_xattr_val, 1, &errst); -- cgit