Commit 4af25fdd authored by Sage Weil's avatar Sage Weil

ceph: drop redundant r_mds field

The r_mds field is redundant, since we can find the same information at
r_session->s_mds, and when r_session is NULL then r_mds is meaningless.
Signed-off-by: default avatarSage Weil <sage@newdream.net>
parent 14303d20
...@@ -60,10 +60,13 @@ static int mdsc_show(struct seq_file *s, void *p) ...@@ -60,10 +60,13 @@ static int mdsc_show(struct seq_file *s, void *p)
for (rp = rb_first(&mdsc->request_tree); rp; rp = rb_next(rp)) { for (rp = rb_first(&mdsc->request_tree); rp; rp = rb_next(rp)) {
req = rb_entry(rp, struct ceph_mds_request, r_node); req = rb_entry(rp, struct ceph_mds_request, r_node);
if (req->r_request) if (req->r_request && req->r_session)
seq_printf(s, "%lld\tmds%d\t", req->r_tid, req->r_mds); seq_printf(s, "%lld\tmds%d\t", req->r_tid,
else req->r_session->s_mds);
else if (!req->r_request)
seq_printf(s, "%lld\t(no request)\t", req->r_tid); seq_printf(s, "%lld\t(no request)\t", req->r_tid);
else
seq_printf(s, "%lld\t(no session)\t", req->r_tid);
seq_printf(s, "%s", ceph_mds_op_name(req->r_op)); seq_printf(s, "%s", ceph_mds_op_name(req->r_op));
......
...@@ -1705,7 +1705,6 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc, ...@@ -1705,7 +1705,6 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
struct ceph_msg *msg; struct ceph_msg *msg;
int flags = 0; int flags = 0;
req->r_mds = mds;
req->r_attempts++; req->r_attempts++;
if (req->r_inode) { if (req->r_inode) {
struct ceph_cap *cap = struct ceph_cap *cap =
...@@ -2068,8 +2067,11 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) ...@@ -2068,8 +2067,11 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
goto out; goto out;
} else { } else {
struct ceph_inode_info *ci = ceph_inode(req->r_inode); struct ceph_inode_info *ci = ceph_inode(req->r_inode);
struct ceph_cap *cap = struct ceph_cap *cap = NULL;
ceph_get_cap_for_mds(ci, req->r_mds);;
if (req->r_session)
cap = ceph_get_cap_for_mds(ci,
req->r_session->s_mds);
dout("already using auth"); dout("already using auth");
if ((!cap || cap != ci->i_auth_cap) || if ((!cap || cap != ci->i_auth_cap) ||
......
...@@ -166,7 +166,6 @@ struct ceph_mds_request { ...@@ -166,7 +166,6 @@ struct ceph_mds_request {
struct ceph_mds_client *r_mdsc; struct ceph_mds_client *r_mdsc;
int r_op; /* mds op code */ int r_op; /* mds op code */
int r_mds;
/* operation on what? */ /* operation on what? */
struct inode *r_inode; /* arg1 */ struct inode *r_inode; /* arg1 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment