Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208837
b: refs/heads/master
c: ed0552a
h: refs/heads/master
i:
  208835: 0e7e1d4
v: v3
  • Loading branch information
Sage Weil committed Aug 2, 2010
1 parent 6fb2734 commit 8bc95ef
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 796d6955a51ce6768d0e033f27a2f8f5be6cb39a
refs/heads/master: ed0552a1a21d2f2692b84c366ce04ad17377780c
37 changes: 37 additions & 0 deletions trunk/fs/ceph/mds_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,43 @@ static int __open_session(struct ceph_mds_client *mdsc,
return 0;
}

/*
* open sessions for any export targets for the given mds
*
* called under mdsc->mutex
*/
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));
ceph_put_mds_session(ts);
}
}

/*
* session caps
*/
Expand Down

0 comments on commit 8bc95ef

Please sign in to comment.