From 7af8d8edbd8554235348e0f54348edf222c0b46e Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 12 Mar 2009 16:21:51 +0530 Subject: Add extra 'volume' parameter to inodelk/entrylk calls Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr-self-heal-common.c | 2 ++ xlators/cluster/afr/src/afr-self-heal-data.c | 2 ++ xlators/cluster/afr/src/afr-self-heal-entry.c | 2 ++ xlators/cluster/afr/src/afr-self-heal-metadata.c | 2 ++ xlators/cluster/afr/src/afr-transaction.c | 27 +++++++++++++++--------- xlators/cluster/afr/src/afr.c | 22 ++++++++++--------- xlators/cluster/dht/src/dht-common.c | 16 +++++++------- xlators/cluster/ha/src/ha.c | 13 ++++++++---- xlators/cluster/map/src/map.c | 16 +++++++------- xlators/cluster/unify/src/unify.c | 16 +++++++------- 10 files changed, 70 insertions(+), 48 deletions(-) (limited to 'xlators/cluster') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index f418085e53e..aea31a748f5 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -504,6 +504,7 @@ sh_missing_entries_finish (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, sh_missing_entries_unlck_cbk, priv->children[i], priv->children[i]->fops->entrylk, + this->name, &sh->parent_loc, local->loc.name, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); @@ -1008,6 +1009,7 @@ afr_self_heal_missing_entries (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, sh_missing_entries_lk_cbk, priv->children[i], priv->children[i]->fops->entrylk, + this->name, &sh->parent_loc, local->loc.name, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK); if (!--call_count) diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index 674d2923f1c..775845fe6be 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -231,6 +231,7 @@ afr_sh_data_unlock (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->inodelk, + this->name, &local->loc, F_SETLK, &flock); if (!--call_count) break; @@ -995,6 +996,7 @@ afr_sh_data_lock (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->inodelk, + this->name, &local->loc, F_SETLK, &flock); if (!--call_count) break; diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index d5b6dff3cb4..e7431249fc3 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -146,6 +146,7 @@ afr_sh_entry_unlock (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->entrylk, + this->name, &local->loc, NULL, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); if (!--call_count) @@ -2001,6 +2002,7 @@ afr_sh_entry_lock (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->entrylk, + this->name, &local->loc, NULL, ENTRYLK_LOCK_NB, ENTRYLK_WRLCK); if (!--call_count) diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c index 6c66f8704b0..de8fa1a3914 100644 --- a/xlators/cluster/afr/src/afr-self-heal-metadata.c +++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c @@ -158,6 +158,7 @@ afr_sh_metadata_finish (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, afr_sh_metadata_unlck_cbk, priv->children[i], priv->children[i]->fops->inodelk, + this->name, &local->loc, F_SETLK, &flock); if (!--call_count) @@ -755,6 +756,7 @@ afr_sh_metadata_lock (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->inodelk, + this->name, &local->loc, F_SETLK, &flock); if (!--call_count) diff --git a/xlators/cluster/afr/src/afr-transaction.c b/xlators/cluster/afr/src/afr-transaction.c index 82c2ee3406f..0590b598405 100644 --- a/xlators/cluster/afr/src/afr-transaction.c +++ b/xlators/cluster/afr/src/afr-transaction.c @@ -309,12 +309,14 @@ afr_unlock (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, afr_unlock_common_cbk, priv->children[i], priv->children[i]->fops->finodelk, - local->fd, F_SETLK, &flock); + this->name, local->fd, + F_SETLK, &flock); } else { STACK_WIND (frame, afr_unlock_common_cbk, priv->children[i], priv->children[i]->fops->inodelk, - &local->loc, F_SETLK, &flock); + this->name, &local->loc, + F_SETLK, &flock); } break; @@ -324,6 +326,7 @@ afr_unlock (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, afr_unlock_common_cbk, priv->children[i], priv->children[i]->fops->entrylk, + this->name, &local->transaction.new_parent_loc, local->transaction.new_basename, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); @@ -337,14 +340,15 @@ afr_unlock (call_frame_t *frame, xlator_t *this) STACK_WIND (frame, afr_unlock_common_cbk, priv->children[i], priv->children[i]->fops->fentrylk, - local->fd, + this->name, local->fd, local->transaction.basename, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); } else { STACK_WIND (frame, afr_unlock_common_cbk, priv->children[i], priv->children[i]->fops->entrylk, - &local->transaction.parent_loc, + this->name, + &local->transaction.parent_loc, local->transaction.basename, ENTRYLK_UNLOCK, ENTRYLK_WRLCK); @@ -838,14 +842,16 @@ int afr_lock_rec (call_frame_t *frame, xlator_t *this, int child_index) (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->finodelk, - local->fd, F_SETLKW, &flock); + this->name, local->fd, + F_SETLKW, &flock); } else { STACK_WIND_COOKIE (frame, afr_lock_cbk, (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->inodelk, - &local->loc, F_SETLKW, &flock); + this->name, &local->loc, + F_SETLKW, &flock); } break; @@ -878,14 +884,14 @@ int afr_lock_rec (call_frame_t *frame, xlator_t *this, int child_index) (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->entrylk, - lower, lower_name, + this->name, lower, lower_name, ENTRYLK_LOCK, ENTRYLK_WRLCK); STACK_WIND_COOKIE (frame, afr_lock_cbk, (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->entrylk, - higher, higher_name, + this->name, higher, higher_name, ENTRYLK_LOCK, ENTRYLK_WRLCK); break; @@ -897,7 +903,7 @@ int afr_lock_rec (call_frame_t *frame, xlator_t *this, int child_index) (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->fentrylk, - local->fd, + this->name, local->fd, local->transaction.basename, ENTRYLK_LOCK, ENTRYLK_WRLCK); } else { @@ -905,7 +911,8 @@ int afr_lock_rec (call_frame_t *frame, xlator_t *this, int child_index) (void *) (long) child_index, priv->children[child_index], priv->children[child_index]->fops->entrylk, - &local->transaction.parent_loc, + this->name, + &local->transaction.parent_loc, local->transaction.basename, ENTRYLK_LOCK, ENTRYLK_WRLCK); } diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index acd7f8d0236..bd213b5326d 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -1173,8 +1173,8 @@ afr_inodelk_cbk (call_frame_t *frame, void *cookie, int32_t -afr_inodelk (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t cmd, struct flock *flock) +afr_inodelk (call_frame_t *frame, xlator_t *this, + const char *volume, loc_t *loc, int32_t cmd, struct flock *flock) { afr_private_t *priv = NULL; afr_local_t *local = NULL; @@ -1208,7 +1208,7 @@ afr_inodelk (call_frame_t *frame, xlator_t *this, loc_t *loc, STACK_WIND (frame, afr_inodelk_cbk, priv->children[i], priv->children[i]->fops->inodelk, - loc, cmd, flock); + volume, loc, cmd, flock); if (!--call_count) break; @@ -1254,8 +1254,8 @@ afr_finodelk_cbk (call_frame_t *frame, void *cookie, int32_t -afr_finodelk (call_frame_t *frame, xlator_t *this, fd_t *fd, - int32_t cmd, struct flock *flock) +afr_finodelk (call_frame_t *frame, xlator_t *this, + const char *volume, fd_t *fd, int32_t cmd, struct flock *flock) { afr_private_t *priv = NULL; afr_local_t *local = NULL; @@ -1289,7 +1289,7 @@ afr_finodelk (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (frame, afr_finodelk_cbk, priv->children[i], priv->children[i]->fops->finodelk, - fd, cmd, flock); + volume, fd, cmd, flock); if (!--call_count) break; @@ -1335,7 +1335,8 @@ afr_entrylk_cbk (call_frame_t *frame, void *cookie, int32_t -afr_entrylk (call_frame_t *frame, xlator_t *this, loc_t *loc, +afr_entrylk (call_frame_t *frame, xlator_t *this, + const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, entrylk_type type) { afr_private_t *priv = NULL; @@ -1370,7 +1371,7 @@ afr_entrylk (call_frame_t *frame, xlator_t *this, loc_t *loc, STACK_WIND (frame, afr_entrylk_cbk, priv->children[i], priv->children[i]->fops->entrylk, - loc, basename, cmd, type); + volume, loc, basename, cmd, type); if (!--call_count) break; @@ -1417,7 +1418,8 @@ afr_fentrylk_cbk (call_frame_t *frame, void *cookie, int32_t -afr_fentrylk (call_frame_t *frame, xlator_t *this, fd_t *fd, +afr_fentrylk (call_frame_t *frame, xlator_t *this, + const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd, entrylk_type type) { afr_private_t *priv = NULL; @@ -1452,7 +1454,7 @@ afr_fentrylk (call_frame_t *frame, xlator_t *this, fd_t *fd, STACK_WIND (frame, afr_fentrylk_cbk, priv->children[i], priv->children[i]->fops->fentrylk, - fd, basename, cmd, type); + volume, fd, basename, cmd, type); if (!--call_count) break; diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 6d97f8f7a4d..27bac7627f7 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3163,7 +3163,7 @@ dht_inodelk_cbk (call_frame_t *frame, void *cookie, int32_t dht_inodelk (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) { xlator_t *subvol = NULL; int op_errno = -1; @@ -3198,7 +3198,7 @@ dht_inodelk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_inodelk_cbk, subvol, subvol->fops->inodelk, - loc, cmd, lock); + volume, loc, cmd, lock); return 0; @@ -3222,7 +3222,7 @@ dht_finodelk_cbk (call_frame_t *frame, void *cookie, int32_t dht_finodelk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) { xlator_t *subvol = NULL; int op_errno = -1; @@ -3243,7 +3243,7 @@ dht_finodelk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_finodelk_cbk, subvol, subvol->fops->finodelk, - fd, cmd, lock); + this->name, fd, cmd, lock); return 0; @@ -3266,7 +3266,7 @@ dht_entrylk_cbk (call_frame_t *frame, void *cookie, int32_t dht_entrylk (call_frame_t *frame, xlator_t *this, - loc_t *loc, const char *basename, + const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, entrylk_type type) { xlator_t *subvol = NULL; @@ -3300,7 +3300,7 @@ dht_entrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_entrylk_cbk, subvol, subvol->fops->entrylk, - loc, basename, cmd, type); + volume, loc, basename, cmd, type); return 0; @@ -3322,7 +3322,7 @@ dht_fentrylk_cbk (call_frame_t *frame, void *cookie, int32_t dht_fentrylk (call_frame_t *frame, xlator_t *this, - fd_t *fd, const char *basename, + const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd, entrylk_type type) { xlator_t *subvol = NULL; @@ -3342,7 +3342,7 @@ dht_fentrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_fentrylk_cbk, subvol, subvol->fops->fentrylk, - fd, basename, cmd, type); + volume, fd, basename, cmd, type); return 0; diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c index b8670ecfb14..7e25f6c11c9 100644 --- a/xlators/cluster/ha/src/ha.c +++ b/xlators/cluster/ha/src/ha.c @@ -2933,6 +2933,7 @@ ha_inode_entry_lk_cbk (call_frame_t *frame, int32_t ha_inodelk (call_frame_t *frame, xlator_t *this, + const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) @@ -2946,13 +2947,15 @@ ha_inodelk (call_frame_t *frame, goto err; } local = frame->local; - local->stub = fop_inodelk_stub (frame, ha_inodelk, loc, cmd, lock); + local->stub = fop_inodelk_stub (frame, ha_inodelk, volume, + loc, cmd, lock); STACK_WIND_COOKIE (frame, ha_inode_entry_lk_cbk, (void *)(long)local->active, HA_ACTIVE_CHILD(this, local), HA_ACTIVE_CHILD(this, local)->fops->inodelk, - loc, + volume, + loc, cmd, lock); return 0; @@ -2964,6 +2967,7 @@ err: int32_t ha_entrylk (call_frame_t *frame, xlator_t *this, + const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, @@ -2978,13 +2982,14 @@ ha_entrylk (call_frame_t *frame, goto err; } local = frame->local; - local->stub = fop_entrylk_stub (frame, ha_entrylk, loc, basename, cmd, type); + local->stub = fop_entrylk_stub (frame, ha_entrylk, volume, + loc, basename, cmd, type); STACK_WIND_COOKIE (frame, ha_inode_entry_lk_cbk, (void *)(long)local->active, HA_ACTIVE_CHILD(this, local), HA_ACTIVE_CHILD(this, local)->fops->entrylk, - loc, basename, cmd, type); + volume, loc, basename, cmd, type); return 0; err: STACK_UNWIND (frame, -1, op_errno); diff --git a/xlators/cluster/map/src/map.c b/xlators/cluster/map/src/map.c index c44b24ce5b2..f4859ee7199 100644 --- a/xlators/cluster/map/src/map.c +++ b/xlators/cluster/map/src/map.c @@ -1053,7 +1053,7 @@ map_lk (call_frame_t *frame, int32_t map_inodelk (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) { int32_t op_errno = 1; xlator_t *subvol = NULL; @@ -1074,7 +1074,7 @@ map_inodelk (call_frame_t *frame, xlator_t *this, default_inodelk_cbk, subvol, subvol->fops->inodelk, - loc, cmd, lock); + volume, loc, cmd, lock); return 0; err: STACK_UNWIND (frame, -1, op_errno, NULL, NULL); @@ -1085,7 +1085,7 @@ map_inodelk (call_frame_t *frame, xlator_t *this, int32_t map_finodelk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) { int32_t op_errno = 1; xlator_t *subvol = NULL; @@ -1105,7 +1105,7 @@ map_finodelk (call_frame_t *frame, xlator_t *this, default_finodelk_cbk, subvol, subvol->fops->finodelk, - fd, cmd, lock); + volume, fd, cmd, lock); return 0; err: STACK_UNWIND (frame, -1, op_errno, NULL, NULL); @@ -1115,7 +1115,7 @@ map_finodelk (call_frame_t *frame, xlator_t *this, int32_t map_entrylk (call_frame_t *frame, xlator_t *this, - loc_t *loc, const char *basename, + const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, entrylk_type type) { int32_t op_errno = 1; @@ -1136,7 +1136,7 @@ map_entrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, default_entrylk_cbk, subvol, subvol->fops->entrylk, - loc, basename, cmd, type); + volume, loc, basename, cmd, type); return 0; err: STACK_UNWIND (frame, -1, op_errno, NULL, NULL); @@ -1146,7 +1146,7 @@ map_entrylk (call_frame_t *frame, xlator_t *this, int32_t map_fentrylk (call_frame_t *frame, xlator_t *this, - fd_t *fd, const char *basename, + const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd, entrylk_type type) { int32_t op_errno = 1; @@ -1166,7 +1166,7 @@ map_fentrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, default_fentrylk_cbk, subvol, subvol->fops->fentrylk, - fd, basename, cmd, type); + volume, fd, basename, cmd, type); return 0; err: STACK_UNWIND (frame, -1, op_errno, NULL, NULL); diff --git a/xlators/cluster/unify/src/unify.c b/xlators/cluster/unify/src/unify.c index 6455b4f072d..5122a006173 100644 --- a/xlators/cluster/unify/src/unify.c +++ b/xlators/cluster/unify/src/unify.c @@ -3894,7 +3894,7 @@ unify_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_finodelk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int cmd, struct flock *flock) + const char *volume, fd_t *fd, int cmd, struct flock *flock) { UNIFY_CHECK_FD_CTX_AND_UNWIND_ON_ERR (fd); xlator_t *child = NULL; @@ -3905,7 +3905,7 @@ unify_finodelk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, unify_finodelk_cbk, child, child->fops->finodelk, - fd, cmd, flock); + volume, fd, cmd, flock); return 0; } @@ -3928,7 +3928,7 @@ unify_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_fentrylk (call_frame_t *frame, xlator_t *this, - fd_t *fd, const char *basename, + const char *volume, fd_t *fd, const char *basename, entrylk_cmd cmd, entrylk_type type) { @@ -3941,7 +3941,7 @@ unify_fentrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, unify_fentrylk_cbk, child, child->fops->fentrylk, - fd, basename, cmd, type); + volume, fd, basename, cmd, type); return 0; } @@ -3998,7 +3998,7 @@ unify_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_inodelk (call_frame_t *frame, xlator_t *this, - loc_t *loc, int cmd, struct flock *flock) + const char *volume, loc_t *loc, int cmd, struct flock *flock) { xlator_t *child = NULL; @@ -4006,7 +4006,7 @@ unify_inodelk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, unify_inodelk_cbk, child, child->fops->inodelk, - loc, cmd, flock); + volume, loc, cmd, flock); return 0; } @@ -4029,7 +4029,7 @@ unify_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_entrylk (call_frame_t *frame, xlator_t *this, - loc_t *loc, const char *basename, + const char *volume, loc_t *loc, const char *basename, entrylk_cmd cmd, entrylk_type type) { @@ -4039,7 +4039,7 @@ unify_entrylk (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, unify_entrylk_cbk, child, child->fops->entrylk, - loc, basename, cmd, type); + volume, loc, basename, cmd, type); return 0; } -- cgit