xlators/cluster/cloud/src/cloud.c | 88 +++++++++++++++++++++++++++-------- xlators/encryption/crypt/src/crypt.c | 1 2 files changed, 69 insertions(+), 20 deletions(-)
New commits: commit f6f19fd80497c901d97c0679708353775aeffa1e Author: Jeff Darcy jdarcy@redhat.com Date: Fri Dec 31 14:41:53 2010 -0500
Fix iobref leak.
diff --git a/xlators/encryption/crypt/src/crypt.c b/xlators/encryption/crypt/src/crypt.c index f0cd140..9d0aab3 100644 --- a/xlators/encryption/crypt/src/crypt.c +++ b/xlators/encryption/crypt/src/crypt.c @@ -363,6 +363,7 @@ crypt_writev_cbk (call_frame_t *frame, if (op_ret > local->orig_size) { op_ret = local->orig_size; } + iobref_unref(local->iobref);
STACK_UNWIND_STRICT (writev, frame, op_ret, op_errno, prebuf, postbuf); return 0;
commit 97d36aecdec82e27515d0f0a84ce3f31218f42d2 Author: Jeff Darcy jdarcy@redhat.com Date: Fri Dec 31 14:41:33 2010 -0500
Fix mkdir, add unlink/rmdir.
diff --git a/xlators/cluster/cloud/src/cloud.c b/xlators/cluster/cloud/src/cloud.c index be30d7c..ebfc68d 100644 --- a/xlators/cluster/cloud/src/cloud.c +++ b/xlators/cluster/cloud/src/cloud.c @@ -451,6 +451,42 @@ cloud_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, }
int +cloud_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, + struct iatt *preparent, struct iatt *postparent) +{ + STACK_UNWIND_STRICT(unlink,frame,op_ret,op_errno,preparent,postparent); + return 0; +} + +int +cloud_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc) +{ + xlator_t *next = get_subvol(this,frame->root->trans,"unlink"); + + STACK_WIND(frame,cloud_unlink_cbk,next,next->fops->unlink,loc); + return 0; +} + +int +cloud_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, + struct iatt *preparent, struct iatt *postparent) +{ + STACK_UNWIND_STRICT(rmdir,frame,op_ret,op_errno,preparent,postparent); + return 0; +} + +int +cloud_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags) +{ + xlator_t *next = get_subvol(this,frame->root->trans,"rmdir"); + + STACK_WIND(frame,cloud_rmdir_cbk,next,next->fops->rmdir,loc,flags); + return 0; +} + +int cloud_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, int op_errno, struct iatt *statpre, struct iatt *statpost) @@ -610,7 +646,9 @@ struct xlator_fops fops = { .opendir = cloud_opendir, .readdir = cloud_readdir, .readdirp = cloud_readdirp, + .unlink = cloud_unlink, .mkdir = cloud_mkdir, + .rmdir = cloud_rmdir, .setattr = cloud_setattr, };
commit dfaf331af4be4ea1461890c0243fff6d2bd41117 Author: Jeff Darcy jdarcy@redhat.com Date: Fri Dec 31 11:16:41 2010 -0500
Line-length fixes.
diff --git a/xlators/cluster/cloud/src/cloud.c b/xlators/cluster/cloud/src/cloud.c index 4be48a3..be30d7c 100644 --- a/xlators/cluster/cloud/src/cloud.c +++ b/xlators/cluster/cloud/src/cloud.c @@ -36,18 +36,18 @@ * This translator exists primarily to run on the server and multiplex between * subvolumes based on tenant identity, so that each tenant can have its own * isolated namespace. To do this, we need to find out the tenant identity, so - * we also handle that type of authentication here. Some day we might also do UID - * mapping here. + * we also handle that type of authentication here. Some day we might also do + * UID mapping here. * * Right now the authentication is just simple password, passed via mkdir in a - * special first-level subdirectory because mkdir requests are easily to generate - * by hand and have convenient behavior in terms of fanning out to all bricks - * even under DHT. In the future, a client-side translator will sit on top of - * each brick and do a more sophisticated kind of authentication such as x.509 or - * Kerberos. + * special first-level subdirectory because mkdir requests are easily to + * generate by hand and have convenient behavior in terms of fanning out to all + * bricks even under DHT. In the future, a client-side translator will sit on + * top of each brick and do a more sophisticated kind of authentication such as + * x.509 or Kerberos. */
-#define CLOUD_LEVEL GF_LOG_ERROR +#define CLOUD_LEVEL GF_LOG_DEBUG
static char special_dir[] = "/_auth/";
@@ -124,14 +124,16 @@ cloud_check_auth (call_frame_t *frame, xlator_t *this, loc_t *loc) continue; } if (strcmp(password,subvol_list[i].password)) { - gf_log(this->name,CLOUD_LEVEL,"bad password for %s",subdir); + gf_log(this->name,CLOUD_LEVEL,"bad password for %s", + subdir); continue; } if (!subvol_list[i].xlator) { - gf_log(this->name,CLOUD_LEVEL,"no translator for %s",subdir); + gf_log(this->name,CLOUD_LEVEL,"no translator for %s", + subdir); continue; } - gf_log(this->name,CLOUD_LEVEL, + gf_log(this->name,GF_LOG_WARNING, "forcing this connection to subvol %s",subdir); *(--password) = '='; set_subvol(this,frame->root->trans,subvol_list[i].xlator); @@ -157,13 +159,16 @@ int cloud_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, dict_t *params) { + xlator_t *next; + if (!strncmp(loc->path,special_dir,sizeof(special_dir)-1)) { cloud_check_auth(frame,this,loc); return 0; }
- STACK_WIND(frame,cloud_mkdir_cbk,FIRST_CHILD(this), - FIRST_CHILD(this)->fops->mkdir,loc,mode,params); + next = get_subvol(this,frame->root->trans,"lookup"); + STACK_WIND(frame,cloud_mkdir_cbk,next,next->fops->mkdir, + loc,mode,params); return 0; }
@@ -297,7 +302,8 @@ cloud_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset) { xlator_t *next = get_subvol(this,frame->root->trans,"truncate");
- STACK_WIND(frame,cloud_truncate_cbk,next,next->fops->truncate,loc,offset); + STACK_WIND(frame,cloud_truncate_cbk,next,next->fops->truncate, + loc,offset); return 0; }
@@ -306,7 +312,8 @@ cloud_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) { xlator_t *next = get_subvol(this,frame->root->trans,"ftruncate");
- STACK_WIND(frame,cloud_truncate_cbk,next,next->fops->ftruncate,fd,offset); + STACK_WIND(frame,cloud_truncate_cbk,next,next->fops->ftruncate, + fd,offset); return 0; }
@@ -419,13 +426,14 @@ cloud_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, { xlator_t *next = get_subvol(this,frame->root->trans,"readdir");
- STACK_WIND(frame,cloud_readdir_cbk,next,next->fops->readdir,fd,size,yoff); + STACK_WIND(frame,cloud_readdir_cbk,next,next->fops->readdir, + fd,size,yoff); return 0; }
int -cloud_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, - int op_errno, gf_dirent_t *orig_entries) +cloud_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, + int op_ret, int op_errno, gf_dirent_t *orig_entries) { STACK_UNWIND_STRICT(readdirp,frame,op_ret,op_errno,orig_entries); return 0; @@ -479,7 +487,8 @@ reconfigure (xlator_t *this, dict_t *options)
ret = dict_get_str (options, "log-level", &log_str); if (!ret) { - if (!is_gf_log_command(this, "trusted.glusterfs.set-log-level", log_str)) { + if (!is_gf_log_command(this, "trusted.glusterfs.set-log-level", + log_str)) { gf_log (this->name, GF_LOG_DEBUG, "changing log-level to %s", log_str); } @@ -543,7 +552,8 @@ init (xlator_t *this) for (i = 0; subvol_list[i].name; ++i) { for (trav = this->children; trav; trav = trav->next) { if (!strcmp(subvol_list[i].name,trav->xlator->name)) { - gf_log(this->name,CLOUD_LEVEL,"mapping %s -> %p", + gf_log(this->name,CLOUD_LEVEL, + "mapping %s -> %p", subvol_list[i].name, trav->xlator->name); subvol_list[i].xlator = trav->xlator; break;
cloudfs-devel@lists.fedorahosted.org