@@ -86,13 +86,13 @@ void btrfs_set_##name(struct extent_buffer *eb, \
{ \
unsigned long part_offset = (unsigned long)s; \
unsigned long offset = part_offset + offsetof(type, member); \
- type *p; \
+ u##bits *p; \
/* ugly, but we want the fast path here */ \
if (eb->map_token && offset >= eb->map_start && \
offset + sizeof(((type *)0)->member) <= eb->map_start + \
eb->map_len) { \
- p = (type *)(eb->kaddr + part_offset - eb->map_start); \
- p->member = cpu_to_le##bits(val); \
+ p = (u##bits *)(eb->kaddr + offset - eb->map_start); \
+ *p = cpu_to_le##bits(val); \
return; \
} \
{ \
@@ -112,8 +112,8 @@ void btrfs_set_##name(struct extent_buffer *eb, \
write_eb_member(eb, s, type, member, &val2); \
return; \
} \
- p = (type *)(kaddr + part_offset - map_start); \
- p->member = cpu_to_le##bits(val); \
+ p = (u##bits *)(kaddr + offset - map_start); \
+ *p = cpu_to_le##bits(val); \
if (unmap_on_exit) \
unmap_extent_buffer(eb, map_token, KM_USER1); \
} \