ReleaseWriteLock (&old_dir->lock); ret.res = -1;
fcache_release(old_dir); ret.res   = -1;
cm_rename(VenusFid old_parent_fid, const char *old_name,	  VenusFid new_parent_fid, const char *new_name,	  CredCacheEntry* ce){     FCacheEntry *old_dir;     FCacheEntry *new_dir;     Result ret;     int error;     /* old parent dir */     error = fcache_get (&old_dir, old_parent_fid, ce);     if (error) {	 ret.res = -1;	 ret.error = error;	 return ret;     }     error = fcache_get_data (old_dir, ce);     if (error) {	 ReleaseWriteLock (&old_dir->lock);	 ret.res = -1;	 ret.error = error;	 return ret;     }     /* new parent dir */     if (old_parent_fid.fid.Vnode != new_parent_fid.fid.Vnode	 || old_parent_fid.fid.Unique != new_parent_fid.fid.Unique) {	 error = fcache_get (&new_dir, new_parent_fid, ce);	 if (error) {	     ReleaseWriteLock (&old_dir->lock);	     ret.res = -1;	     ret.error = error;	     return ret;	 }	 error = fcache_get_data (new_dir, ce);	 if (error) {	     ret.res = -1;	     ret.error = error;	     goto out;	 }     } else {	 new_dir = old_dir;     }     if (checkright (old_dir, ADELETE, ce)	 && checkright (new_dir, AINSERT, ce)) {	 error = rename_file (old_dir, old_name,			      new_dir, new_name,			      ce);	  if (error) {	      ret.res = -1;	      ret.error = error;	  } else {	      VenusFid foo_fid;	      ReleaseWriteLock (&old_dir->lock);	      error = adir_lookup (old_dir->fid, old_name, &foo_fid, ce);	      ObtainWriteLock (&old_dir->lock);	      if (error) {		  ret.res = -1;		  ret.error = error;		  goto out;	      }	      error = adir_remove (old_dir, old_name)		  || adir_creat (new_dir, new_name, foo_fid.fid);	      if (error) {		  ret.res = -1;		  ret.error = error;	      } else {		  ret.res = 0;	      }	  }     } else {	  ret.res = -1;	  ret.error = EACCES;     }     log_operation ("rename (%ld,%lu,%lu,%lu) (%ld,%lu,%lu,%lu) %s %s\n",	      old_parent_fid.Cell,	      old_parent_fid.fid.Volume,	      old_parent_fid.fid.Vnode,	      old_parent_fid.fid.Unique,	      new_parent_fid.Cell,	      new_parent_fid.fid.Volume,	      new_parent_fid.fid.Vnode,	      new_parent_fid.fid.Unique,	      old_name, new_name);out:     ReleaseWriteLock (&old_dir->lock);     if (old_parent_fid.fid.Vnode != new_parent_fid.fid.Vnode	 || old_parent_fid.fid.Unique != new_parent_fid.fid.Unique)	 ReleaseWriteLock (&new_dir->lock);     return ret;}