Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
5d72d13c
Commit
5d72d13c
authored
Nov 24, 2013
by
Yan, Zheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceph: add open export target session helper
Signed-off-by:
Yan, Zheng
<
zheng.z.yan@intel.com
>
parent
4ee6a914
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
15 deletions
+38
-15
fs/ceph/mds_client.c
fs/ceph/mds_client.c
+36
-15
fs/ceph/mds_client.h
fs/ceph/mds_client.h
+2
-0
No files found.
fs/ceph/mds_client.c
View file @
5d72d13c
...
...
@@ -847,34 +847,55 @@ static int __open_session(struct ceph_mds_client *mdsc,
*
* called under mdsc->mutex
*/
static
struct
ceph_mds_session
*
__open_export_target_session
(
struct
ceph_mds_client
*
mdsc
,
int
target
)
{
struct
ceph_mds_session
*
session
;
session
=
__ceph_lookup_mds_session
(
mdsc
,
target
);
if
(
!
session
)
{
session
=
register_session
(
mdsc
,
target
);
if
(
IS_ERR
(
session
))
return
session
;
}
if
(
session
->
s_state
==
CEPH_MDS_SESSION_NEW
||
session
->
s_state
==
CEPH_MDS_SESSION_CLOSING
)
__open_session
(
mdsc
,
session
);
return
session
;
}
struct
ceph_mds_session
*
ceph_mdsc_open_export_target_session
(
struct
ceph_mds_client
*
mdsc
,
int
target
)
{
struct
ceph_mds_session
*
session
;
dout
(
"open_export_target_session to mds%d
\n
"
,
target
);
mutex_lock
(
&
mdsc
->
mutex
);
session
=
__open_export_target_session
(
mdsc
,
target
);
mutex_unlock
(
&
mdsc
->
mutex
);
return
session
;
}
static
void
__open_export_target_sessions
(
struct
ceph_mds_client
*
mdsc
,
struct
ceph_mds_session
*
session
)
{
struct
ceph_mds_info
*
mi
;
struct
ceph_mds_session
*
ts
;
int
i
,
mds
=
session
->
s_mds
;
int
target
;
if
(
mds
>=
mdsc
->
mdsmap
->
m_max_mds
)
return
;
mi
=
&
mdsc
->
mdsmap
->
m_info
[
mds
];
dout
(
"open_export_target_sessions for mds%d (%d targets)
\n
"
,
session
->
s_mds
,
mi
->
num_export_targets
);
for
(
i
=
0
;
i
<
mi
->
num_export_targets
;
i
++
)
{
target
=
mi
->
export_targets
[
i
];
ts
=
__ceph_lookup_mds_session
(
mdsc
,
target
);
if
(
!
ts
)
{
ts
=
register_session
(
mdsc
,
target
);
if
(
IS_ERR
(
ts
))
return
;
}
if
(
session
->
s_state
==
CEPH_MDS_SESSION_NEW
||
session
->
s_state
==
CEPH_MDS_SESSION_CLOSING
)
__open_session
(
mdsc
,
session
);
else
dout
(
" mds%d target mds%d %p is %s
\n
"
,
session
->
s_mds
,
i
,
ts
,
session_state_name
(
ts
->
s_state
));
ts
=
__open_export_target_session
(
mdsc
,
mi
->
export_targets
[
i
]);
if
(
!
IS_ERR
(
ts
))
ceph_put_mds_session
(
ts
);
}
}
...
...
fs/ceph/mds_client.h
View file @
5d72d13c
...
...
@@ -383,6 +383,8 @@ extern void ceph_mdsc_lease_send_msg(struct ceph_mds_session *session,
extern
void
ceph_mdsc_handle_map
(
struct
ceph_mds_client
*
mdsc
,
struct
ceph_msg
*
msg
);
extern
struct
ceph_mds_session
*
ceph_mdsc_open_export_target_session
(
struct
ceph_mds_client
*
mdsc
,
int
target
);
extern
void
ceph_mdsc_open_export_target_sessions
(
struct
ceph_mds_client
*
mdsc
,
struct
ceph_mds_session
*
session
);
...
...
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