5 #include <linux/string.h>
6 #include <linux/random.h>
7 #include <linux/time.h>
11 #define objectid_map(s,rs) (old_format_only (s) ? \
12 (__le32 *)((struct reiserfs_super_block_v1 *)(rs) + 1) :\
15 #ifdef CONFIG_REISERFS_CHECK
52 __u32 unused_objectid;
56 check_objectid_map(s, map);
61 if (unused_objectid ==
U32_MAX) {
87 return unused_objectid;
92 __u32 objectid_to_release)
101 check_objectid_map(s, map);
115 le32_add_cpu(&map[i], 1);
118 if (map[i] == map[i + 1]) {
128 "vs-15005: objectid map corrupted cur_size == %d (max == %d)",
137 if (objectid_to_release + 1 ==
le32_to_cpu(map[i + 1])) {
139 le32_add_cpu(&map[i + 1], -1);
151 memmove(map + i + 3, map + i + 1,
161 reiserfs_error(s,
"vs-15011",
"tried to free free object id (%lu)",
162 (
long unsigned)objectid_to_release);
177 objectid_map = (
__le32 *) (disk_sb_v1 + 1);
178 new_objectid_map = (
__le32 *) (disk_sb + 1);
180 if (cur_size > new_size) {
184 objectid_map[new_size - 1] = objectid_map[cur_size - 1];
188 for (i = new_size - 1; i >= 0; i--) {
189 objectid_map[i + (old_max - new_size)] = objectid_map[i];