summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2012-02-14 15:05:19 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-20 00:46:27 -0800
commitc0b8e886cac4ef0f16d5f93adab02229bb1414cd (patch)
tree03f5bc6550d5f2501d5b968776f4bb0ee8025310 /xlators
parent975933a25d14cbac861e809b40c6edd01acaa28d (diff)
iobuf: use 'iobuf_get2()' to get variable sized buffers
added 'TODO' in places where it is missing. Change-Id: Ia802c94e3bb76930f7c88c990f078525be5459f5 Signed-off-by: Amar Tumballi <amar@gluster.com> BUG: 765264 Reviewed-on: http://review.gluster.com/388 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/stripe/src/stripe.c3
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c5
-rw-r--r--xlators/nfs/server/src/mount3.c1
-rw-r--r--xlators/nfs/server/src/nfs3.c2
-rw-r--r--xlators/performance/quick-read/src/quick-read.c3
-rw-r--r--xlators/performance/write-behind/src/write-behind.c1
-rw-r--r--xlators/protocol/client/src/client3_1-fops.c30
7 files changed, 31 insertions, 14 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 5e369d64bcf..ec9b6a744a1 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3372,7 +3372,8 @@ stripe_readv_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
vec[count].iov_len =
(local->replies[i].requested_size -
local->replies[i].op_ret);
- iobuf = iobuf_get (this->ctx->iobuf_pool);
+ iobuf = iobuf_get2 (this->ctx->iobuf_pool,
+ vec[count].iov_len);
if (!iobuf) {
gf_log (this->name, GF_LOG_ERROR,
"Out of memory.");
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 1da2dcdb223..e644290e42d 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3474,7 +3474,12 @@ fuse_thread_proc (void *data)
if (priv->init_recvd)
fuse_graph_sync (this);
+ /* TODO: This place should always get maximum supported buffer
+ size from 'fuse', which is as of today 128KB. If we bring in
+ support for higher block sizes support, then we should be
+ changing this one too */
iobuf = iobuf_get (this->ctx->iobuf_pool);
+
/* Add extra 128 byte to the first iov so that it can
* accommodate "ordinary" non-write requests. It's not
* guaranteed to be big enough, as SETXATTR and namespace
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 0f14c8d5a03..cebdf527065 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -70,6 +70,7 @@ mnt3svc_submit_reply (rpcsvc_request_t *req, void *arg, mnt3_serializer sfunc)
/* First, get the io buffer into which the reply in arg will
* be serialized.
*/
+ /* TODO: use 'xdrproc_t' instead of 'sfunc' to get the xdr-size */
iob = iobuf_get (ms->iobpool);
if (!iob) {
gf_log (GF_MNT, GF_LOG_ERROR, "Failed to get iobuf");
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 422646bc02b..527101de22b 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -487,6 +487,8 @@ nfs3_serialize_reply (rpcsvc_request_t *req, void *arg, nfs3_serializer sfunc,
/* First, get the io buffer into which the reply in arg will
* be serialized.
*/
+ /* TODO: get rid of 'sfunc' and use 'xdrproc_t' so we
+ can have 'xdr_sizeof' */
iob = iobuf_get (nfs3->iobpool);
if (!iob) {
gf_log (GF_NFS3, GF_LOG_ERROR, "Failed to get iobuf");
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 14ff58b5157..c1460b1debf 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -1180,6 +1180,9 @@ qr_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
}
for (i = 0; i < count; i++) {
+ /* TODO: Now that we have support for variable
+ io-buf-sizes, i guess we need to get rid of
+ default size here */
iobuf = iobuf_get (iobuf_pool);
if (iobuf == NULL) {
op_ret = -1;
diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c
index 7c666b40339..be7da2f44ce 100644
--- a/xlators/performance/write-behind/src/write-behind.c
+++ b/xlators/performance/write-behind/src/write-behind.c
@@ -1901,6 +1901,7 @@ __wb_copy_into_holder (wb_request_t *holder, wb_request_t *request)
int ret = -1;
if (holder->flags.write_request.virgin) {
+ /* TODO: check the required size */
iobuf = iobuf_get (request->file->this->ctx->iobuf_pool);
if (iobuf == NULL) {
goto out;
diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c
index 234b0dd6e03..e3d6d36dba6 100644
--- a/xlators/protocol/client/src/client3_1-fops.c
+++ b/xlators/protocol/client/src/client3_1-fops.c
@@ -2493,6 +2493,8 @@ client3_1_lookup (call_frame_t *frame, xlator_t *this,
}
/* TODO: what is the size we should send ? */
+ /* This change very much depends on quick-read
+ changes */
rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
if (rsp_iobuf == NULL) {
goto unwind;
@@ -3409,8 +3411,7 @@ client3_1_readv (call_frame_t *frame, xlator_t *this,
memcpy (req.gfid, args->fd->inode->gfid, 16);
- /* TODO: what is the size we should send ? */
- rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
+ rsp_iobuf = iobuf_get2 (this->ctx->iobuf_pool, args->size);
if (rsp_iobuf == NULL) {
op_errno = ENOMEM;
goto unwind;
@@ -3959,8 +3960,8 @@ client3_1_fgetxattr (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- /* TODO: what is the size we should send ? */
- rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
+ /* TODO: what is the size we should send ? */
+ rsp_iobuf = iobuf_get2 (this->ctx->iobuf_pool, 8 * GF_UNIT_KB);
if (rsp_iobuf == NULL) {
op_errno = ENOMEM;
goto unwind;
@@ -4062,8 +4063,8 @@ client3_1_getxattr (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- /* TODO: what is the size we should send ? */
- rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
+ /* TODO: what is the size we should send ? */
+ rsp_iobuf = iobuf_get2 (this->ctx->iobuf_pool, 8 * GF_UNIT_KB);
if (rsp_iobuf == NULL) {
op_errno = ENOMEM;
goto unwind;
@@ -4188,8 +4189,8 @@ client3_1_xattrop (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- /* TODO: what is the size we should send ? */
- rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
+ /* TODO: what is the size we should send ? */
+ rsp_iobuf = iobuf_get2 (this->ctx->iobuf_pool, 8 * GF_UNIT_KB);
if (rsp_iobuf == NULL) {
op_errno = ENOMEM;
goto unwind;
@@ -4308,8 +4309,8 @@ client3_1_fxattrop (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- /* TODO: what is the size we should send ? */
- rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
+ /* TODO: what is the size we should send ? */
+ rsp_iobuf = iobuf_get2 (this->ctx->iobuf_pool, 8 * GF_UNIT_KB);
if (rsp_iobuf == NULL) {
op_errno = ENOMEM;
goto unwind;
@@ -4880,7 +4881,9 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this,
goto unwind;
}
- /* TODO: what is the size we should send ? */
+ /* TODO: what is the size we should send ? */
+ /* This iobuf will live for only receiving the response,
+ so not harmful */
rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
if (rsp_iobuf == NULL) {
goto unwind;
@@ -4890,8 +4893,7 @@ client3_1_readdir (call_frame_t *frame, xlator_t *this,
iobuf_unref (rsp_iobuf);
rsphdr = &vector[0];
rsphdr->iov_base = iobuf_ptr (rsp_iobuf);
- rsphdr->iov_len
- = iobuf_pagesize (rsp_iobuf);
+ rsphdr->iov_len = iobuf_pagesize (rsp_iobuf);
count = 1;
rsp_iobuf = NULL;
local->iobref = rsp_iobref;
@@ -4983,6 +4985,8 @@ client3_1_readdirp (call_frame_t *frame, xlator_t *this,
}
/* TODO: what is the size we should send ? */
+ /* This iobuf will live for only receiving the response,
+ so not harmful */
rsp_iobuf = iobuf_get (this->ctx->iobuf_pool);
if (rsp_iobuf == NULL) {
goto unwind;