From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90264C4CECD for ; Mon, 16 Sep 2019 17:25:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 711D121852 for ; Mon, 16 Sep 2019 17:25:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729523AbfIPRZQ (ORCPT ); Mon, 16 Sep 2019 13:25:16 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:41225 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727987AbfIPRZQ (ORCPT ); Mon, 16 Sep 2019 13:25:16 -0400 Received: by mail-pg1-f196.google.com with SMTP id x15so371409pgg.8; Mon, 16 Sep 2019 10:25:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zsVhWs+rZSQ9pmPp93CkIV3JOWjcR8BN6wXm6TfggU4=; b=ggpj5aZB0HsJ6jCKeDm+N/L3I0GQOmS9TWQj6HZZpI/NyM3i7TV+KcvffJIVnPSqK3 nvFsw9IN7SUBW2PKC/uyDT29dpWUqt/lLjSHBI6j073cZbwBxN7GAZCxkVmpQVWAmuTD aXtIgJbHXFnBEKrbtD7awjANd5gphLNszCEcqtF1iLzm+j72X5VAiiAM0VGYtJHeUYjN +JOG4c8p+VIziZFT4h4GWmJ95+AXEu7J0+kjLADrzgGk0Twjj2ONGULSGr5edcAAKRZA r2Lqtmx1XMSuDxJrj/UGBjToxCkzvIFn3BaKTBD56Xg0XF2kKImyO+Rd6BD6385OaODW WRQA== X-Gm-Message-State: APjAAAUPzDf+1uH6SxBfvBRUidi8pkhs67PRoYcnZUziQ38i6EUBgkGU /1hFFSIAyM9KdjWQhkQk96s= X-Google-Smtp-Source: APXvYqxT2OZ8W+ffke5agKcEDwOXkz6O6frQr2306GKIMGIjlZ5J2dLWhPTweusEJaFXPupFvDr7kQ== X-Received: by 2002:aa7:8189:: with SMTP id g9mr440437pfi.78.1568654715966; Mon, 16 Sep 2019 10:25:15 -0700 (PDT) Received: from desktop-bart.svl.corp.google.com ([2620:15c:2cd:202:4308:52a3:24b6:2c60]) by smtp.gmail.com with ESMTPSA id f188sm52105937pfa.170.2019.09.16.10.25.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Sep 2019 10:25:14 -0700 (PDT) Subject: Re: [PATCH v4 15/25] ibnbd: private headers with IBNBD protocol structs and helpers To: Jinpu Wang Cc: Jack Wang , linux-block@vger.kernel.org, linux-rdma@vger.kernel.org, Jens Axboe , Christoph Hellwig , Sagi Grimberg , Jason Gunthorpe , Doug Ledford , Danil Kipnis , rpenyaev@suse.de, Roman Pen References: <20190620150337.7847-1-jinpuwang@gmail.com> <20190620150337.7847-16-jinpuwang@gmail.com> <4fbad80b-f551-131e-9a5c-a24f1fa98fea@acm.org> From: Bart Van Assche Message-ID: Date: Mon, 16 Sep 2019 10:25:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On 9/16/19 7:57 AM, Jinpu Wang wrote: >>>> +#define _IBNBD_FILEIO 0 >>>> +#define _IBNBD_BLOCKIO 1 >>>> +#define _IBNBD_AUTOIO 2 >>>> >>>> +enum ibnbd_io_mode { >>>> + IBNBD_FILEIO = _IBNBD_FILEIO, >>>> + IBNBD_BLOCKIO = _IBNBD_BLOCKIO, >>>> + IBNBD_AUTOIO = _IBNBD_AUTOIO, >>>> +}; >>> >>> Since the IBNBD_* and _IBNBD_* constants have the same numerical value, >>> are the former constants really necessary? >> >> Seems we can remove _IBNBD_*. > > Sorry, checked again, we defined _IBNBD_* constants to show the right > value for def_io_mode description. > If we remove the _IBNBD_*, then the modinfo shows: > def_io_mode:By default, export devices in blockio(IBNBD_BLOCKIO) or > fileio(IBNBD_FILEIO) mode. (default: IBNBD_BLOCKIO (blockio)) > instead of: > parm: def_io_mode:By default, export devices in blockio(1) > or fileio(0) mode. (default: 1 (blockio)) So the user is required to enter def_io_mode as a number? Wouldn't it be more friendly towards users to change that parameter from a number into a string? Thanks, Bart.