From d838e4496dec6b8889de47dd0ee31c4899ec7407 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Fri, 3 Sep 2010 13:59:30 +0000 Subject: gfid: changes in mknod() prototype to have params dictionary with uuid in it Signed-off-by: Anand V. Avati Signed-off-by: Anand V. Avati Signed-off-by: Vijay Bellur BUG: 971 (dynamic volume management) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971 --- xlators/cluster/afr/src/afr-common.c | 5 +++++ xlators/cluster/afr/src/afr-dir-write.c | 7 +++++-- xlators/cluster/afr/src/afr-dir-write.h | 2 +- xlators/cluster/afr/src/afr-self-heal-common.c | 6 +++--- xlators/cluster/afr/src/afr-self-heal-entry.c | 2 +- xlators/cluster/afr/src/afr.h | 1 + 6 files changed, 16 insertions(+), 7 deletions(-) (limited to 'xlators/cluster/afr') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 6a732e118..1cbc3ba55 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -395,6 +395,11 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this) dict_unref (local->cont.create.params); } + { /* mknod */ + if (local->cont.mknod.params) + dict_unref (local->cont.mknod.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 3e9f48f9a..d1077af9e 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -508,7 +508,8 @@ afr_mknod_wind (call_frame_t *frame, xlator_t *this) priv->children[i], priv->children[i]->fops->mknod, &local->loc, local->cont.mknod.mode, - local->cont.mknod.dev); + local->cont.mknod.dev, + local->cont.mknod.params); if (!--call_count) break; } @@ -534,7 +535,7 @@ afr_mknod_done (call_frame_t *frame, xlator_t *this) int afr_mknod (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode, dev_t dev) + loc_t *loc, mode_t mode, dev_t dev, dict_t *params) { afr_private_t * priv = NULL; afr_local_t * local = NULL; @@ -579,6 +580,8 @@ afr_mknod (call_frame_t *frame, xlator_t *this, local->cont.mknod.mode = mode; local->cont.mknod.dev = dev; + if (params) + local->cont.mknod.params = dict_ref (params); if (loc->parent) local->cont.mknod.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 5369ba968..2394c4669 100644 --- a/xlators/cluster/afr/src/afr-dir-write.h +++ b/xlators/cluster/afr/src/afr-dir-write.h @@ -27,7 +27,7 @@ afr_create (call_frame_t *frame, xlator_t *this, int32_t afr_mknod (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode, dev_t dev); + loc_t *loc, mode_t mode, dev_t dev, dict_t *params); int32_t afr_mkdir (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 1324ea3fa..cc26abc02 100644 --- a/xlators/cluster/afr/src/afr-self-heal-common.c +++ b/xlators/cluster/afr/src/afr-self-heal-common.c @@ -987,7 +987,7 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this) int enoent_count = 0; int call_count = 0; mode_t st_mode = 0; - dev_t ia_gen = 0; + dev_t ia_dev = 0; local = frame->local; @@ -1003,7 +1003,7 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this) st_mode = st_mode_from_ia (sh->buf[sh->source].ia_prot, sh->buf[sh->source].ia_type); - ia_gen = sh->buf[sh->source].ia_gen; + ia_dev = sh->buf[sh->source].ia_dev; gf_log (this->name, GF_LOG_TRACE, "mknod %s mode 0%o on %d subvolumes", @@ -1016,7 +1016,7 @@ sh_missing_entries_mknod (call_frame_t *frame, xlator_t *this) (void *) (long) i, priv->children[i], priv->children[i]->fops->mknod, - &local->loc, st_mode, ia_gen); + &local->loc, st_mode, ia_dev, 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 31f8c7bbc..f95d8fc7e 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -1288,7 +1288,7 @@ afr_sh_entry_impunge_mknod (call_frame_t *impunge_frame, xlator_t *this, priv->children[child_index]->fops->mknod, &impunge_local->loc, st_mode_from_ia (stbuf->ia_prot, stbuf->ia_type), - stbuf->ia_rdev); + stbuf->ia_rdev, NULL); return 0; } diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index f222cb0f8..2f44dce70 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -496,6 +496,7 @@ typedef struct _afr_local { ino_t parent_ino; dev_t dev; mode_t mode; + dict_t *params; inode_t *inode; struct iatt buf; struct iatt preparent; -- cgit