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
This commit is contained in:
parent
12c06f4e17
commit
bcab556247
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user