diff options
| author | Prashanth Pai <nullpai@gmail.com> | 2013-02-22 15:52:29 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@redhat.com> | 2013-03-20 19:51:50 -0700 | 
| commit | fbb94768cb579f85416333f98a0fa655e10f88fc (patch) | |
| tree | 7cb19c0a240558dc2e9d7ef362172fb3f3e880a6 /libglusterfs/src/iobuf.c | |
| parent | f325551e4c56f743cd1e2b9174d8b7dc9f861675 (diff) | |
iobuf: Added a function iobref_clear
Original-author: Venky Shankar <vshankar@redhat.com>
Change-Id: Ibf861db6c1b084b798d210962344487a1919aad2
BUG: 921942
Signed-off-by: Prashanth Pai <nullpai@gmail.com>
Reviewed-on: http://review.gluster.org/4595
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs/src/iobuf.c')
| -rw-r--r-- | libglusterfs/src/iobuf.c | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/libglusterfs/src/iobuf.c b/libglusterfs/src/iobuf.c index 86bf697e879..a89e962673f 100644 --- a/libglusterfs/src/iobuf.c +++ b/libglusterfs/src/iobuf.c @@ -841,6 +841,29 @@ out:  } +void +iobref_clear (struct iobref *iobref) +{ +        int i = 0; + +        GF_VALIDATE_OR_GOTO ("iobuf", iobref, out); + +        for (; i < GF_IOBREF_IOBUF_COUNT; i++) { +                if (iobref->iobrefs[i] != NULL) { +                        iobuf_unref (iobref->iobrefs[i]); +                } else { +                        /** iobuf's are attched serially */ +                        break; +                } +        } + +        iobref_unref (iobref); + + out: +        return; +} + +  int  __iobref_add (struct iobref *iobref, struct iobuf *iobuf)  {  | 
