summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-common.c5
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.c7
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.h2
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c6
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c2
-rw-r--r--xlators/cluster/afr/src/afr.h1
-rw-r--r--xlators/cluster/dht/src/dht-common.c10
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c2
-rw-r--r--xlators/cluster/dht/src/nufa.c9
-rw-r--r--xlators/cluster/dht/src/switch.c8
-rw-r--r--xlators/cluster/stripe/src/stripe.c12
11 files changed, 41 insertions, 23 deletions
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;
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 17ddb3247..bf84dfa6b 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2804,7 +2804,8 @@ dht_mknod_linkfile_create_cbk (call_frame_t *frame, void *cookie,
STACK_WIND (frame, dht_newfile_cbk,
cached_subvol, cached_subvol->fops->mknod,
- &local->loc, local->mode, local->rdev);
+ &local->loc, local->mode, local->rdev,
+ local->params);
return 0;
err:
@@ -2814,7 +2815,7 @@ dht_mknod_linkfile_create_cbk (call_frame_t *frame, void *cookie,
int
dht_mknod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t rdev)
+ loc_t *loc, mode_t mode, dev_t rdev, dict_t *params)
{
xlator_t *subvol = NULL;
int op_errno = -1;
@@ -2862,13 +2863,14 @@ dht_mknod (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
subvol, subvol->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
} else {
avail_subvol = dht_free_disk_available_subvol (this, subvol);
if (avail_subvol != subvol) {
/* Choose the minimum filled volume, and create the
files there */
+ local->params = dict_ref (params);
local->cached_subvol = avail_subvol;
local->mode = mode;
local->rdev = rdev;
@@ -2882,7 +2884,7 @@ dht_mknod (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
subvol, subvol->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
}
}
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 09af83d89..950318b7e 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -124,7 +124,7 @@ dht_linkfile_create (call_frame_t *frame, fop_mknod_cbk_t linkfile_cbk,
STACK_WIND (frame, dht_linkfile_create_cbk,
fromvol, fromvol->fops->mknod, loc,
- S_IFREG | DHT_LINKFILE_MODE, 0);
+ S_IFREG | DHT_LINKFILE_MODE, 0, NULL);
return 0;
}
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index e807ff304..190fbae69 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -410,7 +410,9 @@ nufa_mknod_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
local->cached_subvol,
local->cached_subvol->fops->mknod,
- &local->loc, local->mode, local->rdev);
+ &local->loc, local->mode, local->rdev,
+ local->params);
+
return 0;
}
@@ -425,7 +427,7 @@ nufa_mknod_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
nufa_mknod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t rdev)
+ loc_t *loc, mode_t mode, dev_t rdev, dict_t *params)
{
dht_local_t *local = NULL;
dht_conf_t *conf = NULL;
@@ -477,6 +479,7 @@ nufa_mknod (call_frame_t *frame, xlator_t *this,
goto err;
}
+ local->params = dict_ref (params);
local->mode = mode;
local->rdev = rdev;
local->cached_subvol = avail_subvol;
@@ -491,7 +494,7 @@ nufa_mknod (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
subvol, subvol->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
return 0;
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index f47ffb1fd..f3de211fd 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -511,7 +511,8 @@ switch_mknod_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
local->cached_subvol,
local->cached_subvol->fops->mknod,
- &local->loc, local->mode, local->rdev);
+ &local->loc, local->mode, local->rdev,
+ local->params);
return 0;
}
@@ -524,7 +525,7 @@ switch_mknod_linkfile_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
switch_mknod (call_frame_t *frame, xlator_t *this,
- loc_t *loc, mode_t mode, dev_t rdev)
+ loc_t *loc, mode_t mode, dev_t rdev, dict_t *params)
{
dht_local_t *local = NULL;
dht_conf_t *conf = NULL;
@@ -575,6 +576,7 @@ switch_mknod (call_frame_t *frame, xlator_t *this,
goto err;
}
+ local->params = dict_ref (params);
local->mode = mode;
local->rdev = rdev;
local->cached_subvol = avail_subvol;
@@ -589,7 +591,7 @@ switch_mknod (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
subvol, subvol->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
return 0;
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index a13bba34f..658b9a1b0 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -181,7 +181,8 @@ stripe_entry_self_heal (call_frame_t *frame, xlator_t *this,
trav->xlator, trav->xlator->fops->mknod,
&local->loc,
st_mode_from_ia (local->stbuf.ia_prot,
- local->stbuf.ia_type), 0);
+ local->stbuf.ia_type), 0,
+ NULL);
}
if (IA_ISDIR (local->stbuf.ia_type)) {
STACK_WIND (rframe, stripe_sh_make_entry_cbk,
@@ -1425,9 +1426,10 @@ stripe_single_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
}
-int32_t
+
+int
stripe_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- dev_t rdev)
+ dev_t rdev, dict_t *params)
{
stripe_private_t *priv = NULL;
stripe_local_t *local = NULL;
@@ -1482,7 +1484,7 @@ stripe_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
while (trav) {
STACK_WIND (frame, stripe_mknod_ifreg_cbk,
trav->xlator, trav->xlator->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
trav = trav->next;
}
@@ -1492,7 +1494,7 @@ stripe_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
STACK_WIND (frame, stripe_single_mknod_cbk,
FIRST_CHILD(this), FIRST_CHILD(this)->fops->mknod,
- loc, mode, rdev);
+ loc, mode, rdev, params);
return 0;
err: