From patchwork Thu Jul 19 21:08:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 1218571 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 A2A133FD48 for ; Thu, 19 Jul 2012 21:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751748Ab2GSVIm (ORCPT ); Thu, 19 Jul 2012 17:08:42 -0400 Received: from mail-gh0-f174.google.com ([209.85.160.174]:54224 "EHLO mail-gh0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714Ab2GSVIm (ORCPT ); Thu, 19 Jul 2012 17:08:42 -0400 Received: by mail-gh0-f174.google.com with SMTP id r11so3302374ghr.19 for ; Thu, 19 Jul 2012 14:08:42 -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=XWT6ypaNw2nkoqE7PC93E2DFZQb3RBJCy7yqAUMZQ/c=; b=cZzQyPASvuRDuLn2OBFXuOnMEZp24pnbm1LY0qwVfmsOLi8MuLi8Gmwavh8dB17N8I vcxJWBsFr3nnzUra3/uo8TWCILIt9fZcZWGQ4s1qxwhGI7MUESy9YhDgNReuo0OVGMl2 dqVS63YAw+33fTOBHRZBtV76x//nQ7jnFoHErJiE8w5E408nLGs1IJJiRDBVqeuE+8hq 2nZkc9ZzJjMFwx0+6z6hsNINNeTZS1jAMwN/KgzeRE0TLpRSrQEadZUVsKjuTMmcgBMb Ba07Hs6wdSebbDvS4Kxe5kZVWbiVyG/9ipmIyYt1pEZ7mI1SDIHEueHvZutt7126DnPc uxyA== Received: by 10.50.46.230 with SMTP id y6mr2734792igm.20.1342732121498; Thu, 19 Jul 2012 14:08:41 -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 uy3sm17811959igc.14.2012.07.19.14.08.40 (version=SSLv3 cipher=OTHER); Thu, 19 Jul 2012 14:08:41 -0700 (PDT) Message-ID: <50087758.6080302@inktank.com> Date: Thu, 19 Jul 2012 16:08:40 -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 06/12] rbd: drop rbd_header_from_disk() gfp_flags parameter References: <500874F5.4090205@inktank.com> In-Reply-To: <500874F5.4090205@inktank.com> X-Gm-Message-State: ALoCoQlq/uCz64qZ5CPNc6k/3z/xQuUvrjGSbqFldQZTH5wk+2VuUTxJpjYc4MjszYs61To0DQiK 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 files changed, 6 insertions(+), 7 deletions(-) } else { @@ -521,7 +520,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; @@ -1615,7 +1614,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 06e022d..3b4b4d2 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -487,8 +487,7 @@ static void rbd_coll_release(struct kref *kref) */ 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; @@ -501,18 +500,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;