ceph: drop redundant r_mds field
authorSage Weil <sage@newdream.net>
Tue, 2 Nov 2010 20:41:47 +0000 (13:41 -0700)
committerSage Weil <sage@newdream.net>
Wed, 12 Jan 2011 23:15:13 +0000 (15:15 -0800)
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: Sage Weil <sage@newdream.net>
fs/ceph/debugfs.c
fs/ceph/mds_client.c
fs/ceph/mds_client.h

index 7ae1b3d55b58a7b70bf55e79a0788f211b90ff3c..08f65faac1126aa7a5096ec2a7233e5fb332242b 100644 (file)
@@ -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)) {
                req = rb_entry(rp, struct ceph_mds_request, r_node);
 
-               if (req->r_request)
-                       seq_printf(s, "%lld\tmds%d\t", req->r_tid, req->r_mds);
-               else
+               if (req->r_request && req->r_session)
+                       seq_printf(s, "%lld\tmds%d\t", req->r_tid,
+                                  req->r_session->s_mds);
+               else if (!req->r_request)
                        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));
 
index 9be29b06a2d90649f2ba71844a80ee09adc8b6e6..e22e8b41d5726d4e6f7ea577efbb7a010360984b 100644 (file)
@@ -1705,7 +1705,6 @@ static int __prepare_send_request(struct ceph_mds_client *mdsc,
        struct ceph_msg *msg;
        int flags = 0;
 
-       req->r_mds = mds;
        req->r_attempts++;
        if (req->r_inode) {
                struct ceph_cap *cap =
@@ -2068,8 +2067,11 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg)
                        goto out;
                } else  {
                        struct ceph_inode_info *ci = ceph_inode(req->r_inode);
-                       struct ceph_cap *cap =
-                               ceph_get_cap_for_mds(ci, req->r_mds);;
+                       struct ceph_cap *cap = NULL;
+
+                       if (req->r_session)
+                               cap = ceph_get_cap_for_mds(ci,
+                                                  req->r_session->s_mds);
 
                        dout("already using auth");
                        if ((!cap || cap != ci->i_auth_cap) ||
index f8f27f6eaa903d9a37b876f93f965412341924b3..4e3a9cc0bba6f1f89a77e6355a8f72a52614d43f 100644 (file)
@@ -166,7 +166,6 @@ struct ceph_mds_request {
        struct ceph_mds_client *r_mdsc;
 
        int r_op;                    /* mds op code */
-       int r_mds;
 
        /* operation on what? */
        struct inode *r_inode;              /* arg1 */