From patchwork Wed Apr 17 16:08:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13633565 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 0D335C4345F for ; Wed, 17 Apr 2024 16:09:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C0A26B0088; Wed, 17 Apr 2024 12:09:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 773726B008A; Wed, 17 Apr 2024 12:09:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5EA006B008C; Wed, 17 Apr 2024 12:09:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 436D56B0088 for ; Wed, 17 Apr 2024 12:09:47 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 00F0BA0EFF for ; Wed, 17 Apr 2024 16:09:46 +0000 (UTC) X-FDA: 82019509614.18.F16ECC2 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf16.hostedemail.com (Postfix) with ESMTP id 465E5180024 for ; Wed, 17 Apr 2024 16:09:44 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YUkudALL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.176 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=1713370184; 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=y0geSoIc+jju+yQfcQUINlDeMzhHTaHXzJkIaR3mmqNwwcuUkM0jjKPr6ULWPFJSmQUb9q qjDsrNygPOLnFK9iQ78P5db3BFyQsKo2Xnk2OrmB2R4FHjVW/zqeeWvgRArpn7DVPomMdF YgSp42efvaBQjJrkSROHhjnENaTdKKs= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YUkudALL; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.210.176 as permitted sender) smtp.mailfrom=ryncsn@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1713370184; a=rsa-sha256; cv=none; b=MeIBZ+OBMtfJCy02bLkk2tY1EpSudgvjgi01x7SkNUuPrabqaHjaAo9qMvBcXj63f11lr/ 3m9zECApdaSYGn8WZ92cb7fiEcB+KJ/+jD/7qrZyVQLyLIcOKEsrjzum8mbJlU1NmkjCt+ FATla6VtvmG6sMs38ItIbDVQQF7tt2k= Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6ed11782727so4970843b3a.1 for ; Wed, 17 Apr 2024 09:09:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713370182; x=1713974982; 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=YUkudALLPzNDj19NEYB0Rc2oLuWoDpYKg8ALok51pC2vkcQabOt524W4KyrTM59KbU 9FJb28Kv9EsjjNoZKuxaoD4UnhCp3ih2LumOk4h5zUanKqTBLxinCG/ZYFWqCr7Sl9f7 uJb8eQm2eYlElb5nOKYWWcJ1VFRU6EiMhw+acmWA2Nk5nb0BaqfiyyPF/ge0h6432UIB wwVVOsm/2vxUnqeDvbcajNUNq81MBjfASvE5F3E+TehXzuygdYZz1Of9Pj+AH7fi7qdZ J9DcUv7lZn3TloAJOfoIwHdPkkKM7T6LN3QC6kYKrADIZNIVm2YX2VEjsWHebaYdW+qT Vsvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713370182; x=1713974982; 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=PBBB/jqW7f+fM0SPPu8EXT2vIFvNzPPXv8vp888hN3KWgrFMDtu9My5bUj0+bxlluj d9SyJzP/F7NqFZYleOcj61zd2gF/dRD6aneD9zOfVPTTBD4VJ8493X2QSJah25ZYMEn4 S7Wb0Z1Ek8TEwE6muVisALufLsst1VBNWMi0SdefW+vgVPim+XUrlWyvALHT+ZqC3/KQ 8cY6J/9wU+F+TquvrQ9bCOKEAOVWuIwXPEnPQZbbBhZMVxYZsuOZTTESkqMt38Sxrpnu hEzVUaw1ctzMPl5cvQwXM60zp0zlmXhF/g3Gq1HrLypB6DU4rlc62NxLzW0fGs+TmqJK pVfA== X-Gm-Message-State: AOJu0Yyga+vWsjQ8xSuCQG6LTq8Ij/qaYAEfdFdUnyH4plQYrisqnhjb AxFO2/rTDT4PBhWzUu47EYbNGU7eeoh/0s7ytMtCeI58UA6XkPCDQBc9pQ9yc27aag== X-Google-Smtp-Source: AGHT+IHADX305+lhsZl65TBVJfwFNnUajwhJ6mgc1Rrgzv/e0DGcheSabgx4i4+AnxNft/shYQftQw== X-Received: by 2002:a05:6a20:dd88:b0:1a5:6a85:8ce9 with SMTP id kw8-20020a056a20dd8800b001a56a858ce9mr71965pzb.12.1713370182271; Wed, 17 Apr 2024 09:09:42 -0700 (PDT) Received: from KASONG-MB2.tencent.com ([115.171.40.106]) by smtp.gmail.com with ESMTPSA id h189-20020a6383c6000000b005f75cf4db92sm5708366pge.82.2024.04.17.09.09.37 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 17 Apr 2024 09:09:41 -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 1/8] NFS: remove nfs_page_lengthg and usage of page_index Date: Thu, 18 Apr 2024 00:08:35 +0800 Message-ID: <20240417160842.76665-2-ryncsn@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240417160842.76665-1-ryncsn@gmail.com> References: <20240417160842.76665-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 465E5180024 X-Rspam-User: X-Stat-Signature: d33by3fzos7htz8ru7ku7atuk38j7gnm X-HE-Tag: 1713370184-220858 X-HE-Meta: U2FsdGVkX1+du/2otibfS/VuJqE2L++gIH7wHBZi5h5SCLE7v6LYXbgXpADP2w2qDl8M+3oxBt0gsbiQCSR6wJEkHnZKJSwyNTcepWQgGyNUM63Q4tvAPz/TdPdjaEF3O9uAMIlk85ExZxV0VqppGVx+kRWl+EbSMriO6iJrNUQaBqKnKENiNFvWRwvCaf6SJ2rwfHD/FfUPAtxzkVuLXtMTL8JjYZK+B03pLt059rwgW4qmwluwPob1RkJfhmyRHhikZs6UfhH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.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 */