aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 52144b04f1af..086cb0525cd1 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -495,22 +495,17 @@ void btrfs_set_##name(struct extent_buffer *eb, type *s, u##bits val);
495#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits) \ 495#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits) \
496static inline u##bits btrfs_##name(struct extent_buffer *eb) \ 496static inline u##bits btrfs_##name(struct extent_buffer *eb) \
497{ \ 497{ \
498 char *kaddr = kmap_atomic(eb->first_page, KM_USER0); \ 498 type *p = kmap_atomic(eb->first_page, KM_USER0); \
499 unsigned long offset = offsetof(type, member); \ 499 u##bits res = le##bits##_to_cpu(p->member); \
500 u##bits res; \ 500 kunmap_atomic(p, KM_USER0); \
501 __le##bits *tmp = (__le##bits *)(kaddr + offset); \
502 res = le##bits##_to_cpu(*tmp); \
503 kunmap_atomic(kaddr, KM_USER0); \
504 return res; \ 501 return res; \
505} \ 502} \
506static inline void btrfs_set_##name(struct extent_buffer *eb, \ 503static inline void btrfs_set_##name(struct extent_buffer *eb, \
507 u##bits val) \ 504 u##bits val) \
508{ \ 505{ \
509 char *kaddr = kmap_atomic(eb->first_page, KM_USER0); \ 506 type *p = kmap_atomic(eb->first_page, KM_USER0); \
510 unsigned long offset = offsetof(type, member); \ 507 p->member = cpu_to_le##bits(val); \
511 __le##bits *tmp = (__le##bits *)(kaddr + offset); \ 508 kunmap_atomic(p, KM_USER0); \
512 *tmp = cpu_to_le##bits(val); \
513 kunmap_atomic(kaddr, KM_USER0); \
514} 509}
515 510
516#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits) \ 511#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits) \