From patchwork Tue Dec 17 11:00:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 3360591 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 220FDC0D4A for ; Tue, 17 Dec 2013 11:01:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E494A201F5 for ; Tue, 17 Dec 2013 11:01:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A10B20237 for ; Tue, 17 Dec 2013 11:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752628Ab3LQLBI (ORCPT ); Tue, 17 Dec 2013 06:01:08 -0500 Received: from linux-libre.fsfla.org ([208.118.235.54]:47201 "EHLO linux-libre.fsfla.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752544Ab3LQLBF (ORCPT ); Tue, 17 Dec 2013 06:01:05 -0500 X-Greylist: delayed 309 seconds by postgrey-1.27 at vger.kernel.org; Tue, 17 Dec 2013 06:01:05 EST Received: from freie.home (home.lxoliva.fsfla.org [172.31.160.22]) by linux-libre.fsfla.org (8.14.4/8.14.4/Debian-2ubuntu2) with ESMTP id rBHB13tw009954 for ; Tue, 17 Dec 2013 11:01:04 GMT Received: from livre.home (livre.home [172.31.160.2]) by freie.home (8.14.7/8.14.7) with ESMTP id rBHB06Tr026915; Tue, 17 Dec 2013 09:00:07 -0200 From: Alexandre Oliva To: ceph-devel@vger.kernel.org Subject: [PATCH] mds: drop unused find_ino_dir Organization: Free thinker, not speaking for the GNU Project Date: Tue, 17 Dec 2013 09:00:00 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, T_TVD_MIME_NO_HEADERS, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP I was looking at inconsistencies in xattrs in my OSDs, and found out that only old dirs had the user.ceph.path attribute set. Trying to figure out what this was about, I noticed the code that set this attribute was still present, but it was not called anywhere. I decided to clean up the attribute from my cluster, and to wipe out the code that used to set it. Here's the resulting patch. mds: drop unused find_ino_dir From: Alexandre Oliva Remove all traces of find_ino_dir, it is no longer used. Signed-off-by: Alexandre Oliva --- src/mds/MDCache.cc | 51 --------------------------------------------------- src/mds/MDCache.h | 9 --------- 2 files changed, 60 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ae59c26..7eba644 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -8502,57 +8502,6 @@ void MDCache::kick_find_ino_peers(int who) /* ---------------------------- */ -struct C_MDS_FindInoDir : public Context { - MDCache *mdcache; - inodeno_t ino; - Context *fin; - bufferlist bl; - C_MDS_FindInoDir(MDCache *m, inodeno_t i, Context *f) : mdcache(m), ino(i), fin(f) {} - void finish(int r) { - mdcache->_find_ino_dir(ino, fin, bl, r); - } -}; - -void MDCache::find_ino_dir(inodeno_t ino, Context *fin) -{ - dout(10) << "find_ino_dir " << ino << dendl; - assert(!have_inode(ino)); - - // get the backtrace from the dir - object_t oid = CInode::get_object_name(ino, frag_t(), ""); - object_locator_t oloc(mds->mdsmap->get_metadata_pool()); - - C_MDS_FindInoDir *c = new C_MDS_FindInoDir(this, ino, fin); - mds->objecter->getxattr(oid, oloc, "path", CEPH_NOSNAP, &c->bl, 0, c); -} - -void MDCache::_find_ino_dir(inodeno_t ino, Context *fin, bufferlist& bl, int r) -{ - dout(10) << "_find_ino_dir " << ino << " got " << r << " " << bl.length() << " bytes" << dendl; - if (r < 0) { - fin->complete(r); - return; - } - - string s(bl.c_str(), bl.length()); - filepath path(s.c_str()); - vector trace; - - dout(10) << "_find_ino_dir traversing to path " << path << dendl; - - C_MDS_FindInoDir *c = new C_MDS_FindInoDir(this, ino, fin); - c->bl = bl; - r = path_traverse(NULL, NULL, c, path, &trace, NULL, MDS_TRAVERSE_DISCOVER); - if (r > 0) - return; - delete c; // path_traverse doesn't clean it up for us for r <= 0 - - fin->complete(r); -} - - -/* ---------------------------- */ - int MDCache::get_num_client_requests() { int count = 0; diff --git a/src/mds/MDCache.h b/src/mds/MDCache.h index 87b1098..415b049 100644 --- a/src/mds/MDCache.h +++ b/src/mds/MDCache.h @@ -840,15 +840,6 @@ public: void handle_find_ino_reply(MMDSFindInoReply *m); void kick_find_ino_peers(int who); - // -- find_ino_dir -- - struct find_ino_dir_info_t { - inodeno_t ino; - Context *fin; - }; - - void find_ino_dir(inodeno_t ino, Context *c); - void _find_ino_dir(inodeno_t ino, Context *c, bufferlist& bl, int r); - // -- anchors -- public: void anchor_create_prep_locks(MDRequest *mdr, CInode *in, set& rdlocks,