summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-09-03 13:59:30 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-04 01:45:15 -0700
commitd838e4496dec6b8889de47dd0ee31c4899ec7407 (patch)
tree051793458e42079aacdfcb455a051eca13c60104 /xlators/cluster/dht/src
parentb304333f8686468b2d3b2c60e040b1667d8c38c9 (diff)
gfid: changes in mknod() 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/dht/src')
-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
4 files changed, 18 insertions, 11 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 17ddb3247ab..bf84dfa6b22 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 09af83d891b..950318b7e5c 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 e807ff304e0..190fbae695e 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 f47ffb1fde4..f3de211fd4b 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;