diff options
author | Yan, Zheng <zyan@redhat.com> | 2016-02-13 22:24:31 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2016-07-27 20:55:37 -0400 |
commit | 30c156d9951e0aa88202707d80c583b0a09d3167 (patch) | |
tree | afda9d55374a9b078a5ddd8d5a8c1f2a847eccd5 /include/linux/ceph | |
parent | 51e9273796a57c08801f45580d3db3c51987a0cb (diff) |
libceph: rados pool namespace support
Add pool namesapce pointer to struct ceph_file_layout and struct
ceph_object_locator. Pool namespace is used by when mapping object
to PG, it's also used when composing OSD request.
The namespace pointer in struct ceph_file_layout is RCU protected.
So libceph can read namespace without taking lock.
Signed-off-by: Yan, Zheng <zyan@redhat.com>
[idryomov@gmail.com: ceph_oloc_destroy(), misc minor changes]
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'include/linux/ceph')
-rw-r--r-- | include/linux/ceph/ceph_fs.h | 2 | ||||
-rw-r--r-- | include/linux/ceph/osdmap.h | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index e5a5fb9ca3f5..08b8fd72261e 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -53,6 +53,7 @@ struct ceph_file_layout_legacy { | |||
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 | struct ceph_string; | ||
56 | /* | 57 | /* |
57 | * ceph_file_layout - describe data layout for a file/inode | 58 | * ceph_file_layout - describe data layout for a file/inode |
58 | */ | 59 | */ |
@@ -62,6 +63,7 @@ struct ceph_file_layout { | |||
62 | u32 stripe_count; /* over this many objects */ | 63 | u32 stripe_count; /* over this many objects */ |
63 | u32 object_size; /* until objects are this big */ | 64 | u32 object_size; /* until objects are this big */ |
64 | s64 pool_id; /* rados pool id */ | 65 | s64 pool_id; /* rados pool id */ |
66 | struct ceph_string __rcu *pool_ns; /* rados pool namespace */ | ||
65 | }; | 67 | }; |
66 | 68 | ||
67 | extern int ceph_file_layout_is_valid(const struct ceph_file_layout *layout); | 69 | extern int 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 21d7f048959f..9a9041784dcf 100644 --- a/include/linux/ceph/osdmap.h +++ b/include/linux/ceph/osdmap.h | |||
@@ -63,11 +63,13 @@ static inline bool ceph_can_shift_osds(struct ceph_pg_pool_info *pool) | |||
63 | 63 | ||
64 | struct ceph_object_locator { | 64 | struct ceph_object_locator { |
65 | s64 pool; | 65 | s64 pool; |
66 | struct ceph_string *pool_ns; | ||
66 | }; | 67 | }; |
67 | 68 | ||
68 | static inline void ceph_oloc_init(struct ceph_object_locator *oloc) | 69 | static inline void ceph_oloc_init(struct ceph_object_locator *oloc) |
69 | { | 70 | { |
70 | oloc->pool = -1; | 71 | oloc->pool = -1; |
72 | oloc->pool_ns = NULL; | ||
71 | } | 73 | } |
72 | 74 | ||
73 | static inline bool ceph_oloc_empty(const struct ceph_object_locator *oloc) | 75 | static inline bool ceph_oloc_empty(const struct ceph_object_locator *oloc) |
@@ -75,11 +77,9 @@ static inline bool ceph_oloc_empty(const struct ceph_object_locator *oloc) | |||
75 | return oloc->pool == -1; | 77 | return oloc->pool == -1; |
76 | } | 78 | } |
77 | 79 | ||
78 | static inline void ceph_oloc_copy(struct ceph_object_locator *dest, | 80 | void ceph_oloc_copy(struct ceph_object_locator *dest, |
79 | const struct ceph_object_locator *src) | 81 | const struct ceph_object_locator *src); |
80 | { | 82 | void ceph_oloc_destroy(struct ceph_object_locator *oloc); |
81 | dest->pool = src->pool; | ||
82 | } | ||
83 | 83 | ||
84 | /* | 84 | /* |
85 | * Maximum supported by kernel client object name length | 85 | * Maximum supported by kernel client object name length |