timestamps: bitmap4 helper functions

Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2010-10-12 09:41:53 -04:00
parent d38360672d
commit cc298599d8

View file

@ -52,6 +52,38 @@ bool_t verify_write(
IN struct __nfs41_write_verf *verf, IN struct __nfs41_write_verf *verf,
IN OUT enum stable_how4 *stable); IN OUT enum stable_how4 *stable);
/* bitmap4 */
static __inline bool_t bitmap_isset(
IN const bitmap4 *mask,
IN uint32_t word,
IN uint32_t flag)
{
return mask->count > word && mask->arr[word] & flag;
}
static __inline void bitmap_set(
IN bitmap4 *mask,
IN uint32_t word,
IN uint32_t flag)
{
if (mask->count > word)
mask->arr[word] |= flag;
else {
mask->count = word + 1;
mask->arr[word] = flag;
}
}
static __inline void bitmap_unset(
IN bitmap4 *mask,
IN uint32_t word,
IN uint32_t flag)
{
if (mask->count > word) {
mask->arr[word] &= ~flag;
while (mask->count && mask->arr[mask->count-1] == 0)
mask->count--;
}
}
ULONG nfs_file_info_to_attributes( ULONG nfs_file_info_to_attributes(
IN const nfs41_file_info *info); IN const nfs41_file_info *info);
void nfs_to_basic_info( void nfs_to_basic_info(