Lines Matching +full:1 +full:eb

12 static bool check_setget_bounds(const struct extent_buffer *eb,  in check_setget_bounds()  argument
17 if (unlikely(member_offset + size > eb->len)) { in check_setget_bounds()
18 btrfs_warn(eb->fs_info, in check_setget_bounds()
19 "bad eb member %s: ptr 0x%lx start %llu member offset %lu size %d", in check_setget_bounds()
20 (member_offset > eb->len ? "start" : "end"), in check_setget_bounds()
21 (unsigned long)ptr, eb->start, member_offset, size); in check_setget_bounds()
28 void btrfs_init_map_token(struct btrfs_map_token *token, struct extent_buffer *eb) in btrfs_init_map_token() argument
30 token->eb = eb; in btrfs_init_map_token()
31 token->kaddr = folio_address(eb->folios[0]); in btrfs_init_map_token()
64 const unsigned long idx = get_eb_folio_index(token->eb, member_offset); \
65 const unsigned long oil = get_eb_offset_in_folio(token->eb, \
67 const int unit_size = token->eb->folio_size; \
68 const int unit_shift = token->eb->folio_shift; \
75 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
80 token->kaddr = folio_address(token->eb->folios[idx]); \
82 if (INLINE_EXTENT_BUFFER_PAGES == 1 || oil + size <= unit_size) \
86 token->kaddr = folio_address(token->eb->folios[idx + 1]); \
87 token->offset = (idx + 1) << unit_shift; \
91 u##bits btrfs_get_##bits(const struct extent_buffer *eb, \
95 const unsigned long idx = get_eb_folio_index(eb, member_offset);\
96 const unsigned long oil = get_eb_offset_in_folio(eb, \
98 const int unit_size = eb->folio_size; \
99 char *kaddr = folio_address(eb->folios[idx]); \
104 ASSERT(check_setget_bounds(eb, ptr, off, size)); \
105 if (INLINE_EXTENT_BUFFER_PAGES == 1 || oil + size <= unit_size) \
109 kaddr = folio_address(eb->folios[idx + 1]); \
118 const unsigned long idx = get_eb_folio_index(token->eb, member_offset); \
119 const unsigned long oil = get_eb_offset_in_folio(token->eb, \
121 const int unit_size = token->eb->folio_size; \
122 const int unit_shift = token->eb->folio_shift; \
129 ASSERT(check_setget_bounds(token->eb, ptr, off, size)); \
135 token->kaddr = folio_address(token->eb->folios[idx]); \
137 if (INLINE_EXTENT_BUFFER_PAGES == 1 || \
144 token->kaddr = folio_address(token->eb->folios[idx + 1]); \
145 token->offset = (idx + 1) << unit_shift; \
148 void btrfs_set_##bits(const struct extent_buffer *eb, void *ptr, \
152 const unsigned long idx = get_eb_folio_index(eb, member_offset);\
153 const unsigned long oil = get_eb_offset_in_folio(eb, \
155 const int unit_size = eb->folio_size; \
156 char *kaddr = folio_address(eb->folios[idx]); \
161 ASSERT(check_setget_bounds(eb, ptr, off, size)); \
162 if (INLINE_EXTENT_BUFFER_PAGES == 1 || \
170 kaddr = folio_address(eb->folios[idx + 1]); \
179 void btrfs_node_key(const struct extent_buffer *eb, in btrfs_node_key() argument
182 unsigned long ptr = btrfs_node_key_ptr_offset(eb, nr); in btrfs_node_key()
183 read_eb_member(eb, (struct btrfs_key_ptr *)ptr, in btrfs_node_key()