Quick Search:

View

Revision:
Expand:  

Diff

Diff from 1.1.2.2 to:

Annotations

Annotate by Age | Author | None
/fisheye/browse/PVFS/src/common/misc/dist-dir-utils.h

Annotated File View

shuangy
1.1.2.1
1 /* 
2  * (C) 2001 Clemson University and The University of Chicago 
3  *
4  * See COPYING in top-level directory.
5  */
6
7 #ifndef __DIST_DIR_UTILS_H
8 #define __DIST_DIR_UTILS_H
9
10 #include "pvfs2-types.h"
11
12
13 /* changes to original prototype
14  * 1. separate attr and bitmap structure
15  * 2. add bitmap_size field and the size is indicating the number of uint32_t blocks,
16  *    simplifies the bitmap update procedure
17  * 3. change type and function names
18  */
19
20
21 /* decode bit-mapped array 32-bit ints */
22 /* 5 is log2(32bits) - selects 32 bit word */
23 /* 0x1f masks lower 5 bits - selects bit in word */
24
25 /* the bitnum should start from 0 */
26
27 #define SET_BIT(i_bitfield, bitnum) \
shuangy
1.1.2.2
28     do { i_bitfield[(bitnum) >> 5] |= (1 << ((bitnum) & 0x1f));} while (0)
shuangy
1.1.2.1
29
30 #define CRL_BIT(i_bitfield, bitnum) \
shuangy
1.1.2.2
31     do { i_bitfield[(bitnum) >> 5] &= ~(1 << ((bitnum) & 0x1f));} while (0)
shuangy
1.1.2.1
32
33 #define TST_BIT(i_bitfield, bitnum) \
shuangy
1.1.2.2
34     ( i_bitfield[(bitnum) >> 5] & (1 << ((bitnum) & 0x1f)) )
shuangy
1.1.2.1
35
36
37 /* dummy value of split size for now */
38 #define PVFS_DIST_DIR_MAX_ENTRIES 16000
39
shuangy
1.1.2.2
40 /* set a fixed value for testing */
41 #define PVFS_DIST_DIR_DEFAULT_TOTAL_DIRDATA_NUM 4
42 #define PVFS_DIST_DIR_DEFAULT_INITIAL_DIRDATA_NUM 4
43
shuangy
1.1.2.1
44
45 static double my_log2(const double n);
46 static int dist_dir_calc_branch_level(
shuangy
1.1.2.2
47         const PVFS_dist_dir_attr *dist_dir_attr,
48         const PVFS_dist_dir_bitmap bitmap);
shuangy
1.1.2.1
49 int PINT_init_dist_dir_state(
shuangy
1.1.2.2
50                 PVFS_dist_dir_attr *dist_dir_attr
51                 PVFS_dist_dir_bitmap *bitmap_ptr,
52                 const int num_servers
53                 const int server_no
54                 const int pre_dsg_num_server);
shuangy
1.1.2.1
55 int PINT_find_dist_dir_bucket(
shuangy
1.1.2.2
56                 const PVFS_dist_dir_hash_type hash
57                 const PVFS_dist_dir_attr *const dist_dir_attr,
58                 const PVFS_dist_dir_bitmap bitmap);
shuangy
1.1.2.1
59 int PINT_find_dist_dir_split_node(
shuangy
1.1.2.2
60                 const PVFS_dist_dir_attr *const dist_dir_attr
61                 const PVFS_dist_dir_bitmap bitmap);
shuangy
1.1.2.1
62 int PINT_update_dist_dir_bitmap_from_bitmap(
shuangy
1.1.2.2
63                 PVFS_dist_dir_attr *to_dir_attr
64                 PVFS_dist_dir_bitmap to_dir_bitmap,
65                 const PVFS_dist_dir_attr *from_dir_attr
66                 const PVFS_dist_dir_bitmap from_dir_bitmap);
shuangy
1.1.2.1
67 PVFS_dist_dir_hash_type PINT_encrypt_dirdata(const char *const name);
68
69
70
71
72 #endif /* __DIST_DIR_UTILS_H */
73
74 /*
75  * Local variables:
76  *  c-indent-level: 4
77  *  c-basic-offset: 4
78  * End:
79  *
80  * vim: ts=8 sts=4 sw=4 expandtab
81  */