From patchwork Thu Jul 26 18:57:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1244151 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id DDC383FC5A for ; Thu, 26 Jul 2012 18:57:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752443Ab2GZS50 (ORCPT ); Thu, 26 Jul 2012 14:57:26 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:53985 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752426Ab2GZS5Z (ORCPT ); Thu, 26 Jul 2012 14:57:25 -0400 Received: by ghrr11 with SMTP id r11so2351940ghr.19 for ; Thu, 26 Jul 2012 11:57:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=rlSUUEmHZp1C53fa8lfZTausdbSVBuQayPmdocLfhWo=; b=Af4f4grCkUFkAiwQBAcqeTrKOglaG+s+Lo8roGqa1Hzqs1QtLoN6mDa3fwsxpbO+Lp BAAcwprlSYZEqUcfhC5MHkg9lQQoM/lYoXrEaGqJ3Ql5HDQdQXk9CjukpMvdjO50Qgcn B35N8ml2XWqHvD/tdbVPQo+6wYqJptErhGGKnD0ARii6mBFwY+Z/ha8GcWROdlp7W0K/ DopTGeYNc+hlY2tWse4MQlofA5cbK5eaEEQjxS0ASzYsrPPrWqrtZbHB0SULql3bNzTR 3ISu5JkCqmT3ZDDlC++fhSHGHYoxLT/JXbcLreNNYWtu9qIMrvWsubHLTNffWnY+//g8 qZ4Q== Received: by 10.236.138.138 with SMTP id a10mr15241076yhj.39.1343329044838; Thu, 26 Jul 2012 11:57:24 -0700 (PDT) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id d9sm13671ank.4.2012.07.26.11.57.24 (version=SSLv3 cipher=OTHER); Thu, 26 Jul 2012 11:57:24 -0700 (PDT) Message-ID: <50119313.1010508@inktank.com> Date: Thu, 26 Jul 2012 13:57:23 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH 2/7] rbd: drop rbd_header_from_disk() gfp_flags parameter References: <50119076.1030307@inktank.com> In-Reply-To: <50119076.1030307@inktank.com> X-Gm-Message-State: ALoCoQke9X0fNJCXUH9B3bze/3kxxi25fjzV1ap3xLj3IASfJLsMLGz4zEZxwZy39DtNXUmRL7Nn Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org The function rbd_header_from_disk() is only called in one spot, and it passes GFP_KERNEL as its value for the gfp_flags parameter. Just drop that parameter and substitute GFP_KERNEL everywhere within that function it had been used. (If we find we need the parameter again in the future it's easy enough to add back again.) Signed-off-by: Alex Elder --- drivers/block/rbd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) @@ -507,18 +506,18 @@ static int rbd_header_from_disk(struct rbd_image_header *header, return -EINVAL; header->snapc = kmalloc(sizeof(struct ceph_snap_context) + snap_count * sizeof(u64), - gfp_flags); + GFP_KERNEL); if (!header->snapc) return -ENOMEM; header->snap_names_len = le64_to_cpu(ondisk->snap_names_len); if (snap_count) { header->snap_names = kmalloc(header->snap_names_len, - gfp_flags); + GFP_KERNEL); if (!header->snap_names) goto err_snapc; header->snap_sizes = kmalloc(snap_count * sizeof(u64), - gfp_flags); + GFP_KERNEL); if (!header->snap_sizes) goto err_names; } else { @@ -527,7 +526,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header, } header->object_prefix = kmalloc(sizeof (ondisk->block_name) + 1, - gfp_flags); + GFP_KERNEL); if (!header->object_prefix) goto err_sizes; @@ -1621,7 +1620,7 @@ static int rbd_read_header(struct rbd_device *rbd_dev, if (rc < 0) goto out_dh; - rc = rbd_header_from_disk(header, dh, snap_count, GFP_KERNEL); + rc = rbd_header_from_disk(header, dh, snap_count); if (rc < 0) { if (rc == -ENXIO) pr_warning("unrecognized header format" diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 64d3dbd..597ebaa 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -493,8 +493,7 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk) */ static int rbd_header_from_disk(struct rbd_image_header *header, struct rbd_image_header_ondisk *ondisk, - u32 allocated_snaps, - gfp_t gfp_flags) + u32 allocated_snaps) { u32 i, snap_count;