From patchwork Tue Apr 23 17:03:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13640388 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 BFACBC4345F for ; Tue, 23 Apr 2024 17:04:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4F9246B0142; Tue, 23 Apr 2024 13:04:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4809D6B0143; Tue, 23 Apr 2024 13:04:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 321F86B0144; Tue, 23 Apr 2024 13:04:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 148086B0142 for ; Tue, 23 Apr 2024 13:04:03 -0400 (EDT) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 9D806A0125 for ; Tue, 23 Apr 2024 17:04:02 +0000 (UTC) X-FDA: 82041419124.12.1BDE763 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf19.hostedemail.com (Postfix) with ESMTP id 4839B1A0016 for ; Tue, 23 Apr 2024 17:03:57 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fAl977Ry; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1713891837; h=from:from:sender:reply-to: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=BixicrujN2w/NN7W8Yk1bOtYDD16jf87ysiCrI+mjZw=; b=vEqow1L7KAD3v4h7SOsH6lC6FoCekqIPB5i+xlxFstSzjKd5vfeYDjMOndXzrIG96Vd32H a6UpTjGPeNjTX/lPRLfrOzA223Gpb+n9V+k5gRQMcPsCUWf0gNxPUtZ57nvNOXiF0ToVSF Yhhi/MCNM6+2/NVFUEBZVISh9uTMdjs= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fAl977Ry; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf19.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713891837; a=rsa-sha256; cv=none; b=OtDKc+LQTHq/qadaTCh0GD9BaOXNtWmiudQRfHGmFHL85EzxiYfC4Q0T3AjEU6Pj4ClZF8 Uth7qbNb0Om+MSjelbnekQK73JV7EYikbsk8qVOA6PtlEW1+4H5CeWlbp0NlxE6h/uqdFp U+L07dWNmtCXvyyiQb4mVX/WSEhBrfE= Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2a526803fccso3868762a91.1 for ; Tue, 23 Apr 2024 10:03:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713891836; x=1714496636; darn=kvack.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=BixicrujN2w/NN7W8Yk1bOtYDD16jf87ysiCrI+mjZw=; b=fAl977Ry6bphYRyw8xToHIyLh19iYDIaiDvBKR2oKPj6QbxeqpEFlUpToi85vBUon8 l5YJ6EdgR24tfP0O5iEMX0eAWEhYOGglWzQ/SS/K2W8ulN42ic1WzizcBA+4UAsDydrM gpRAJk8v+iuMm/ZJoXdxchoBkaJznoq14u9P9STUX5XMa+HbxO07ePWDDnYHm1Bo9CL4 wOBpoa42bsxFp+ydVd05mFULx7RpbLabCAfIm2jL9H73nIAWWyeMmhpTcO3Fww6/zFz7 uHAVcXTE4w8EbaplEtlNS1IwgRIrXsUSTW5BaYszuF/bkrDW6PCfOQBaOPJL7f0uml6q AN/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713891836; x=1714496636; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BixicrujN2w/NN7W8Yk1bOtYDD16jf87ysiCrI+mjZw=; b=iFYm9ZP9fYxuxOjIDx6X4SfldsY+BE8V562EFrkkYSwxKybdQdEmm8lgd25P+sYpSb SAZzKMBZiFEibg3+xUXRb6wDKnizB8RG5f5bahd2n2mSZqu4kSzn0hzKGtEiLMveRbvj S5szdGFD+VmGx0EPk/YyN6xLAPFjEx5ApRdJ4D0R/Zg69t2h5qgAy4MBaMc1Ls2WS1Lk wPphpeoxQg78FmbtnkAOSoAkNuLOH4JcN65B211Wpj5DKZHx3IpTrJIYkdqkiaOr521Q RwrjDL3l0nm4CKxxUoYof6B9lUpgYvpZGuudleAYvYUTYGxkgNfQ458T5J9EAkdF16Q3 cNAA== X-Gm-Message-State: AOJu0YyhKhaxLeDX/cQPTDUsFlaGucM7fIFKfpwP75He+6cDIoAKydbg bdn+CxoktJKQJO7YZOcDXgVJcNlsmjrhnq6Vp3/tSnaowSrCnOeaveO/tfoYVvO7sw== X-Google-Smtp-Source: AGHT+IEZ4GKNo+ZGTgIioZ6E8Q2/FLCJDMv5q/lYaYPH5b0i9NhmaYmcUV6iKdtOBuu19Rf+VfV0Ww== X-Received: by 2002:a17:90b:1205:b0:2ad:c098:ebca with SMTP id gl5-20020a17090b120500b002adc098ebcamr7093107pjb.20.1713891835397; Tue, 23 Apr 2024 10:03:55 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([1.203.116.31]) by smtp.gmail.com with ESMTPSA id s19-20020a17090a881300b002a5d684a6a7sm9641148pjn.10.2024.04.23.10.03.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 23 Apr 2024 10:03:54 -0700 (PDT) From: Kairui Song To: linux-mm@kvack.org Cc: Andrew Morton , "Huang, Ying" , Matthew Wilcox , Chris Li , Barry Song , Ryan Roberts , Neil Brown , Minchan Kim , Hugh Dickins , David Hildenbrand , Yosry Ahmed , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Kairui Song , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org Subject: [PATCH v2 1/8] NFS: remove nfs_page_lengthg and usage of page_index Date: Wed, 24 Apr 2024 01:03:32 +0800 Message-ID: <20240423170339.54131-2-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240423170339.54131-1-ryncsn@gmail.com> References: <20240423170339.54131-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 4839B1A0016 X-Stat-Signature: 7hwznbyk5ek5m35qkyj1m4tycfbasagr X-HE-Tag: 1713891837-777316 X-HE-Meta: U2FsdGVkX1/IVT8kXpNn9N22AEjYgxXqxKO8NTgGubB8JagLyw8QO6f7jh3H8wG4jHGjHAbWP4WCf4wAh6+QzdThb+cIB+syoaP9oS7RXfvMddtK+cY7n7nhnRFzNQ0zH5KNg97tuep7VR3qrJa5wEZluvi19ceFFHR/pMisPMtqzVX2+myLcVKWWy6ckybMyzaI+dU3RSorf12H3MI+1O6ipXWX5+Op+MHwyR2XbU2ugXNk3KCRXTrxw1BeLPoF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7f4Y1bEjP4JzaAp6Xo7dD6EYSrqrh6MLvEf7TOuLmpDB1PQpIaaqFqE3/kcmaOkRh+LLmS1Q910yuIfH59iRBPCr+gkuxKyW5dprh4NscXKM0muN3g7BJ6z02Mo3I0nCEOISRM3FO9rSM/IoqWE9QLMfgztp+Yo5Eoh44TPEXeEJrGNDL9l7cDTvLCzX2fh76K7ZK8Ikk5yRl0P6fpfYnq2ARfAAZVRkdQwn9KPvF+0xh3CYtJ7NTS2vt1O3apfwnpf4sV48LaOju3WPHTR3YN8AB9FXI2ngs7ifT4WpodP0tD6+SZAxz1TDfM9kOIfn7D1zs14/2rV2EK8cDSWMt2Fts0EhqNEqMqUvH3D+Ii7yimvuDT886zf0iR5CxZxEdTetvo91MbTYxDSWrDPOh+blCO7Za41eJpyC/Z6J6IcNK8I/oPRGgjc8YLW6J3StltLOrjeAgARzmDtgZQGNhUkwdC 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: From: Kairui Song This function is no longer used after commit 4fa7a717b432 ("NFS: Fix up nfs_vm_page_mkwrite() for folios"), all users have been converted to use folio instead, just delete it to remove usage of page_index. Signed-off-by: Kairui Song Cc: Trond Myklebust Cc: Anna Schumaker Cc: linux-nfs@vger.kernel.org --- fs/nfs/internal.h | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 06253695fe53..deac98dce6ac 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -790,25 +790,6 @@ static inline void nfs_folio_mark_unstable(struct folio *folio, } } -/* - * Determine the number of bytes of data the page contains - */ -static inline -unsigned int nfs_page_length(struct page *page) -{ - loff_t i_size = i_size_read(page_file_mapping(page)->host); - - if (i_size > 0) { - pgoff_t index = page_index(page); - pgoff_t end_index = (i_size - 1) >> PAGE_SHIFT; - if (index < end_index) - return PAGE_SIZE; - if (index == end_index) - return ((i_size - 1) & ~PAGE_MASK) + 1; - } - return 0; -} - /* * Determine the number of bytes of data the page contains */