Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1004745imm; Thu, 13 Sep 2018 11:03:45 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbkv4gj66dlFalkqFeeau4d3LI0392oxA+P2I9M8DGI0RquLrIsbVgX9szXq9nelRTJXGdh X-Received: by 2002:a63:ec43:: with SMTP id r3-v6mr1902366pgj.295.1536861825701; Thu, 13 Sep 2018 11:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536861825; cv=none; d=google.com; s=arc-20160816; b=d/LsaZo6ptsDVXenhsbi0V/p7NpyyZ5Vb1rQg0No7Ld4Avyb1OI/ONGMTsWkR4iGv5 iItx+L1iBdHO+YiShpeK20EYzDC+yKJjDMvEwpYEofmhGTw9BP2nzFdn5vEtOm5/oBsk kjDBQHR7WHAxSJXT3bd7QaiNvqRM8pEBo8XTYXHkuyyvQB0RnZF9xDu6JfLqNrZoOBIW 23N+zrVe2kqc5ohZ2gHq8lPrDVDrb4/cqT2TWS5w31DhfetDVTPq+Whf4Df+vJOmKMGc xap6vA4GlpG544hRggVz1uMpPOsNhR570a4/7MaZqQ3atz6qJNqeU+kTUvwvE/1nsEzb VV6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=kGan+nbowLUgsbog7XCbxAUAWMNrBSFHQ3wY2eG0Zsw=; b=UHlAjLRC2hc1zM+KPeNdKVTybX09ppnhRLYE7Tx6aAr5YWyFstwHBFKkJrpqIrsOm/ j1mDIrXMojm0gj/aueZDH1Gc4BVzKNArtBm2L17NmB/KN+nLsdJeu+Ah4+HHSNjims6G SCfrPyIOVhCCCrVnUpiwOp4uMU2mI1xuTCzw7ALRqpwDGL9TqvcWFE+M3NEpomvnJhZr 4tUnIvUWWlQhKkpx8Px2DDb/+//WtG3j6eHeTzCSMYr4T+IcdCjEED3YXW8lKrMRVjeG 0rkb7dgrBAGMGp4P+AlIb9N1AH0038Bb1lSleKQ7u+0OKDySqyj0/HAU/ZiYuQy/SbCF 9p9g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n190-v6si4689507pfn.358.2018.09.13.11.02.59; Thu, 13 Sep 2018 11:03:45 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbeIMXJU (ORCPT + 99 others); Thu, 13 Sep 2018 19:09:20 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:39522 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbeIMXJT (ORCPT ); Thu, 13 Sep 2018 19:09:19 -0400 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.87 #1 (Red Hat Linux)) id 1g0Vt7-0000LX-Cf; Thu, 13 Sep 2018 17:58:45 +0000 Date: Thu, 13 Sep 2018 18:58:45 +0100 From: Al Viro To: David Howells Cc: linux-fsdevel@vger.kernel.org, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 00/10] iov_iter: Add new iters and use with AFS Message-ID: <20180913175845.GS19965@ZenIV.linux.org.uk> References: <153685389564.14766.11306559824641824935.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <153685389564.14766.11306559824641824935.stgit@warthog.procyon.org.uk> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 13, 2018 at 04:51:35PM +0100, David Howells wrote: > > Hi Al, > > Here's a set of patches that adds two new iov_iter types and then makes AFS > use them to do I/O. The iov_iter changes are: > > (1) Separate the type from the direction in the iov_iter struct and > provide accessor functions to wrap type checking. > > (2) Renumber the type constants to be contiguous small unsigned integers, > starting from 0 and then use switch-statements rather than if-else > chains using bit-testing. > > Note that the compiler can optimise this better by using CMP rather > than AND/TEST, say, as comparing integers requires fewer CMP > instructions or can use jump tables. > > (3) Change iov_offset from size_t to loff_t. This allows iov_offset to be > then used as a byte offset with ITER_MAPPING and allows 4GiB and larger > reads and writes to be proposed. > > This makes no difference on a 64-bit system, but does make a 32-bit > compilation a bit larger. > > (4) Add an ITER_MAPPING iterator type. This provides an iterator that > directly accesses an address_space, and assumes that the target pages > are in some way locked (eg. PG_lock or PG_writeback). > > (5) Add an ITER_DISCARD iterator type. This provides an iterator that > simply discards anything written to it. It cannot be used as a data > source. Hmm... I'll take a look in about an hour (need to finish the sodding tty-ioctl stuff first), will post review then. Sorry, I remember seeing it posted several weeks ago, slipped through the cracks then ;-/