diff options
| -rw-r--r-- | libglusterfs/src/iobuf.c | 8 | ||||
| -rw-r--r-- | libglusterfs/src/iobuf.h | 4 | ||||
| -rw-r--r-- | xlators/protocol/client/src/client3_1-fops.c | 2 | 
3 files changed, 8 insertions, 6 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index 777185f66..734f59606 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -578,7 +578,7 @@ iobref_destroy (struct iobref *iobref)          GF_VALIDATE_OR_GOTO ("iobuf", iobref, out); -        for (i = 0; i < 8; i++) { +        for (i = 0; i < GF_IOBREF_IOBUF_COUNT; i++) {                  iobuf = iobref->iobrefs[i];                  iobref->iobrefs[i] = NULL; @@ -623,7 +623,7 @@ __iobref_add (struct iobref *iobref, struct iobuf *iobuf)          GF_VALIDATE_OR_GOTO ("iobuf", iobref, out);          GF_VALIDATE_OR_GOTO ("iobuf", iobuf, out); -        for (i = 0; i < 8; i++) { +        for (i = 0; i < GF_IOBREF_IOBUF_COUNT; i++) {                  if (iobref->iobrefs[i] == NULL) {                          iobref->iobrefs[i] = iobuf_ref (iobuf);                          ret = 0; @@ -667,7 +667,7 @@ iobref_merge (struct iobref *to, struct iobref *from)          LOCK (&from->lock);          { -                for (i = 0; i < 8; i++) { +                for (i = 0; i < GF_IOBREF_IOBUF_COUNT; i++) {                          iobuf = from->iobrefs[i];                          if (!iobuf) @@ -719,7 +719,7 @@ iobref_size (struct iobref *iobref)          LOCK (&iobref->lock);          { -                for (i = 0; i < 8; i++) { +                for (i = 0; i < GF_IOBREF_IOBUF_COUNT; i++) {                          if (iobref->iobrefs[i])                                  size += iobuf_size (iobref->iobrefs[i]);                  } diff --git a/libglusterfs/src/iobuf.h b/libglusterfs/src/iobuf.h index b2a944e59..7c4ee8c26 100644 --- a/libglusterfs/src/iobuf.h +++ b/libglusterfs/src/iobuf.h @@ -37,6 +37,8 @@  #define MAP_ANONYMOUS MAP_ANON  #endif +#define GF_IOBREF_IOBUF_COUNT 16 +  /* one allocatable unit for the consumers of the IOBUF API */  /* each unit hosts @page_size bytes of memory */  struct iobuf; @@ -120,7 +122,7 @@ void iobuf_to_iovec(struct iobuf *iob, struct iovec *iov);  struct iobref {          gf_lock_t          lock;          int                ref; -        struct iobuf      *iobrefs[8]; +        struct iobuf      *iobrefs[GF_IOBREF_IOBUF_COUNT];  };  struct iobref *iobref_new (); diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index ae7442697..f826ca27e 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -119,7 +119,7 @@ out:          iobuf_unref (iobuf); -        return 0; +        return ret;  }  /* CBK */  | 
