~wb-munzinger/+junk/ocfs2-tools

« back to all changes in this revision

Viewing changes to libocfs2/bitops.c

  • Committer: Bazaar Package Importer
  • Author(s): Andres Rodriguez
  • Date: 2011-01-14 12:46:49 UTC
  • mfrom: (1.1.10 upstream) (0.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20110114124649-vbe5qz211f3zxwuf
Tags: 1.6.3-1ubuntu1
* Merge from debian unstable (LP: #703008).  Remaining changes:
  - Fix configure tests for ld --as-needed.
  - Fix build failure with ld --no-add-needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
        return (res + d0 - 1);
162
162
}
163
163
 
 
164
int ocfs2_get_bits_set(void *addr, int size, int offset)
 
165
{
 
166
        int set_bits = 0, found = 0;
 
167
 
 
168
        while (1) {
 
169
                found = ocfs2_find_next_bit_set(addr, size, offset);
 
170
                if (found < size) {
 
171
                        set_bits++;
 
172
                        offset = found + 1;
 
173
                } else
 
174
                        break;
 
175
        }
 
176
 
 
177
        return set_bits;
 
178
}
 
179
 
164
180
#ifdef DEBUG_EXE
165
181
#include <stdio.h>
166
182
#include <stdlib.h>