summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2010-09-03 14:00:05 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-04 01:45:25 -0700
commita7fd7dbed9b995c173664bcadf3d2e5b6131e4ea (patch)
treea4098ccb4a695f10c07c692edfb9da2b2e561a96 /xlators
parent8b9a144414162413a399d59975fe3b7347907f4f (diff)
gfid: changes in symlink() 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')
-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.h4
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c2
-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.c4
-rw-r--r--xlators/debug/error-gen/src/error-gen.c4
-rw-r--r--xlators/debug/io-stats/src/io-stats.c4
-rw-r--r--xlators/debug/trace/src/trace.c4
-rw-r--r--xlators/features/access-control/src/access-control.c11
-rw-r--r--xlators/features/quota/src/quota.c4
-rw-r--r--xlators/features/read-only/src/read-only.c5
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c2
-rw-r--r--xlators/nfs/server/src/nfs-fops.c4
-rw-r--r--xlators/performance/io-threads/src/io-threads.c9
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c6
-rw-r--r--xlators/performance/symlink-cache/src/symlink-cache.c4
-rw-r--r--xlators/protocol/client/src/client.c5
-rw-r--r--xlators/protocol/legacy/client/src/client-protocol.c2
-rw-r--r--xlators/protocol/legacy/server/src/server-protocol.c2
-rw-r--r--xlators/protocol/server/src/server3_1-fops.c2
-rw-r--r--xlators/storage/posix/src/posix.c5
23 files changed, 55 insertions, 43 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index e5330b4e4..d536b4554 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -405,6 +405,11 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this)
dict_unref (local->cont.mkdir.params);
}
+ { /* symlink */
+ if (local->cont.symlink.params)
+ dict_unref (local->cont.symlink.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 70da6f949..5d5bf40e0 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -1253,7 +1253,8 @@ afr_symlink_wind (call_frame_t *frame, xlator_t *this)
priv->children[i],
priv->children[i]->fops->symlink,
local->cont.symlink.linkpath,
- &local->loc);
+ &local->loc,
+ local->cont.symlink.params);
if (!--call_count)
break;
@@ -1280,7 +1281,7 @@ afr_symlink_done (call_frame_t *frame, xlator_t *this)
int
afr_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc)
+ const char *linkpath, loc_t *loc, dict_t *params)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -1324,6 +1325,8 @@ afr_symlink (call_frame_t *frame, xlator_t *this,
UNLOCK (&priv->read_child_lock);
local->cont.symlink.linkpath = gf_strdup (linkpath);
+ if (params)
+ local->cont.symlink.params = dict_ref (params);
if (loc->parent)
local->cont.symlink.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 878e1e714..e2ed8c759 100644
--- a/xlators/cluster/afr/src/afr-dir-write.h
+++ b/xlators/cluster/afr/src/afr-dir-write.h
@@ -49,9 +49,9 @@ int32_t
afr_rename (call_frame_t *frame, xlator_t *this,
loc_t *oldloc, loc_t *newloc);
-int32_t
+int
afr_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *oldloc);
+ const char *linkpath, loc_t *oldloc, dict_t *params);
int32_t
afr_setdents (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 fda879d3c..0e25be694 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1115,7 +1115,7 @@ sh_missing_entries_symlink (call_frame_t *frame, xlator_t *this,
(void *) (long) i,
priv->children[i],
priv->children[i]->fops->symlink,
- link, &local->loc);
+ link, &local->loc, 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 140795bdd..af6c0c689 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -1341,7 +1341,7 @@ afr_sh_entry_impunge_symlink (call_frame_t *impunge_frame, xlator_t *this,
(void *) (long) child_index,
priv->children[child_index],
priv->children[child_index]->fops->symlink,
- linkname, &impunge_local->loc);
+ linkname, &impunge_local->loc, NULL);
return 0;
}
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index 85f66c825..af3e7f204 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -561,6 +561,7 @@ typedef struct _afr_local {
uint64_t gen;
ino_t parent_ino;
inode_t *inode;
+ dict_t *params;
struct iatt buf;
struct iatt read_child_buf;
char *linkpath;
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 0da8ad73e..24430e6bc 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -2901,7 +2901,7 @@ err:
int
dht_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkname, loc_t *loc)
+ const char *linkname, loc_t *loc, dict_t *params)
{
xlator_t *subvol = NULL;
int op_errno = -1;
@@ -2942,7 +2942,7 @@ dht_symlink (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, dht_newfile_cbk,
subvol, subvol->fops->symlink,
- linkname, loc);
+ linkname, loc, params);
return 0;
diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c
index e7ed8c6a8..095b077b4 100644
--- a/xlators/debug/error-gen/src/error-gen.c
+++ b/xlators/debug/error-gen/src/error-gen.c
@@ -847,7 +847,7 @@ error_gen_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
error_gen_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
int op_errno = 0;
eg_t *egp = NULL;
@@ -869,7 +869,7 @@ error_gen_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
STACK_WIND (frame, error_gen_symlink_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->symlink,
- linkpath, loc);
+ linkpath, loc, params);
return 0;
}
diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c
index b283bd7b4..ee0e93365 100644
--- a/xlators/debug/io-stats/src/io-stats.c
+++ b/xlators/debug/io-stats/src/io-stats.c
@@ -927,14 +927,14 @@ io_stats_rmdir (call_frame_t *frame, xlator_t *this,
int
io_stats_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc)
+ const char *linkpath, loc_t *loc, dict_t *params)
{
BUMP_FOP (SYMLINK);
STACK_WIND (frame, io_stats_symlink_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->symlink,
- linkpath, loc);
+ linkpath, loc, params);
return 0;
}
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c
index 7b5164c84..f3f2fe2e1 100644
--- a/xlators/debug/trace/src/trace.c
+++ b/xlators/debug/trace/src/trace.c
@@ -1404,7 +1404,7 @@ trace_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
int
trace_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
if (trace_fop_names[GF_FOP_SYMLINK].enabled) {
gf_log (this->name, GF_LOG_NORMAL,
@@ -1416,7 +1416,7 @@ trace_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
STACK_WIND (frame, trace_symlink_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->symlink,
- linkpath, loc);
+ linkpath, loc, params);
return 0;
}
diff --git a/xlators/features/access-control/src/access-control.c b/xlators/features/access-control/src/access-control.c
index 159debb3f..b659a0133 100644
--- a/xlators/features/access-control/src/access-control.c
+++ b/xlators/features/access-control/src/access-control.c
@@ -867,10 +867,10 @@ out:
int32_t
ac_symlink_resume (call_frame_t *frame, xlator_t *this, const char *linkname,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
STACK_WIND (frame, default_symlink_cbk, FIRST_CHILD(this),
- FIRST_CHILD(this)->fops->symlink, linkname, loc);
+ FIRST_CHILD(this)->fops->symlink, linkname, loc, params);
return 0;
}
@@ -906,15 +906,16 @@ out:
}
-int32_t
+int
ac_symlink (call_frame_t *frame, xlator_t *this, const char *linkname,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
call_stub_t *stub = NULL;
int ret = -EFAULT;
loc_t parentloc = {0, };
- stub = fop_symlink_stub (frame, ac_symlink_resume, linkname, loc);
+ stub = fop_symlink_stub (frame, ac_symlink_resume, linkname, loc,
+ params);
if (!stub) {
gf_log (this->name, GF_LOG_ERROR, "cannot create call stub: "
"(out of memory)");
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index 002f6b35b..40cfeb07f 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -581,7 +581,7 @@ quota_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
quota_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkpath, loc_t *loc)
+ const char *linkpath, loc_t *loc, dict_t *params)
{
struct quota_priv *priv = NULL;
@@ -608,7 +608,7 @@ quota_symlink (call_frame_t *frame, xlator_t *this,
STACK_WIND (frame, quota_symlink_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->symlink,
- linkpath, loc);
+ linkpath, loc, params);
return 0;
}
diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c
index 9ebbdaaba..49c2ce58d 100644
--- a/xlators/features/read-only/src/read-only.c
+++ b/xlators/features/read-only/src/read-only.c
@@ -144,9 +144,10 @@ ro_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
return 0;
}
-int32_t
+
+int
ro_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
STACK_UNWIND_STRICT (symlink, frame, -1, EROFS, NULL, NULL, NULL, NULL);
return 0;
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 6ff5dafa7..069135d57 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -1213,7 +1213,7 @@ fuse_symlink_resume (fuse_state_t *state)
state->loc.path, state->name);
FUSE_FOP (state, fuse_newentry_cbk, GF_FOP_SYMLINK,
- symlink, state->name, &state->loc);
+ symlink, state->name, &state->loc, NULL);
}
static void
diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c
index a71e1204a..544f6c9e6 100644
--- a/xlators/nfs/server/src/nfs-fops.c
+++ b/xlators/nfs/server/src/nfs-fops.c
@@ -748,8 +748,8 @@ nfs_fop_symlink (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, char *target,
nfs_fop_handle_local_init (frame, nfsx, nfl, cbk, local, ret, err);
nfs_fop_save_root_ino (nfl, pathloc);
- STACK_WIND_COOKIE (frame, nfs_fop_symlink_cbk, xl, xl,
- xl->fops->symlink, target, pathloc);
+ STACK_WIND_COOKIE (frame, nfs_fop_symlink_cbk, xl, xl,
+ xl->fops->symlink, target, pathloc, NULL);
ret = 0;
err:
if (ret < 0) {
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index a9c596fb9..e2a00fcfa 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -584,22 +584,23 @@ iot_symlink_cbk (call_frame_t *frame, void * cookie, xlator_t *this,
int
iot_symlink_wrapper (call_frame_t *frame, xlator_t *this, const char *linkname,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
STACK_WIND (frame, iot_symlink_cbk, FIRST_CHILD (this),
- FIRST_CHILD (this)->fops->symlink, linkname, loc);
+ FIRST_CHILD (this)->fops->symlink, linkname, loc, params);
return 0;
}
int
iot_symlink (call_frame_t *frame, xlator_t *this, const char *linkname,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
call_stub_t *stub = NULL;
int ret = -1;
- stub = fop_symlink_stub (frame, iot_symlink_wrapper, linkname, loc);
+ stub = fop_symlink_stub (frame, iot_symlink_wrapper, linkname, loc,
+ params);
if (!stub) {
gf_log (this->name, GF_LOG_ERROR, "cannot create symlink stub"
"(out of memory)");
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index cd784dcf0..20301cffd 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -1820,9 +1820,9 @@ out:
}
-int32_t
+int
sp_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
int32_t ret = -1, op_errno = -1;
char need_unwind = 1;
@@ -1874,7 +1874,7 @@ out:
NULL);
} else {
STACK_WIND (frame, sp_new_entry_cbk, FIRST_CHILD(this),
- FIRST_CHILD(this)->fops->symlink, linkpath, loc);
+ FIRST_CHILD(this)->fops->symlink, linkpath, loc, params);
}
return 0;
diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c
index 6560c7775..0c6eb2b2a 100644
--- a/xlators/performance/symlink-cache/src/symlink-cache.c
+++ b/xlators/performance/symlink-cache/src/symlink-cache.c
@@ -311,14 +311,14 @@ sc_symlink_cbk (call_frame_t *frame, void *cookie,
int
sc_symlink (call_frame_t *frame, xlator_t *this,
- const char *dst, loc_t *src)
+ const char *dst, loc_t *src, dict_t *params)
{
frame->local = strdup (dst);
STACK_WIND (frame, sc_symlink_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->symlink,
- dst, src);
+ dst, src, params);
return 0;
}
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index e5e5bd111..f1d99ce6c 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -468,10 +468,9 @@ out:
}
-
-int32_t
+int
client_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
int ret = -1;
clnt_conf_t *conf = NULL;
diff --git a/xlators/protocol/legacy/client/src/client-protocol.c b/xlators/protocol/legacy/client/src/client-protocol.c
index e0f716ed9..57cfbc73e 100644
--- a/xlators/protocol/legacy/client/src/client-protocol.c
+++ b/xlators/protocol/legacy/client/src/client-protocol.c
@@ -1195,7 +1195,7 @@ unwind:
int
client_symlink (call_frame_t *frame, xlator_t *this, const char *linkname,
- loc_t *loc)
+ loc_t *loc, dict_t *params)
{
int ret = -1;
gf_hdr_common_t *hdr = NULL;
diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c
index 4c48e75a9..b2ce4bd11 100644
--- a/xlators/protocol/legacy/server/src/server-protocol.c
+++ b/xlators/protocol/legacy/server/src/server-protocol.c
@@ -4618,7 +4618,7 @@ server_symlink_resume (call_frame_t *frame, xlator_t *bound_xl)
STACK_WIND (frame, server_symlink_cbk,
bound_xl, bound_xl->fops->symlink,
- state->name, &state->loc);
+ state->name, &state->loc, state->params);
return 0;
err:
diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c
index ecafb57f5..173481628 100644
--- a/xlators/protocol/server/src/server3_1-fops.c
+++ b/xlators/protocol/server/src/server3_1-fops.c
@@ -1860,7 +1860,7 @@ server_symlink_resume (call_frame_t *frame, xlator_t *bound_xl)
STACK_WIND (frame, server_symlink_cbk,
bound_xl, bound_xl->fops->symlink,
- state->name, &state->loc);
+ state->name, &state->loc, state->params);
return 0;
err:
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 1afbffab8..0730dc2cd 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -1598,9 +1598,10 @@ posix_rmdir (call_frame_t *frame, xlator_t *this,
return 0;
}
-int32_t
+
+int
posix_symlink (call_frame_t *frame, xlator_t *this,
- const char *linkname, loc_t *loc)
+ const char *linkname, loc_t *loc, dict_t *params)
{
int32_t op_ret = -1;
int32_t op_errno = 0;