diff options
author | Anand Avati <avati@gluster.com> | 2010-09-03 13:59:48 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-04 01:45:21 -0700 |
commit | 8b9a144414162413a399d59975fe3b7347907f4f (patch) | |
tree | b37a01b2c146b47a772dd3a7f4ce3563577923fa /xlators/cluster | |
parent | d838e4496dec6b8889de47dd0ee31c4899ec7407 (diff) |
gfid: changes in mkdir() prototype to have params dictionary with uuid in it
Signed-off-by: Anand V. Avati <avati@blackhole.gluster.com>
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 5 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-dir-write.c | 7 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-dir-write.h | 2 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-common.c | 2 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 5 | ||||
-rw-r--r-- | xlators/cluster/afr/src/afr.h | 1 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 9 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-selfheal.c | 3 | ||||
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 11 |
9 files changed, 31 insertions, 14 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 1cbc3ba558f..e5330b4e468 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -400,6 +400,11 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this) dict_unref (local->cont.mknod.params); } + { /* mkdir */ + if (local->cont.mkdir.params) + dict_unref (local->cont.mkdir.params); + } + { /* writev */ GF_FREE (local->cont.writev.vector); } diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index d1077af9eef..70da6f94955 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -762,7 +762,8 @@ afr_mkdir_wind (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->mkdir, - &local->loc, local->cont.mkdir.mode); + &local->loc, local->cont.mkdir.mode, + local->cont.mkdir.params); if (!--call_count) break; } @@ -789,7 +790,7 @@ afr_mkdir_done (call_frame_t *frame, xlator_t *this) int afr_mkdir (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode) + loc_t *loc, mode_t mode, dict_t *params) { afr_private_t * priv = NULL; afr_local_t * local = NULL; @@ -833,6 +834,8 @@ afr_mkdir (call_frame_t *frame, xlator_t *this, UNLOCK (&priv->read_child_lock); local->cont.mkdir.mode = mode; + if (params) + local->cont.mkdir.params = dict_ref (params); if (loc->parent) local->cont.mkdir.parent_ino = loc->parent->ino; diff --git a/xlators/cluster/afr/src/afr-dir-write.h b/xlators/cluster/afr/src/afr-dir-write.h index 2394c46698b..878e1e714cf 100644 --- a/xlators/cluster/afr/src/afr-dir-write.h +++ b/xlators/cluster/afr/src/afr-dir-write.h @@ -31,7 +31,7 @@ afr_mknod (call_frame_t *frame, xlator_t *this, int32_t afr_mkdir (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode); + loc_t *loc, mode_t mode, dict_t *params); int32_t afr_unlink (call_frame_t *frame, xlator_t *this, diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index cc26abc02a0..fda879d3cb2 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -1070,7 +1070,7 @@ sh_missing_entries_mkdir (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->mkdir, - &local->loc, st_mode); + &local->loc, st_mode, NULL); 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 f95d8fc7e9c..140795bdd7f 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -575,7 +575,7 @@ afr_sh_entry_expunge_lookup_trash_cbk (call_frame_t *expunge_frame, void *cookie (void *) (long) active_src, priv->children[active_src], priv->children[active_src]->fops->mkdir, - &trash_loc, 0777); + &trash_loc, 0777, NULL); loc_wipe (&trash_loc); return 0; @@ -1315,7 +1315,8 @@ afr_sh_entry_impunge_mkdir (call_frame_t *impunge_frame, xlator_t *this, priv->children[child_index], priv->children[child_index]->fops->mkdir, &impunge_local->loc, - st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type)); + st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type), + NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 2f44dce7073..85f66c8255c 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -509,6 +509,7 @@ typedef struct _afr_local { uint64_t gen; ino_t parent_ino; int32_t mode; + dict_t *params; inode_t *inode; struct iatt buf; struct iatt read_child_buf; diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index bf84dfa6b22..0da8ad73eef 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3493,7 +3493,7 @@ dht_mkdir_hashed_cbk (call_frame_t *frame, void *cookie, STACK_WIND (frame, dht_mkdir_cbk, conf->subvolumes[i], conf->subvolumes[i]->fops->mkdir, - &local->loc, local->mode); + &local->loc, local->mode, local->params); } return 0; err: @@ -3501,9 +3501,10 @@ err: return 0; } + int dht_mkdir (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode) + loc_t *loc, mode_t mode, dict_t *params) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -3552,6 +3553,8 @@ dht_mkdir (call_frame_t *frame, xlator_t *this, goto err; } + local->params = dict_ref (params); + local->layout = dht_layout_new (this, conf->subvolume_cnt); if (!local->layout) { gf_log (this->name, GF_LOG_ERROR, @@ -3563,7 +3566,7 @@ dht_mkdir (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_mkdir_hashed_cbk, hashed_subvol, hashed_subvol->fops->mkdir, - loc, mode); + loc, mode, params); return 0; diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c index f3504935ded..d5d9892b556 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -277,7 +277,8 @@ dht_selfheal_dir_mkdir (call_frame_t *frame, loc_t *loc, layout->list[i].xlator->fops->mkdir, loc, st_mode_from_ia (local->stbuf.ia_prot, - local->stbuf.ia_type)); + local->stbuf.ia_type), + NULL); } } diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 658b9a1b004..5ec3d668121 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -188,7 +188,8 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this, STACK_WIND (rframe, stripe_sh_make_entry_cbk, trav->xlator, trav->xlator->fops->mkdir, &local->loc, st_mode_from_ia (local->stbuf.ia_prot, - local->stbuf.ia_type)); + local->stbuf.ia_type), + NULL); } trav = trav->next; } @@ -1585,8 +1586,10 @@ out: return 0; } -int32_t -stripe_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode) + +int +stripe_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, + dict_t *params) { stripe_private_t *priv = NULL; stripe_local_t *local = NULL; @@ -1622,7 +1625,7 @@ stripe_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode) while (trav) { STACK_WIND (frame, stripe_mkdir_cbk, trav->xlator, trav->xlator->fops->mkdir, - loc, mode); + loc, mode, params); trav = trav->next; } |