Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754083AbdDNPfA (ORCPT ); Fri, 14 Apr 2017 11:35:00 -0400 Received: from ale.deltatee.com ([207.54.116.67]:40802 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751677AbdDNPex (ORCPT ); Fri, 14 Apr 2017 11:34:53 -0400 To: Christoph Hellwig References: <1492121135-4437-1-git-send-email-logang@deltatee.com> <1492121135-4437-2-git-send-email-logang@deltatee.com> <20170414083518.GA25471@lst.de> Cc: "Martin K. Petersen" , Sagi Grimberg , Jens Axboe , Tejun Heo , Greg Kroah-Hartman , Dan Williams , Ross Zwisler , Matthew Wilcox , Sumit Semwal , Ming Lin , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, intel-gfx@lists.freedesktop.org, linux-raid@vger.kernel.org, linux-mmc@vger.kernel.org, linux-nvme@lists.infradead.org, linux-nvdimm@ml01.01.org, linux-scsi@vger.kernel.org, fcoe-devel@open-fcoe.org, open-iscsi@googlegroups.com, megaraidlinux.pdl@broadcom.com, sparmaintainer@unisys.com, devel@driverdev.osuosl.org, target-devel@vger.kernel.org, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, Steve Wise , Stephen Bates From: Logan Gunthorpe Message-ID: <18f05078-5b2c-2e9b-c8ad-e23c02942b58@deltatee.com> Date: Fri, 14 Apr 2017 09:34:28 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <20170414083518.GA25471@lst.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 50.66.97.235 X-SA-Exim-Rcpt-To: sbates@raithlin.com, swise@opengridcomputing.com, rds-devel@oss.oracle.com, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, target-devel@vger.kernel.org, devel@driverdev.osuosl.org, sparmaintainer@unisys.com, megaraidlinux.pdl@broadcom.com, open-iscsi@googlegroups.com, fcoe-devel@open-fcoe.org, linux-scsi@vger.kernel.org, linux-nvdimm@lists.01.org, linux-nvme@lists.infradead.org, linux-mmc@vger.kernel.org, linux-raid@vger.kernel.org, intel-gfx@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, ming.l@ssi.samsung.com, sumit.semwal@linaro.org, mawilcox@microsoft.com, ross.zwisler@linux.intel.com, dan.j.williams@intel.com, gregkh@linuxfoundation.org, tj@kernel.org, axboe@kernel.dk, sagi@grimberg.me, martin.petersen@oracle.com, hch@lst.de X-SA-Exim-Mail-From: logang@deltatee.com Subject: Re: [PATCH 01/22] scatterlist: Introduce sg_map helper functions X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1164 Lines: 35 On 14/04/17 02:35 AM, Christoph Hellwig wrote: >> + >> static inline int is_dma_buf_file(struct file *); >> >> struct dma_buf_list { > > I think the right fix here is to rename the operation to unmap_atomic > and send out a little patch for that ASAP. Ok, I can do that next week. > I'd rather have separate functions for kmap vs kmap_atomic instead of > the flags parameter. And while you're at it just always pass the 0 > offset parameter instead of adding a wrapper.. > > Otherwise this looks good to me. I settled on the flags because I thought the interface could be expanded to do more things like automatically copy iomem to a bounce buffer (with a flag). It'd also be possible to add things like vmap and physical_address to the interface which would cover even more sg_page users. All the implementations would then share the common offset calculations, and switching between them becomes a matter of changing a couple flags. If you're still not convinced by the above arguments then I'll change it but I did have reasons for choosing to do it this way. I am fine with removing the offset versions. I will make that change. Thanks, Logan