From patchwork Thu Apr 11 19:58:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2430321 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 447603FDC4 for ; Thu, 11 Apr 2013 19:59:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754373Ab3DKT61 (ORCPT ); Thu, 11 Apr 2013 15:58:27 -0400 Received: from mail-ie0-f175.google.com ([209.85.223.175]:56391 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754624Ab3DKT60 (ORCPT ); Thu, 11 Apr 2013 15:58:26 -0400 Received: by mail-ie0-f175.google.com with SMTP id c12so2560019ieb.34 for ; Thu, 11 Apr 2013 12:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=PwrP4swC/R3MAb/Krj1X8vbxWXk8uej97fOEWjMeX3w=; b=TGu4W7lUAXkTF7mYvfVbTYdIYFH3aSK4dK7uvRuKfJe2evdLyDRAVSXkUOMwlH1+KK O4zoHQj8ASBRoMzw+aUJm+1f5cvWklH4zVH98eOTiPz590o8SVf3a1XkYjqVMRvNynl8 pG5z2pHEYEmJNLvguaEi1chOps4wvuqgPTNWLQN5uyjkcb6SdgrgYn9AnfrqJtuBkGYl CrFaf97ek+o/EA2NVnrmyr2aQ8v62Ggw//9Nj575RSU5jNh3ds+izLAdaFAv0C1QvWI1 Xt7fZHgaLi/64lsg97bdz0E7reL+IxwEGAN1tgqksjI/5ydNeyg4nzEnULSllpCqa/lU 5SXg== X-Received: by 10.50.195.231 with SMTP id ih7mr5619249igc.55.1365710305907; Thu, 11 Apr 2013 12:58:25 -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 wn10sm3892854igb.2.2013.04.11.12.58.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Apr 2013 12:58:25 -0700 (PDT) Message-ID: <516715E1.5090708@inktank.com> Date: Thu, 11 Apr 2013 14:58:25 -0500 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH] rbd: update feature bits X-Gm-Message-State: ALoCoQn6sdePcTYituFtLT214l34DLNtPUos9WGEgFwszL23TfJU3Jqcln5OC8M0VHSLKx5UwD1X Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org There is a new rbd feature bit defined for "fancy striping." Add it to the ones defined in the kernel client. Change RBD_FEATURES_ALL so it represents the set of all feature bits (rather than just the ones we support). Define a new symbol RBD_FEATURES_SUPPORTED to indicate the supported ones. Signed-off-by: Alex Elder Reviewed-by: Josh Durgin --- drivers/block/rbd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) *snap_features = le64_to_cpu(features_buf.features); diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 11b7987..503e64f 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -73,11 +73,14 @@ /* Feature bits */ -#define RBD_FEATURE_LAYERING 1 +#define RBD_FEATURE_LAYERING (1<<0) +#define RBD_FEATURE_STRIPINGV2 (1<<1) +#define RBD_FEATURES_ALL \ + (RBD_FEATURE_LAYERING | RBD_FEATURE_STRIPINGV2) /* Features supported by this (client software) implementation. */ -#define RBD_FEATURES_ALL (0) +#define RBD_FEATURES_SUPPORTED (0) /* * An RBD device name will be "rbd#", where the "rbd" comes from @@ -2843,7 +2846,7 @@ static int _rbd_dev_v2_snap_features(struct rbd_device *rbd_dev, u64 snap_id, return ret; incompat = le64_to_cpu(features_buf.incompat); - if (incompat & ~RBD_FEATURES_ALL) + if (incompat & ~RBD_FEATURES_SUPPORTED) return -ENXIO;