From patchwork Tue Feb 14 20:11:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Dryomov X-Patchwork-Id: 9572769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6611560578 for ; Tue, 14 Feb 2017 20:12:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6296B281E1 for ; Tue, 14 Feb 2017 20:12:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56BD128417; Tue, 14 Feb 2017 20:12:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F955281E1 for ; Tue, 14 Feb 2017 20:12:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030AbdBNUMi (ORCPT ); Tue, 14 Feb 2017 15:12:38 -0500 Received: from mail-qk0-f194.google.com ([209.85.220.194]:34850 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754915AbdBNUMd (ORCPT ); Tue, 14 Feb 2017 15:12:33 -0500 Received: by mail-qk0-f194.google.com with SMTP id u25so20603163qki.2 for ; Tue, 14 Feb 2017 12:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/n36fbd089nYyGejx0G/+oOxsm6BU1aYHoiAvJfuXb4=; b=Oz6RLRutQc8ocE36HbStpk90k4rLjyTQiDO1Cq1EFYFVSk2WSWl13tQ1kl2iHGS5Qj 96eujlKb1GnHe7DjhpzCEDnvuWubg9WE/lf3CzfJr//AI99kUJ82CNEhqwnwFCPN08FT vRguKRvaDuQqEHj41oPn/ppCrpBvo7+rBvm3Alua8AmFtIQK90/Wjtb/WrL+aM6gvOB8 cWBptHB9pLcesFbU7Awxg2f+WAsFRLmKdfAsyHv4YRkAovOR8GewWT0mdcpGb9jBfqEt udRQ5A5y86+QO0/iI9kNsIPvIpVJK238WdCwL7zl7dp19s04Erekh2hhOXVybNoZ1MmB v0Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/n36fbd089nYyGejx0G/+oOxsm6BU1aYHoiAvJfuXb4=; b=h7QmQnVQGULETItZ5ovCd9zaErme3w2Rjod9XoUTmCzsBbS3L8xu/OusV3Z0zv/3p2 ha5zyZtXfBPHRfbzQz70c8SyL+BZFvN3u5qq6yNsnrEyyxv1XvnwpEXjwqZBPPVWo3EG Mga1KFKWH8FjJkyQMnQ/mIpIAlq0f+B6ZVBgaG1Y+F0aL6QqxbxHWzcaZFGAODEsrEHQ JzP5JQELaw/aBhRd6T6MVPX3sM5A7oqjWwYfTvVWL0ELyBsblQdUtJPfGKZTDM5oXdJZ FAvlF+bARZRMANN79Rx2PHf96bCMP+3+yCmJqmhCQhda7Z4+Vk9zI04YdX6Q2WMJcs0F PXtQ== X-Gm-Message-State: AMke39kfIKlCbNGSpPheImEBC8WGgkC/eQdSCqNQagMN3NebNkpAwPPfM6skzXcf2xOqFw== X-Received: by 10.55.190.129 with SMTP id o123mr32343939qkf.110.1487103152282; Tue, 14 Feb 2017 12:12:32 -0800 (PST) Received: from dhcp-1-235.brq.redhat.com (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id w138sm939945qka.27.2017.02.14.12.12.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Feb 2017 12:12:31 -0800 (PST) From: Ilya Dryomov To: ceph-devel@vger.kernel.org Cc: Alex Elder Subject: [PATCH 03/15] rbd: initialize rbd_dev->header_oloc early Date: Tue, 14 Feb 2017 21:11:52 +0100 Message-Id: <1487103124-2974-4-git-send-email-idryomov@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1487103124-2974-1-git-send-email-idryomov@gmail.com> References: <1487103124-2974-1-git-send-email-idryomov@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP No reason to delay it until image_id is known. This will be required by some rbd_obj_method_sync() callers, after rbd_obj_method_sync() is changed to take oloc. Signed-off-by: Ilya Dryomov --- drivers/block/rbd.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index a6ad714c85ac..24e8116d3431 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -4863,7 +4863,7 @@ static struct rbd_device *__rbd_dev_create(struct rbd_client *rbdc, init_rwsem(&rbd_dev->header_rwsem); ceph_oid_init(&rbd_dev->header_oid); - ceph_oloc_init(&rbd_dev->header_oloc); + rbd_dev->header_oloc.pool = spec->pool_id; mutex_init(&rbd_dev->watch_mutex); rbd_dev->watch_state = RBD_WATCH_STATE_UNREGISTERED; @@ -6062,8 +6062,6 @@ static int rbd_dev_header_name(struct rbd_device *rbd_dev) /* Record the header object name for this rbd image. */ rbd_assert(rbd_image_format_valid(rbd_dev->image_format)); - - rbd_dev->header_oloc.pool = rbd_dev->layout.pool_id; if (rbd_dev->image_format == 1) ret = ceph_oid_aprintf(&rbd_dev->header_oid, GFP_KERNEL, "%s%s", spec->image_name, RBD_SUFFIX);