summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorAnand V. Avati <avati@amp.gluster.com>2010-10-02 11:25:05 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-02 22:18:56 -0700
commit99caede76b0ef312d622b2387bf9524724e7c6df (patch)
tree7b6c8cc969b5e8460e4ac4b67734422e3fad782c /xlators/cluster
parent5a4e1e69b2ec65dcefa6b37b8ac7d058f3a2c29f (diff)
rmdir: introduce extra flags parameter in FOP prototype
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-dir-write.c5
-rw-r--r--xlators/cluster/afr/src/afr-dir-write.h2
-rw-r--r--xlators/cluster/afr/src/afr.h1
-rw-r--r--xlators/cluster/afr/src/pump.c17
-rw-r--r--xlators/cluster/dht/src/dht-common.c6
-rw-r--r--xlators/cluster/stripe/src/stripe.c8
6 files changed, 23 insertions, 16 deletions
diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c
index 1aa268f66..1226285f7 100644
--- a/xlators/cluster/afr/src/afr-dir-write.c
+++ b/xlators/cluster/afr/src/afr-dir-write.c
@@ -1900,7 +1900,7 @@ afr_rmdir_wind (call_frame_t *frame, xlator_t *this)
(void *) (long) i,
priv->children[i],
priv->children[i]->fops->rmdir,
- &local->loc);
+ &local->loc, local->cont.rmdir.flags);
if (!--call_count)
break;
@@ -1926,7 +1926,7 @@ afr_rmdir_done (call_frame_t *frame, xlator_t *this)
int
afr_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc)
+ loc_t *loc, int flags)
{
afr_private_t * priv = NULL;
afr_local_t * local = NULL;
@@ -1960,6 +1960,7 @@ afr_rmdir (call_frame_t *frame, xlator_t *this,
transaction_frame->local = local;
+ local->cont.rmdir.flags = flags;
loc_copy (&local->loc, loc);
if (loc->parent)
diff --git a/xlators/cluster/afr/src/afr-dir-write.h b/xlators/cluster/afr/src/afr-dir-write.h
index e2ed8c759..40aeb1f58 100644
--- a/xlators/cluster/afr/src/afr-dir-write.h
+++ b/xlators/cluster/afr/src/afr-dir-write.h
@@ -39,7 +39,7 @@ afr_unlink (call_frame_t *frame, xlator_t *this,
int32_t
afr_rmdir (call_frame_t *frame, xlator_t *this,
- loc_t *loc);
+ loc_t *loc, int flags);
int32_t
afr_link (call_frame_t *frame, xlator_t *this,
diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h
index ed50fdfbf..56a5fb106 100644
--- a/xlators/cluster/afr/src/afr.h
+++ b/xlators/cluster/afr/src/afr.h
@@ -531,6 +531,7 @@ typedef struct _afr_local {
} unlink;
struct {
+ int flags;
ino_t parent_ino;
int32_t op_ret;
int32_t op_errno;
diff --git a/xlators/cluster/afr/src/pump.c b/xlators/cluster/afr/src/pump.c
index 1a9277abc..39de7cbb9 100644
--- a/xlators/cluster/afr/src/pump.c
+++ b/xlators/cluster/afr/src/pump.c
@@ -1719,22 +1719,23 @@ pump_unlink (call_frame_t *frame,
}
-static int32_t
-pump_rmdir (call_frame_t *frame,
- xlator_t *this,
- loc_t *loc)
+static int
+pump_rmdir (call_frame_t *frame, xlator_t *this,
+ loc_t *loc, int flags)
{
afr_private_t *priv = NULL;
+
priv = this->private;
+
if (!priv->use_afr_in_pump) {
- STACK_WIND (frame,
- default_rmdir_cbk,
+ STACK_WIND (frame, default_rmdir_cbk,
FIRST_CHILD(this),
FIRST_CHILD(this)->fops->rmdir,
- loc);
+ loc, flags);
return 0;
}
- afr_rmdir (frame, this, loc);
+
+ afr_rmdir (frame, this, loc, flags);
return 0;
}
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index a262ba6ca..6001cd318 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3860,7 +3860,7 @@ dht_rmdir_do (call_frame_t *frame, xlator_t *this)
STACK_WIND (frame, dht_rmdir_cbk,
conf->subvolumes[i],
conf->subvolumes[i]->fops->rmdir,
- &local->loc);
+ &local->loc, local->flags);
}
return 0;
@@ -4127,7 +4127,7 @@ err:
int
-dht_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
+dht_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags)
{
dht_local_t *local = NULL;
dht_conf_t *conf = NULL;
@@ -4163,6 +4163,8 @@ dht_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
goto err;
}
+ local->flags = flags;
+
local->fd = fd_create (local->loc.inode, frame->root->pid);
if (!local->fd) {
gf_log (this->name, GF_LOG_ERROR,
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 72c7b4515..f6118a6f0 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -1143,7 +1143,8 @@ stripe_first_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
while (trav) {
STACK_WIND (frame, stripe_unlink_cbk, trav->xlator,
- trav->xlator->fops->rmdir, &local->loc);
+ trav->xlator->fops->rmdir, &local->loc,
+ local->flags);
trav = trav->next;
}
@@ -1155,7 +1156,7 @@ err:
}
int32_t
-stripe_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
+stripe_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags)
{
xlator_list_t *trav = NULL;
stripe_local_t *local = NULL;
@@ -1187,10 +1188,11 @@ stripe_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
local->op_ret = -1;
frame->local = local;
loc_copy (&local->loc, loc);
+ local->flags = flags;
local->call_count = priv->child_count;
STACK_WIND (frame, stripe_first_rmdir_cbk, trav->xlator,
- trav->xlator->fops->rmdir, loc);
+ trav->xlator->fops->rmdir, loc, flags);
return 0;
err: