From patchwork Tue May 21 17:58:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kairui Song X-Patchwork-Id: 13669612 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 60CB7C25B74 for ; Tue, 21 May 2024 17:59:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DE1886B0095; Tue, 21 May 2024 13:59:23 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D69866B0096; Tue, 21 May 2024 13:59:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BE47F6B0098; Tue, 21 May 2024 13:59:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9CAFD6B0095 for ; Tue, 21 May 2024 13:59:23 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 57D20808DD for ; Tue, 21 May 2024 17:59:23 +0000 (UTC) X-FDA: 82143165006.27.5D720E2 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf20.hostedemail.com (Postfix) with ESMTP id 859A11C0003 for ; Tue, 21 May 2024 17:59:21 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Cd0j+GbR; spf=pass (imf20.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.174 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=1716314361; 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=oFfzYt0CF3HNks2CB37HMPp4PPqVX0Kd/+3SY4YfJI3GJAcBXBhB9RbzeE7EMAu9a+2So1 QsJ/ZQMKDUtBa4y8Q2ARTGcFT1PvO29Qf4u7y7YMkccNmlJ00AKeg08EPwVZAaBbORwUPy JHcGBUqx1GLD+LPgnk9PKG/m4sYwTcI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716314361; a=rsa-sha256; cv=none; b=Lc8KKKHzmacOdz3lKsdI18VaMTuiTH2eRnLZODSb1viRPe0gK/8TXEXn5TqMJwq4I36yka HOoFX/V9yyRs8eUDxi4c2+ft02skidngGErv5qzdbPPOkRfShiiKvWgDZrIkg/wALQb7M6 mgm8DdiwCxdgcQ9KIw0uOLQaINfx9A4= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Cd0j+GbR; spf=pass (imf20.hostedemail.com: domain of ryncsn@gmail.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=ryncsn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1ed835f3c3cso3881065ad.3 for ; Tue, 21 May 2024 10:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716314360; x=1716919160; 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=Cd0j+GbRcjQ2etBAT5NsR9Qjt++sZm4RYwYLNJlparKGVhw0yTd1vQwPpHGoo5Fszf pQ8S/lIHcEJiMFdkrztlx7tlgOmKxUGAzAuledp2+5+O1iooWYxycse6/ZLB4RfPMP83 ds9iMttkBFPQ8LT24kEZb3e/7LoMOFq77G7XpxTgrsxO5nhPxYm+BqTJcvCvpnBHwnA9 5QEktjR/WQsawMg5w2N+o75d8HxHDmR1zwkSLFqRch53Gv2s9M5aC6v6lBGZyBFV95Ub LU+87TYUwUpZxnxi++Aj4Vy6VT1Xu+pdlvbMb2eTskuJqELdZ6+HgSFHPKvEN1mQop5m BHig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716314360; x=1716919160; 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=CS+5M3brQdovKOvryA+ptNhJ6saRkd2SF/VVmuNgge4J9/WxEgwfnq6kypc8HlONSO LiTQPF3hLAgcP2JIrsy2vn+mQePjZrN+6g+Kkgab7uZkxYlzXj42X9moa51lkr/TYkbK GFyugnZgyiV4qFUVaFPh3tpd+tw7Qk4R3aQjAiJjnLKHHGq90si/zOGhaXWzYnxR/6hS N0JU/FglfunX/WVfInu/u/R8YHPc3j0foOsgkc5M+wFNaDjolMd8WgXjRPdo/pR5D87n YzseMxLRLcG8yc2v5x3vvxhrjwUnRuBZlCxSXOOHc079P9TM1W95AaMWHD1tBmEiZfbI cN2A== X-Gm-Message-State: AOJu0YyhuDNKydsrcXBIbMznf3ULJ+9sZSfhTCQ7rhsMr5E2MZuIzU10 2VL68f1CLUwpA1LJLCv9ZhX4TyXTY3MtjU2ZJ8Cu5YbbA9CvmtTC6MubUaX1g5o= X-Google-Smtp-Source: AGHT+IHoEUt/0l1rn7y24nEEjHG5IB3IdC9BGhTGoiXG18qSAHAVRm5IJU0l3mpAfVMLarJhvGzQmA== X-Received: by 2002:a17:902:e847:b0:1f3:21e:23c4 with SMTP id d9443c01a7336-1f3021e275bmr80072115ad.21.1716314359988; Tue, 21 May 2024 10:59:19 -0700 (PDT) Received: from localhost.localdomain ([101.32.222.185]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f2fcdf87besm44646935ad.105.2024.05.21.10.59.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 May 2024 10:59:19 -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 v6 04/11] NFS: remove nfs_page_lengthg and usage of page_index Date: Wed, 22 May 2024 01:58:46 +0800 Message-ID: <20240521175854.96038-5-ryncsn@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240521175854.96038-1-ryncsn@gmail.com> References: <20240521175854.96038-1-ryncsn@gmail.com> Reply-To: Kairui Song MIME-Version: 1.0 X-Rspam-User: X-Stat-Signature: ytxw3czawdzsrhassgxm36g1gpg4gtn3 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 859A11C0003 X-HE-Tag: 1716314361-646060 X-HE-Meta: U2FsdGVkX19DsKAQdPqVoglWx8FYAmilpmZ+XTWd1xINk0bxVMRWL9n1jd4jtExDBY03eswwD1s1tmKVt8mnFbf43VZ1RE9fAoaDVrJ3LJamq+65CgMrVZZHCiuZS5s5xeKopbJoLeduETWQtANMj6512pplnQC0mNcwLNTcYE6ziVSjSPJ5loNa0gkO2AtawH+5cYFpJNB311n55UEoKE8R7xMY692vdjOajqPr3OI60xXvItQATrhpp7UFn8SXkR35y42ktaPfNIMygt8Nvl1Pgp2S0qODFxhvOXRu5v9a/ZvK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afMzMY8yGzX0Pu61KXW6FBzvAh38HAujRzF6gAyWi0AwQajdbAN9+2udo6PExHouZidbOFcq8f1bI3PWAjhJ/z+ffSOmi7bXFrXKTevB2IARASmpt8qsfXm51yjsxPfxyWiVATiiGFLJfiftU5AmF51Z7y2orE7JrPaMIE8knBX11dsOoOl0yWVkXZCARjBCDg0snWzBdnBjHahgSaSgRFGQhJq5+4xZc/J9NkdUh6BqjdmocjS4fbhDUMGH3cgNeVyTwPAi6wCoKdsCENoUX7UobMMUcPJa8Y7fxsnifECKd/DQc6Ey9GY7pUllH6HnTcAH73IGa4A+l0Gun8kTg9xy1DW6BRCbHL/VSOfY2mZExP9+UBjnGnEouKOsT77uyxl5r2h1I9JsjxkJTuEBc4UG04vPW2uQOG52LaithGk1IH/L7BmqVw5WYWTFfx2LitOjXDNZNQ4sCMeeF5Iqq0ZMQTqJ81h0hksEU5JHV0= 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 */