From 33a9fd5758a98a16445e83e2e0b14b7d7000632f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 1 May 2008 09:39:32 -0700 Subject: [PATCH] kclient: misc cleanup --- src/kernel/dir.c | 4 ++-- src/kernel/inode.c | 12 ++---------- src/kernel/mds_client.c | 19 ++++++------------- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/kernel/dir.c b/src/kernel/dir.c index 377bc80a5cec0..9f27661cbfd8e 100644 --- a/src/kernel/dir.c +++ b/src/kernel/dir.c @@ -49,8 +49,8 @@ retry: } else { strncpy(path + pos, temp->d_name.name, temp->d_name.len); - dout(30, "build_path_dentry path+%d: '%.*s'\n", - pos, temp->d_name.len, path + pos); + dout(50, "build_path_dentry path+%d: %p '%.*s'\n", + pos, temp, temp->d_name.len, path + pos); if (pos) path[--pos] = '/'; } diff --git a/src/kernel/inode.c b/src/kernel/inode.c index 91a2c7b6e42b9..7f935f6c7ae4c 100644 --- a/src/kernel/inode.c +++ b/src/kernel/inode.c @@ -82,14 +82,12 @@ int ceph_fill_inode(struct inode *inode, struct ceph_mds_reply_inode *info) dout(30, "fill_inode %p ino %llx by %d.%d sz=%llu mode %o nlink %d\n", inode, info->ino, inode->i_uid, inode->i_gid, inode->i_size, inode->i_mode, inode->i_nlink); - dout(30, " su %d, blkbits %d, blocks %llu\n", - su, blkbits, blocks); ceph_set_ino(inode, le64_to_cpu(info->ino)); spin_lock(&inode->i_lock); - dout(30, " got version %llu, had %llu\n", - le64_to_cpu(info->version), ci->i_version); + dout(30, " su %d, blkbits %d, blocks %llu. v %llu, had %llu\n", + su, blkbits, blocks, le64_to_cpu(info->version), ci->i_version); if (le64_to_cpu(info->version) > 0 && ci->i_version == le64_to_cpu(info->version)) goto no_change; @@ -166,21 +164,17 @@ no_change: case S_IFBLK: case S_IFCHR: case S_IFSOCK: - dout(20, "%p is special\n", inode); init_special_inode(inode, inode->i_mode, inode->i_rdev); inode->i_op = &ceph_special_iops; break; case S_IFREG: - dout(20, "%p is a file\n", inode); inode->i_op = &ceph_file_iops; inode->i_fop = &ceph_file_fops; break; case S_IFLNK: - dout(20, "%p is a symlink\n", inode); inode->i_op = &ceph_symlink_iops; symlen = le32_to_cpu(*(__u32 *)(info->fragtree.splits + ci->i_fragtree->nsplits)); - dout(20, "symlink len is %d\n", symlen); BUG_ON(symlen != ci->vfs_inode.i_size); ci->i_symlink = kmalloc(symlen+1, GFP_NOFS); if (ci->i_symlink == NULL) @@ -190,10 +184,8 @@ no_change: ci->i_fragtree->nsplits) + 4, symlen); ci->i_symlink[symlen] = 0; - dout(20, "symlink is '%s'\n", ci->i_symlink); break; case S_IFDIR: - dout(20, "%p is a dir\n", inode); inode->i_op = &ceph_dir_iops; inode->i_fop = &ceph_dir_fops; break; diff --git a/src/kernel/mds_client.c b/src/kernel/mds_client.c index 791ead60bacea..596701e0cd69a 100644 --- a/src/kernel/mds_client.c +++ b/src/kernel/mds_client.c @@ -862,8 +862,6 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, head->op = cpu_to_le32(op); head->caller_uid = cpu_to_le32(current->euid); head->caller_gid = cpu_to_le32(current->egid); - dout(10, "create_request euid.egid %d.%d\n", - current->euid, current->egid); /* encode paths */ ceph_encode_filepath(&p, end, ino1, path1); @@ -882,13 +880,12 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, /* * return oldest (lowest) tid in request tree, 0 if none. */ -__u64 get_oldest_tid(struct ceph_mds_client *mdsc) +__u64 __get_oldest_tid(struct ceph_mds_client *mdsc) { struct ceph_mds_request *first; if (radix_tree_gang_lookup(&mdsc->request_tree, (void **)&first, 0, 1) <= 0) return 0; - dout(10, "oldest tid is %llu\n", first->r_tid); return first->r_tid; } @@ -915,22 +912,20 @@ retry: wait_for_new_map(mdsc); goto retry; } - dout(30, "do_request chose mds%d\n", mds); /* get session */ session = __get_session(mdsc, mds); - dout(30, "do_request __get_session returned %p state %d\n", - session, (session ? session->s_state:0)); if (!session) session = __register_session(mdsc, mds); - dout(30, "do_request session %p state %d\n", session, session->s_state); + dout(30, "do_request mds%d session %p state %d\n", mds, session, + session->s_state); /* open? */ err = 0; if (session->s_state == CEPH_MDS_SESSION_NEW || session->s_state == CEPH_MDS_SESSION_CLOSING) { err = open_session(mdsc, session); - dout(30, "do_request session err=%d\n", err); + dout(30, "do_request open_session err=%d\n", err); BUG_ON(err && err != -EAGAIN); } if (session->s_state != CEPH_MDS_SESSION_OPEN || @@ -942,17 +937,15 @@ retry: } /* make request? */ - if (req->r_session == 0) { + if (req->r_session == 0) req->r_from_time = jiffies; - dout(30, "do_request from_time %lu\n", req->r_from_time); - } BUG_ON(req->r_session); req->r_session = session; req->r_resend_mds = -1; /* forget any specific mds hint */ req->r_attempts++; rhead = req->r_request->front.iov_base; rhead->retry_attempt = cpu_to_le32(req->r_attempts-1); - rhead->oldest_client_tid = cpu_to_le64(get_oldest_tid(mdsc)); + rhead->oldest_client_tid = cpu_to_le64(__get_oldest_tid(mdsc)); /* send and wait */ spin_unlock(&mdsc->lock); -- 2.39.5