From patchwork Fri May 10 11:47:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13661467 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 6C61BC25B10 for ; Fri, 10 May 2024 11:50:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BD2016B00C6; Fri, 10 May 2024 07:50:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B814B6B00C7; Fri, 10 May 2024 07:50:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9D5626B00C8; Fri, 10 May 2024 07:50:11 -0400 (EDT) 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 7F3E96B00C6 for ; Fri, 10 May 2024 07:50:11 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id EBBCDA27E4 for ; Fri, 10 May 2024 11:50:10 +0000 (UTC) X-FDA: 82102317780.03.A2DCA41 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf16.hostedemail.com (Postfix) with ESMTP id 13095180015 for ; Fri, 10 May 2024 11:50:08 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CdeJ9f5e; spf=pass (imf16.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715341809; 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=T/Y01wUoc8GqRpvXAplln3XTaKFYbBI0hlcfHL66MPg=; b=CiRGcTN9076RCCx3JbboC9ey9gsGezSLJuuY6qmeLrWZnE4wllhhC1Uxf8lmotp7LkDvE5 PC26YITpPqTAawCyg55LaxhGJhggl5Kzb9NwhUOEINANCUoH0WyzMQp1e0HFuloMSVwFND ktlQ5wXj2nFOFGiVSMf9sdirrKmRFwg= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=CdeJ9f5e; spf=pass (imf16.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715341809; a=rsa-sha256; cv=none; b=Uxs+ildojOQa1QlrG97TAa9hqBdCqPy/kmNmhxhuVe79C/fumbcb/XThXURKG4Pwr5yRRu 985zC3uLXxygIr81OFc4Lv/UwwwWmzJevJ1l/fAJMZbih1YEHDqbwOU+hqUHxrpf/EYlrK Jb9yv1EtOK4O6Fq3zTLoEb1HWz5Thag= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1ec4b2400b6so17487185ad.3 for ; Fri, 10 May 2024 04:50:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715341807; x=1715946607; 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=T/Y01wUoc8GqRpvXAplln3XTaKFYbBI0hlcfHL66MPg=; b=CdeJ9f5eWm4h6jE/iDusG0ruaLS8hXxy8qo6EfLsqBJuRsR9YpRH7Ppx24mTf117+r emS9AXKxX7MijsHh8tT+ie8s9LqmS+6Zj6AflsoNBsbBR93fdS5hHZYvMFMZ3TazRPvE ABzzOEzBgnMlK+3JPnrA5dyJi2BNDVcN6hzA6UFShL+7elQi2ozZF7SXA4UUF4gpqx51 q6KVgxlYSefA4WlEnWtd2VQzwwVN4S4QqLW5/v0lEVkyZIEUkdRK8rsbvN0KBI5CJDaa 8+WVXsnj96F2n9CTqHGHTOAwfoC+NVwHOWqXqRzUbuTYz71Qw78qev/7FoGYx/8jQ+3h R/WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715341807; x=1715946607; 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=T/Y01wUoc8GqRpvXAplln3XTaKFYbBI0hlcfHL66MPg=; b=Dfe/a3RmviV8JeNziHGtL6KZV44FVbaXk+DsZccPIceFXXbMMOcPbVP/AW8yOdplJ8 spRSCjfwtMFf7NwUlA5Nwae/SWiocXmPeexmtNwechd9z0t0Bt239+O0Yb8O4bFQJtbd fp0XFaBOGvLLDm+5qQrS/Qi0Sll8GUrnHGPvVWQ8eFj9KABp/hDNIFCIgHXl2jtqeoZW j42mvkJrH8EinNOe2dSAK4kF0ovQXfovkxoqtFcOP3qyrZudFB+zRnPAF0KB2YI0pPg1 QW/t0qfwJM3IO6VPWLu6eXy1hWF9KZfbIARD1Bffe/R2vFFGmXHsMT9Dfg48X7qYagNP OM7Q== X-Gm-Message-State: AOJu0YxLQO4xLrnoUXf9n3ZuizpyYPS3Bb8z9iflto71Fd3KdLYRB04N BvRsTFSViI54IU8CnaaeVnddgWoN/+tcDUhQoUduORhf1xbdYI0ZCB8VHUNcLZiS9Q== X-Google-Smtp-Source: AGHT+IFzfIkLucPk4sXxl+wOh9wZthAGLSllywtwnMpoejVUjDeq2V0rnDLW1ag2irzlv9JXvgqNKA== X-Received: by 2002:a17:902:8307:b0:1e7:b7ea:2d61 with SMTP id d9443c01a7336-1ef43e26bc4mr20776495ad.37.1715341807566; Fri, 10 May 2024 04:50:07 -0700 (PDT) Received: from KASONG-MC4.tencent.com ([43.132.141.20]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1ef0c134155sm30183825ad.231.2024.05.10.04.50.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 10 May 2024 04:50:07 -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 , David Hildenbrand , Hugh Dickins , 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 v5 04/12] NFS: remove nfs_page_lengthg and usage of page_index Date: Fri, 10 May 2024 19:47:39 +0800 Message-ID: <20240510114747.21548-5-ryncsn@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240510114747.21548-1-ryncsn@gmail.com> References: <20240510114747.21548-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Stat-Signature: yyti8rx75utqh4au8ness5n9dc6suzx4 X-Rspam-User: X-Rspamd-Queue-Id: 13095180015 X-Rspamd-Server: rspam05 X-HE-Tag: 1715341808-351615 X-HE-Meta: U2FsdGVkX1/UzSlHM1TUMlUlRiEPYOFxOg13e1IMrHtoLnpVI3nROrqD8zCeaVUOwyq0+O+vYbwQsQ+DKewz5imUqotnnZvMt3PMRTlmzCHvKZHyi8M12fseK+vqjLmrkQzEee6uYygZU/Q9xPB/uu4KKbAmK8gXoQMEzS7aM7lw0iKF7ZfCLwWleBkgP/4jg8Kxkb4kBas5ykY1+N06ph/4eTbrw3UF9Xe0h3nZCEwQxAAVSQ1f4in6Df3o5bIteSf6a4vwF4iTPQvZ+5g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rXM65VHwFgPJwNKCvDvPTeVNFg8NKeUZmPqDxhrT/DH3aYhs2YQHEWlVX17WaGy2wm94w3vkwIS8tGlF3dY1nJgknQhS97UPMJJH3iLJrMQwnEKPSdr/jNyYVlweItnhkCTAyPZDhPXiZ0juL7Ix7y9nGQWlcMY2qdJx96D06ud/cVvvSfvVlvWBv0sQtlFrNR0/tyzzk8NZOMOuRj34R50rPtULkEJszgJNn+jztuU4doxTiueAEbOkF8+BU6DO4/VoRC+AQIKmCX1rPrQtZxGbAXt0qFgh1rwvgMkZRtYnDCBcfklH6uQdVJbnwbyK2Pwq21XOFRWI0wClvCZXK+MJ7FOt956zmMS3+1IrQKt+lNaJ/PIJyAXeFa71QjcQM6bkcNQu68Ks4WAGWC2/oBfF0td9mjFIIZ5W0DE484gzCgZpvSuoAQakA5roZ+EigqEif/szhL9pr4vL4NTIg+1SfGeKClNVjWP9/ofabRHKQauU0XZCt5GI= 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 */