aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/ceph/ceph_fs.h23
-rw-r--r--include/linux/ceph/osdmap.h27
2 files changed, 23 insertions, 27 deletions
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
index 0a37b989b52f..2623cffc73a1 100644
--- a/include/linux/ceph/ceph_fs.h
+++ b/include/linux/ceph/ceph_fs.h
@@ -53,6 +53,29 @@ struct ceph_file_layout {
53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */ 53 __le32 fl_pg_pool; /* namespace, crush ruleset, rep level */
54} __attribute__ ((packed)); 54} __attribute__ ((packed));
55 55
56#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
57#define ceph_file_layout_stripe_count(l) \
58 ((__s32)le32_to_cpu((l).fl_stripe_count))
59#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
60#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
61#define ceph_file_layout_object_su(l) \
62 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
63#define ceph_file_layout_pg_pool(l) \
64 ((__s32)le32_to_cpu((l).fl_pg_pool))
65
66static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
67{
68 return le32_to_cpu(l->fl_stripe_unit) *
69 le32_to_cpu(l->fl_stripe_count);
70}
71
72/* "period" == bytes before i start on a new set of objects */
73static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l)
74{
75 return le32_to_cpu(l->fl_object_size) *
76 le32_to_cpu(l->fl_stripe_count);
77}
78
56#define CEPH_MIN_STRIPE_UNIT 65536 79#define CEPH_MIN_STRIPE_UNIT 65536
57 80
58int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); 81int ceph_file_layout_is_valid(const struct ceph_file_layout *layout);
diff --git a/include/linux/ceph/osdmap.h b/include/linux/ceph/osdmap.h
index 256134af4ad4..f2679c384625 100644
--- a/include/linux/ceph/osdmap.h
+++ b/include/linux/ceph/osdmap.h
@@ -72,33 +72,6 @@ struct ceph_osdmap {
72 struct crush_map *crush; 72 struct crush_map *crush;
73}; 73};
74 74
75/*
76 * file layout helpers
77 */
78#define ceph_file_layout_su(l) ((__s32)le32_to_cpu((l).fl_stripe_unit))
79#define ceph_file_layout_stripe_count(l) \
80 ((__s32)le32_to_cpu((l).fl_stripe_count))
81#define ceph_file_layout_object_size(l) ((__s32)le32_to_cpu((l).fl_object_size))
82#define ceph_file_layout_cas_hash(l) ((__s32)le32_to_cpu((l).fl_cas_hash))
83#define ceph_file_layout_object_su(l) \
84 ((__s32)le32_to_cpu((l).fl_object_stripe_unit))
85#define ceph_file_layout_pg_pool(l) \
86 ((__s32)le32_to_cpu((l).fl_pg_pool))
87
88static inline unsigned ceph_file_layout_stripe_width(struct ceph_file_layout *l)
89{
90 return le32_to_cpu(l->fl_stripe_unit) *
91 le32_to_cpu(l->fl_stripe_count);
92}
93
94/* "period" == bytes before i start on a new set of objects */
95static inline unsigned ceph_file_layout_period(struct ceph_file_layout *l)
96{
97 return le32_to_cpu(l->fl_object_size) *
98 le32_to_cpu(l->fl_stripe_count);
99}
100
101
102static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd) 75static inline int ceph_osd_is_up(struct ceph_osdmap *map, int osd)
103{ 76{
104 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP); 77 return (osd < map->max_osd) && (map->osd_state[osd] & CEPH_OSD_UP);