summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2010-02-25 05:17:02 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-02 08:21:57 -0800
commitbcab556247cc6f008cafb9df2128cc99d5cc6047 (patch)
tree6b9f673807f3e3e8c80a543db4b4a0066afed873
parent12c06f4e1723cec1d9e7e3d7e653e2ae14e18659 (diff)
features/quota: store the entire vector in local instead of just a pointer to it in writev.
Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 685 (writing to a file fails complaining of "Transport endpoint not being connected") URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=685
-rw-r--r--xlators/features/quota/src/quota.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index f7b02af6442..b63598728f1 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -28,6 +28,10 @@
#include "defaults.h"
#include "common-utils.h"
+#ifndef MAX_IOVEC
+#define MAX_IOVEC 16
+#endif
+
struct quota_local {
struct stat stbuf;
inode_t *inode;
@@ -35,7 +39,7 @@ struct quota_local {
fd_t *fd;
off_t offset;
int32_t count;
- struct iovec *vector;
+ struct iovec vector[MAX_IOVEC];
struct iobref *iobref;
loc_t loc;
};
@@ -758,7 +762,8 @@ quota_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
struct iobref *iobref)
{
struct quota_local *local = NULL;
- struct quota_priv *priv = NULL;
+ struct quota_priv *priv = NULL;
+ int i = 0;
priv = this->private;
@@ -775,8 +780,12 @@ quota_writev (call_frame_t *frame, xlator_t *this, fd_t *fd,
local = CALLOC (1, sizeof (struct quota_local));
local->fd = fd_ref (fd);
local->iobref = iobref_ref (iobref);
- local->vector = vector;
- local->count = count;
+ for (i = 0; i < count; i++) {
+ local->vector[i].iov_base = vector[i].iov_base;
+ local->vector[i].iov_len = vector[i].iov_len;
+ }
+
+ local->count = count;
local->offset = off;
frame->local = local;
diff --git a/xlators/encryption/rot-13/src/rot-13.h b/xlators/encryption/rot-13/src/rot-13.h
index 56b10068c35..3e9fc19c776 100644
--- a/xlators/encryption/rot-13/src/rot-13.h
+++ b/xlators/encryption/rot-13/src/rot-13.h
@@ -1,13 +1,12 @@
/*
- Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
- This file is part of GlusterFS.
+ Copyright (c) 2006-2012 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
- This file is licensed to you under your choice of the GNU Lesser
- General Public License, version 3 or any later version (LGPLv3 or
- later), or the GNU General Public License, version 2 (GPLv2), in all
- cases as published by the Free Software Foundation.
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
*/
-
#ifndef __ROT_13_H__
#define __ROT_13_H__