Revision 74a5d4ae chunklock.c

View differences:

chunklock.c
19 19

  
20 20
struct lock {
21 21
  int chunkid;
22
  const struct nodeID *peer;
22
  struct nodeID *peer;
23 23
  struct timeval timestamp;
24 24
};
25 25

  
......
31 31
{
32 32
  if (!locks) {
33 33
    lsize = LSIZE_INCREMENT;
34
    locks = (struct lock *)malloc(sizeof(struct lock) * lsize);
34
    locks = malloc(sizeof(struct lock) * lsize);
35 35
    lcount = 0;
36 36
  }
37 37

  
38 38
  if (lcount == lsize) {
39 39
    lsize += LSIZE_INCREMENT;
40
    locks = (struct lock *)realloc(locks , sizeof(struct lock) * lsize);
40
    locks = realloc(locks , sizeof(struct lock) * lsize);
41 41
  }
42 42

  
43 43
  if (!locks) {
......
80 80
}
81 81

  
82 82
void chunk_unlock(int chunkid){
83
  size_t i;
83
  int i;
84 84

  
85 85
  for (i=0; i<lcount; i++) {
86 86
    if (locks[i].chunkid == chunkid) {
......
91 91
}
92 92

  
93 93
int chunk_islocked(int chunkid){
94
  size_t i;
94
  int i;
95 95

  
96 96
  chunk_locks_cleanup();
97 97

  

Also available in: Unified diff