From patchwork Mon Jan 22 22:32:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Howells X-Patchwork-Id: 13526325 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 58F08C47E49 for ; Mon, 22 Jan 2024 22:32:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 95DCF8D0001; Mon, 22 Jan 2024 17:32:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8C5A26B0096; Mon, 22 Jan 2024 17:32:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 70D418D0001; Mon, 22 Jan 2024 17:32:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 562E36B0093 for ; Mon, 22 Jan 2024 17:32:49 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2E8331C1341 for ; Mon, 22 Jan 2024 22:32:49 +0000 (UTC) X-FDA: 81708398058.05.77C4C61 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf20.hostedemail.com (Postfix) with ESMTP id 96BA71C0011 for ; Mon, 22 Jan 2024 22:32:47 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e24iaAaU; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705962767; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=+7nRZBtb5KDB8wnGQb/hos72IWYUGI+6olZnmjBvpQE=; b=7UE1RG0nU60PZFWGygA/kU5Pv2jgCXscvOUJ4fhks10n9/EEraIa9jzTIwnhA6cTFCgmy2 PoCOYzjbq0umQXDKYrN6CCLUQX5QcAFsGK2flQ9e1lOcEd0ASpRvoJ38zh9IGNweJuRQE6 DkjKZw4u+XzrAsLzPdl59XNf0mEm4qc= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705962767; a=rsa-sha256; cv=none; b=t3qRfnpMWrCewM9zdFFZx+w49BmqtfffG9aExXJzM0hL/qQqvarQIyiN3ugLnYGXuJowzY sWVSTO4ccqQWgdCx50hWEkP4f4fqltKNL5KKk06vYBVeMCJlK/QIXOYyrVNnVEsKBUo/je 9+p6a9rwntjN7KU45b01Z3rtgqWe55Y= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=e24iaAaU; spf=pass (imf20.hostedemail.com: domain of dhowells@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=dhowells@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1705962766; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+7nRZBtb5KDB8wnGQb/hos72IWYUGI+6olZnmjBvpQE=; b=e24iaAaUZCMp8IWhqpDPG/pUrbwpEYRU/FQexLFG1xAaOLb/wlJWV5h33X/a2srdkjn5PU 4eGqBe1Un4IvPf+j88DhIKdrEdLY/YMpvgZSjhD/P5QgdzgPw0sBKqTEAIDjYtIGJsrPd9 9JoUla/NVPhRDPGz4wLjxCE6/u1hwS8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-212-Tq0oefjDMG-ND3l08DWx1w-1; Mon, 22 Jan 2024 17:32:43 -0500 X-MC-Unique: Tq0oefjDMG-ND3l08DWx1w-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 419341C04181; Mon, 22 Jan 2024 22:32:42 +0000 (UTC) Received: from warthog.procyon.org.com (unknown [10.42.28.67]) by smtp.corp.redhat.com (Postfix) with ESMTP id C03651121312; Mon, 22 Jan 2024 22:32:39 +0000 (UTC) From: David Howells To: Christian Brauner Cc: David Howells , Jeff Layton , Matthew Wilcox , netfs@lists.linux.dev, linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey Subject: [PATCH v2 03/10] cifs: Don't use certain unnecessary folio_*() functions Date: Mon, 22 Jan 2024 22:32:16 +0000 Message-ID: <20240122223230.4000595-4-dhowells@redhat.com> In-Reply-To: <20240122223230.4000595-1-dhowells@redhat.com> References: <20240122223230.4000595-1-dhowells@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Stat-Signature: peqsmnpsb6ygk917s8d45u19wbaks46b X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 96BA71C0011 X-Rspam-User: X-HE-Tag: 1705962767-710115 X-HE-Meta: U2FsdGVkX18RAZ9xXsZ9dkc4JdEF6abItFKABimbS8ftB/Sq/BCWuusG4XlMhVw+CuNH4z7lyoQ9Vl+q2VkDdye1iR4kmPthL1QpH6r/NdZZzw91bYueNPcmdqeLOFaGbcozxO0jfex4c4KEhrvWKguumTac+P5EgFgjj7Xj8ES4c8sKWO7PnrCQlftmWEsAWV29i3fs2bYgebIc9DXi233rzS2wacLBqifb9v05/jRTJeUti2NV2/+4Hb6cThYH4AWrCoR0jOCOmUkjoSIVp7JwDIjnAgLOHfsvTiL56NR4RxpAXpoqtU5NMi8wqkwrm+eGlmj+fFS/C05CtHU9Y0T1VehhLaEv4AGlQVibsFGDT88HK6EX7w0RwW0ilhXeovRED5AsYAheAjMrsfPxLiVV5gVhruVmbfcandtEYYJtJHB9xmY11A+UcezWz9qLHcpz3h8hQLTI8APg+Ij7A2cQJkfGPqnky7oUE3jK3RRaGZqFxMvJ4arUJJMRKSUaTKGY6ZsY+C7AZYkU06GSviVeAcPSGPAss/OwREs6nDMYXBj5JlQFjj+oI5hWo4SPVVCxXH49FK1mQ0UaWKduZGmo9qKYuLaLIo+dyk3YrPPqmsAxmodQ10AG7juyiCW2OT5Fb0uavbuZC3U/51lYBBpyQsMy269vesEltE+furotp1LOAWa15BCCUL0SCI2TpVw90zqCvMrv+epJ+On7kHtzmhmhz0r1+rEzT0o4U+z7ipkITh7fIsbaY42uiGWOpcH7oRCrmPFNsAdbZNdXbWx/HouZUy9IATCVCf9ZauehQJp1iWWhFf/7xcmDcnB2uIrMKVUZQS73+dr7foPSfnhQs14bfFATmD2Prlzm4lXMETc8n37jZEySSY6adh/JWvRyFaAFaAxLLIcZZO57S3mikTyj/ww7sQyJ3IXXy66U4pEfNqbu9FaWhtS0wj1j 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: List-Subscribe: List-Unsubscribe: Filesystems should use folio->index and folio->mapping, instead of folio_index(folio), folio_mapping() and folio_file_mapping() since they know that it's in the pagecache. Change this automagically with: perl -p -i -e 's/folio_mapping[(]([^)]*)[)]/\1->mapping/g' fs/smb/client/*.c perl -p -i -e 's/folio_file_mapping[(]([^)]*)[)]/\1->mapping/g' fs/smb/client/*.c perl -p -i -e 's/folio_index[(]([^)]*)[)]/\1->index/g' fs/smb/client/*.c Reported-by: Matthew Wilcox Signed-off-by: David Howells cc: Jeff Layton cc: Steve French cc: Paulo Alcantara cc: Ronnie Sahlberg cc: Shyam Prasad N cc: Tom Talpey cc: linux-cifs@vger.kernel.org cc: linux-fsdevel@vger.kernel.org --- fs/smb/client/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c index 3a213432775b..90da81d0372a 100644 --- a/fs/smb/client/file.c +++ b/fs/smb/client/file.c @@ -87,7 +87,7 @@ void cifs_pages_written_back(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -120,7 +120,7 @@ void cifs_pages_write_failed(struct inode *inode, loff_t start, unsigned int len continue; if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -151,7 +151,7 @@ void cifs_pages_write_redirty(struct inode *inode, loff_t start, unsigned int le xas_for_each(&xas, folio, end) { if (!folio_test_writeback(folio)) { WARN_ONCE(1, "bad %x @%llx page %lx %lx\n", - len, start, folio_index(folio), end); + len, start, folio->index, end); continue; } @@ -2651,7 +2651,7 @@ static void cifs_extend_writeback(struct address_space *mapping, continue; if (xa_is_value(folio)) break; - if (folio_index(folio) != index) + if (folio->index != index) break; if (!folio_try_get_rcu(folio)) { xas_reset(&xas); @@ -2899,7 +2899,7 @@ static int cifs_writepages_region(struct address_space *mapping, goto skip_write; } - if (folio_mapping(folio) != mapping || + if (folio->mapping != mapping || !folio_test_dirty(folio)) { start += folio_size(folio); folio_unlock(folio);