From patchwork Wed Apr 6 23:02:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 12804180 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBF31C4332F for ; Wed, 6 Apr 2022 23:03:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DB2536B0073; Wed, 6 Apr 2022 19:03:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D60FB6B0074; Wed, 6 Apr 2022 19:03:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C022F6B0075; Wed, 6 Apr 2022 19:03:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id B2CA06B0073 for ; Wed, 6 Apr 2022 19:03:12 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 8840360AF0 for ; Wed, 6 Apr 2022 23:03:02 +0000 (UTC) X-FDA: 79327981404.17.E7D8A4F Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf23.hostedemail.com (Postfix) with ESMTP id F0287140002 for ; Wed, 6 Apr 2022 23:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649286181; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TVUTDEn4ajQnJg0xbfI7sdT5Px6RGo8oRV8kyeHSPWk=; b=aEX+ukw0/od0NU0JlLOMYyNK8v8/OfRD7UMa+4AjsEj2FpqqQcxor0Ry3SevIJOhHjkIbc TjwS/jtQB33aRsdGGdXXjDZREuHrqqUUXE2ZTbDnERtnCf5gMKMIRODXtpZ0kkO60Kkuys xGGIZvkdhg3n4KFSCoC/FFIt5lRTI0I= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-554-kFMLqPKjMCOt5JMsgkA9fg-1; Wed, 06 Apr 2022 19:02:58 -0400 X-MC-Unique: kFMLqPKjMCOt5JMsgkA9fg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DAA103C00135; Wed, 6 Apr 2022 23:02:41 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EFCC2024CBB; Wed, 6 Apr 2022 23:02:31 +0000 (UTC) Subject: [PATCH 00/14] cifs: Iterators, netfslib and folios From: David Howells To: linux-cachefs@redhat.com Cc: Matthew Wilcox , linux-cifs@vger.kernel.org, Shyam Prasad N , Steve French , Rohith Surabattula , dhowells@redhat.com, Steve French , Shyam Prasad N , Rohith Surabattula , Jeff Layton , linux-cifs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Date: Thu, 07 Apr 2022 00:02:30 +0100 Message-ID: <164928615045.457102.10607899252434268982.stgit@warthog.procyon.org.uk> User-Agent: StGit/1.4 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: F0287140002 X-Stat-Signature: eenn8qw5fuokszbxpeqdo74a9nhhnrkd X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=aEX+ukw0; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf23.hostedemail.com: domain of dhowells@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=dhowells@redhat.com X-HE-Tag: 1649286181-662031 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Here's a set of patches to make the following changes to the cifs filesystem driver: (1) Convert cifs to use I/O iterators to pass data/buffers from the the VM interface layer down to the socket rather than passing page lists about. (2) Convert cifs to use netfslib for buffered and direct read operations. (3) A partial conversion to folios. This branch is built on top of my netfs-lib branch[1]. The patches can be found here also: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=cifs-experimental David Link: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git/log/?h=netfs-lib [1] --- David Howells (14): cifs: Add some helper functions cifs: Add a function to read into an iter from a socket cifs: Check the IOCB_DIRECT flag, not O_DIRECT cifs: Change the I/O paths to use an iterator rather than a page list cifs: Remove unused code cifs: Use netfslib to handle reads cifs: Share server EOF pos with netfslib netfs: Allow the netfs to make the io (sub)request alloc larger cifs: Put credits into cifs_io_subrequest, not on the stack cifs: Hold the open file on netfs_io_request, not netfs_io_subrequest cifs: Clamp length according to credits and rsize cifs: Expose netfs subrequest debug ID and index in read tracepoints cifs: Split the smb3_add_credits tracepoint mm, netfs, fscache: Stop read optimisation when folio removed from pagecache fs/afs/file.c | 1 + fs/afs/inode.c | 1 + fs/afs/internal.h | 2 + fs/cifs/Kconfig | 1 + fs/cifs/cifsencrypt.c | 40 +- fs/cifs/cifsfs.c | 11 +- fs/cifs/cifsfs.h | 6 +- fs/cifs/cifsglob.h | 53 +- fs/cifs/cifsproto.h | 13 +- fs/cifs/cifssmb.c | 252 +++-- fs/cifs/connect.c | 18 +- fs/cifs/file.c | 2096 ++++++++++----------------------------- fs/cifs/fscache.c | 120 +-- fs/cifs/fscache.h | 70 -- fs/cifs/inode.c | 22 +- fs/cifs/misc.c | 109 -- fs/cifs/smb2ops.c | 387 ++++---- fs/cifs/smb2pdu.c | 85 +- fs/cifs/smb2proto.h | 2 +- fs/cifs/trace.h | 151 ++- fs/cifs/transport.c | 41 +- fs/netfs/internal.h | 1 + fs/netfs/io.c | 7 +- fs/netfs/misc.c | 13 +- fs/netfs/stats.c | 9 +- include/linux/fs.h | 2 + include/linux/netfs.h | 1 + include/linux/pagemap.h | 1 + mm/filemap.c | 15 + 29 files changed, 1203 insertions(+), 2327 deletions(-)