Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4393525yba; Mon, 29 Apr 2019 19:53:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvv+yWLe4UMZK3nCOKzK48PS81a6bQ1G6Cj6qckXNedj/Eo+Z/k8AGjEfIEb2xzD9UEGcn X-Received: by 2002:a65:64da:: with SMTP id t26mr27143165pgv.322.1556592806658; Mon, 29 Apr 2019 19:53:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556592806; cv=none; d=google.com; s=arc-20160816; b=SKJFeGgjNZ4GLf2FwJmusbjNsoMNkgc1oeRn2u7m8EjiKA0bZOXH0QeBOCUYUuIhI6 h5lLHHk/S/2jsRtpPFQH1GIqOE0bLpkd3hobuIHj5PGBjqjpnIiuJ9//sJ8cWBOaMgSh nfufJFCrM/UHQnyZHIeDcKbk6fjz+vHKOge8l1JRD0uGYFn4y6uhwb0PKjCskAdfVlOy oSbmGLmbV8e3XL+n268OwdikzA6y53j5lzqtXI07pSIM9CxV4PPIDUnxlvYLyprDABAE SIqEY6EbYlwPsg//4eo42t+LJxThJTxVv/ZIFI7TApxBTSX42KII1clHCB+4yWj/Yg1k pvuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=EtJQIydI4TPLP0rJodfKGeaDXbBiYSZ0YPs/KP7B6wE=; b=DXDWaOR2L1OvJ8JYTCVsNpyMdSAa2/4/RYOr9I7sECGPN3EfM496s1MCPQyoqyZFGJ Wpr15Wfh3aq/0E6OKD2UrqlQVe187JeOCo0N4sQBJfv5nnpPWj/G2NI+mfDczdDRV77g O+I6hqjkZQNu+3N0c68Wfh/l0LowxpeMsRGlXm8I73atC3QhLWYeKS6p1FHe1/SjqJLl Y/IOdVTO768VfHFJU4jGikMEvcpLwiRKxJKe+PBxHfdJ5mfcbqS8CiAv6vKQ8rtj59fI kiknFjiog453VZsZsQ79yCbmLSEE62UfheloRRItF4qTyoWuKuqipIY2ZomuqfbzQHsW E7dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="O+Mxzef/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si11501158plo.11.2019.04.29.19.53.11; Mon, 29 Apr 2019 19:53:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="O+Mxzef/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729952AbfD3CvB (ORCPT + 99 others); Mon, 29 Apr 2019 22:51:01 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:49744 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729803AbfD3CvB (ORCPT ); Mon, 29 Apr 2019 22:51:01 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3U2iHwO091128; Tue, 30 Apr 2019 02:50:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=EtJQIydI4TPLP0rJodfKGeaDXbBiYSZ0YPs/KP7B6wE=; b=O+Mxzef/Mq3fzVGDLZPxBN4tKPZ+hw1xsnJJLTZBkEKlD6BgRt2SO1B5Ot4I/cj8fT6j pgHvUaDqCKr6Doi57X03uFaqepjL3DD/iQeFV5Z64FGUfDZpSkbAvzUACAjbYflBDRhH De1XwamOr4NSIpsAGBTZ3gzWtWhMyIjbU6Qy5v/NFQ94sfsZHIT/HBThu7c9lKeU5iVr 0eU6Hd6NJrHgQ0xfgeYvr/XGwdAXpB7Y2aHKNpU+FhGaUq+ijB6po4Zh/OaT3uAHLseZ 3OVEVgVLYfD7Bxk9CutbI4Hv9eKYbtzWpELLT5QSsNeuIzCAfS+/4XIL5U8gcHgAUmxm 4g== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2s5j5txg6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2019 02:50:41 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x3U2mxaf080729; Tue, 30 Apr 2019 02:50:41 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2s5u50qu10-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Apr 2019 02:50:41 +0000 Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x3U2oav9019485; Tue, 30 Apr 2019 02:50:39 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Apr 2019 19:50:36 -0700 To: Marcos Paulo de Souza Cc: linux-block@vger.kernel.org, Jens Axboe , Hannes Reinecke , Omar Sandoval , Ming Lei , Damien Le Moal , Bart Van Assche , Greg Edwards , linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH 1/2] blkdev.h: Introduce size_to_sectors hlper function From: "Martin K. Petersen" Organization: Oracle Corporation References: <20190430013205.1561708-1-marcos.souza.org@gmail.com> <20190430013205.1561708-2-marcos.souza.org@gmail.com> Date: Mon, 29 Apr 2019 22:50:32 -0400 In-Reply-To: <20190430013205.1561708-2-marcos.souza.org@gmail.com> (Marcos Paulo de Souza's message of "Mon, 29 Apr 2019 22:32:04 -0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9242 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=578 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904300017 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9242 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=610 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904300017 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marco, > +static inline sector_t size_to_sectors(long long size) > +{ > + return size >> SECTOR_SHIFT; > +} > + FWIW, in SCSI we have: logical_to_sectors() logical_to_bytes() bytes_to_logical() sectors_to_logical() I'm not attached to "bytes" in any way but it would be nice to be consistent. -- Martin K. Petersen Oracle Linux Engineering