Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
OpenBMC Firmware
talos-obmc-linux
Commits
0deb01c9
Commit
0deb01c9
authored
14 years ago
by
Sage Weil
Browse files
Options
Download
Email Patches
Plain Diff
ceph: track laggy state of mds from mdsmap
Signed-off-by:
Sage Weil
<
sage@newdream.net
>
parent
cd84db6e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
2 deletions
+16
-2
fs/ceph/mds_client.c
fs/ceph/mds_client.c
+3
-1
fs/ceph/mdsmap.c
fs/ceph/mdsmap.c
+5
-1
fs/ceph/mdsmap.h
fs/ceph/mdsmap.h
+8
-0
No files found.
fs/ceph/mds_client.c
View file @
0deb01c9
...
...
@@ -2377,9 +2377,11 @@ static void check_new_map(struct ceph_mds_client *mdsc,
oldstate
=
ceph_mdsmap_get_state
(
oldmap
,
i
);
newstate
=
ceph_mdsmap_get_state
(
newmap
,
i
);
dout
(
"check_new_map mds%d state %s -> %s (session %s)
\n
"
,
dout
(
"check_new_map mds%d state %s
%s
-> %s
%s
(session %s)
\n
"
,
i
,
ceph_mds_state_name
(
oldstate
),
ceph_mdsmap_is_laggy
(
oldmap
,
i
)
?
" (laggy)"
:
""
,
ceph_mds_state_name
(
newstate
),
ceph_mdsmap_is_laggy
(
newmap
,
i
)
?
" (laggy)"
:
""
,
session_state_name
(
s
->
s_state
));
if
(
memcmp
(
ceph_mdsmap_get_addr
(
oldmap
,
i
),
...
...
This diff is collapsed.
Click to expand it.
fs/ceph/mdsmap.c
View file @
0deb01c9
...
...
@@ -85,6 +85,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
struct
ceph_entity_addr
addr
;
u32
num_export_targets
;
void
*
pexport_targets
=
NULL
;
struct
ceph_timespec
laggy_since
;
ceph_decode_need
(
p
,
end
,
sizeof
(
u64
)
*
2
+
1
+
sizeof
(
u32
),
bad
);
global_id
=
ceph_decode_64
(
p
);
...
...
@@ -103,7 +104,7 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
state_seq
=
ceph_decode_64
(
p
);
ceph_decode_copy
(
p
,
&
addr
,
sizeof
(
addr
));
ceph_decode_addr
(
&
addr
);
*
p
+=
sizeof
(
struct
ceph_timespec
);
ceph_decode_copy
(
p
,
&
laggy_since
,
sizeof
(
laggy_since
)
);
*
p
+=
sizeof
(
u32
);
ceph_decode_32_safe
(
p
,
end
,
namelen
,
bad
);
*
p
+=
namelen
;
...
...
@@ -122,6 +123,9 @@ struct ceph_mdsmap *ceph_mdsmap_decode(void **p, void *end)
m
->
m_info
[
mds
].
global_id
=
global_id
;
m
->
m_info
[
mds
].
state
=
state
;
m
->
m_info
[
mds
].
addr
=
addr
;
m
->
m_info
[
mds
].
laggy
=
(
laggy_since
.
tv_sec
!=
0
||
laggy_since
.
tv_nsec
!=
0
);
m
->
m_info
[
mds
].
num_export_targets
=
num_export_targets
;
if
(
num_export_targets
)
{
m
->
m_info
[
mds
].
export_targets
=
...
...
This diff is collapsed.
Click to expand it.
fs/ceph/mdsmap.h
View file @
0deb01c9
...
...
@@ -13,6 +13,7 @@ struct ceph_mds_info {
struct
ceph_entity_addr
addr
;
s32
state
;
int
num_export_targets
;
bool
laggy
;
u32
*
export_targets
;
};
...
...
@@ -47,6 +48,13 @@ static inline int ceph_mdsmap_get_state(struct ceph_mdsmap *m, int w)
return
m
->
m_info
[
w
].
state
;
}
static
inline
bool
ceph_mdsmap_is_laggy
(
struct
ceph_mdsmap
*
m
,
int
w
)
{
if
(
w
>=
0
&&
w
<
m
->
m_max_mds
)
return
m
->
m_info
[
w
].
laggy
;
return
false
;
}
extern
int
ceph_mdsmap_get_random_mds
(
struct
ceph_mdsmap
*
m
);
extern
struct
ceph_mdsmap
*
ceph_mdsmap_decode
(
void
**
p
,
void
*
end
);
extern
void
ceph_mdsmap_destroy
(
struct
ceph_mdsmap
*
m
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment