btrfs-progs: Constify getters

Signed-off-by: Kusanagi Kouichi <slash@ac.auone-net.jp>
Signed-off-by: David Sterba <dsterba@suse.cz>
master
Kusanagi Kouichi 2014-04-08 22:37:39 +09:00 committed by David Sterba
parent f84db1ca70
commit 779387ba2a
1 changed files with 6 additions and 6 deletions

12
ctree.h
View File

@ -1184,9 +1184,9 @@ struct btrfs_root {
sizeof(((type *)0)->member)))
#define BTRFS_SETGET_HEADER_FUNCS(name, type, member, bits) \
static inline u##bits btrfs_##name(struct extent_buffer *eb) \
static inline u##bits btrfs_##name(const struct extent_buffer *eb) \
{ \
struct btrfs_header *h = (struct btrfs_header *)eb->data; \
const struct btrfs_header *h = (struct btrfs_header *)eb->data; \
return le##bits##_to_cpu(h->member); \
} \
static inline void btrfs_set_##name(struct extent_buffer *eb, \
@ -1197,11 +1197,11 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, \
}
#define BTRFS_SETGET_FUNCS(name, type, member, bits) \
static inline u##bits btrfs_##name(struct extent_buffer *eb, \
type *s) \
static inline u##bits btrfs_##name(const struct extent_buffer *eb, \
const type *s) \
{ \
unsigned long offset = (unsigned long)s; \
type *p = (type *) (eb->data + offset); \
const type *p = (type *) (eb->data + offset); \
return get_unaligned_le##bits(&p->member); \
} \
static inline void btrfs_set_##name(struct extent_buffer *eb, \
@ -1213,7 +1213,7 @@ static inline void btrfs_set_##name(struct extent_buffer *eb, \
}
#define BTRFS_SETGET_STACK_FUNCS(name, type, member, bits) \
static inline u##bits btrfs_##name(type *s) \
static inline u##bits btrfs_##name(const type *s) \
{ \
return le##bits##_to_cpu(s->member); \
} \