diff mbox series

[5/8] cifs: drop usage of page_file_offset

Message ID 20240417160842.76665-6-ryncsn@gmail.com (mailing list archive)
State New
Headers show
Series mm/swap: optimize swap cache search space | expand

Commit Message

Kairui Song April 17, 2024, 4:08 p.m. UTC
From: Kairui Song <kasong@tencent.com>

page_file_offset is only needed for mixed usage of page cache and
swap cache, for pure page cache usage, the caller can just use
page_offset instead.

It can't be a swap cache page here, so just drop it.

Signed-off-by: Kairui Song <kasong@tencent.com>
Cc: Steve French <stfrench@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: Paulo Alcantara <pc@manguebit.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Bharath SM <bharathsm@microsoft.com>
---
 fs/smb/client/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox April 17, 2024, 4:25 p.m. UTC | #1
On Thu, Apr 18, 2024 at 12:08:39AM +0800, Kairui Song wrote:
> +++ b/fs/smb/client/file.c
> @@ -4749,7 +4749,7 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
>  static int cifs_read_folio(struct file *file, struct folio *folio)
>  {
>  	struct page *page = &folio->page;
> -	loff_t offset = page_file_offset(page);
> +	loff_t offset = page_offset(page);

	loff_t offset = folio_pos(folio);
diff mbox series

Patch

diff --git a/fs/smb/client/file.c b/fs/smb/client/file.c
index 16aadce492b2..73bbd761bf32 100644
--- a/fs/smb/client/file.c
+++ b/fs/smb/client/file.c
@@ -4749,7 +4749,7 @@  static int cifs_readpage_worker(struct file *file, struct page *page,
 static int cifs_read_folio(struct file *file, struct folio *folio)
 {
 	struct page *page = &folio->page;
-	loff_t offset = page_file_offset(page);
+	loff_t offset = page_offset(page);
 	int rc = -EACCES;
 	unsigned int xid;