diff options
-rw-r--r-- | src/bucket.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bucket.c b/src/bucket.c index 0597965..3d267e2 100644 --- a/src/bucket.c +++ b/src/bucket.c | |||
@@ -45,25 +45,25 @@ _gdbm_new_bucket (GDBM_FILE dbf, hash_bucket *bucket, int bits) | |||
45 | /* Return true if the directory entry at DIR_INDEX can be considered | 45 | /* Return true if the directory entry at DIR_INDEX can be considered |
46 | valid. This means that DIR_INDEX is in the valid range for addressing | 46 | valid. This means that DIR_INDEX is in the valid range for addressing |
47 | the dir array, and the offset stored in dir[DIR_INDEX] points past | 47 | the dir array, and the offset stored in dir[DIR_INDEX] points past |
48 | first two blocks in file. This does not necessarily mean that there's | 48 | first two blocks in file. This does not necessarily mean that there's |
49 | a valid bucket or data block at that offset. All this implies is that | 49 | a valid bucket or data block at that offset. All this implies is that |
50 | it is safe to use the offset for look up in the bucket cache and to | 50 | it is safe to use the offset for look up in the bucket cache and to |
51 | attempt to read a block at that offset. */ | 51 | attempt to read a block at that offset. */ |
52 | int | 52 | int |
53 | gdbm_dir_entry_valid_p (GDBM_FILE dbf, int dir_index) | 53 | gdbm_dir_entry_valid_p (GDBM_FILE dbf, int dir_index) |
54 | { | 54 | { |
55 | return dir_index >= 0 | 55 | return dir_index >= 0 |
56 | && dir_index < GDBM_DIR_COUNT (dbf) | 56 | && dir_index < GDBM_DIR_COUNT (dbf) |
57 | && dbf->dir[dir_index] >= 2*dbf->header->block_size; | 57 | && dbf->dir[dir_index] >= dbf->header->block_size; |
58 | } | 58 | } |
59 | 59 | ||
60 | /* Find a bucket for DBF that is pointed to by the bucket directory from | 60 | /* Find a bucket for DBF that is pointed to by the bucket directory from |
61 | location DIR_INDEX. The bucket cache is first checked to see if it | 61 | location DIR_INDEX. The bucket cache is first checked to see if it |
62 | is already in memory. If not, a bucket may be tossed to read the new | 62 | is already in memory. If not, a bucket may be tossed to read the new |
63 | bucket. On success, the requested bucket becomes the "current" bucket | 63 | bucket. On success, the requested bucket becomes the "current" bucket |
64 | and dbf->bucket points to the correct bucket. On error, the current | 64 | and dbf->bucket points to the correct bucket. On error, the current |
65 | bucket remains unchanged. */ | 65 | bucket remains unchanged. */ |
66 | 66 | ||
67 | int | 67 | int |
68 | _gdbm_get_bucket (GDBM_FILE dbf, int dir_index) | 68 | _gdbm_get_bucket (GDBM_FILE dbf, int dir_index) |
69 | { | 69 | { |