aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smb/client/inode.c
diff options
context:
space:
mode:
authorDavid Howells <[email protected]>2025-04-01 15:01:02 +0000
committerSteve French <[email protected]>2025-04-03 01:00:39 +0000
commitf83e10a233059b74eaa2716e903b57464b3d3b0c (patch)
tree3ba2fc3de60f6e6347edf94dd18012514bbaa452 /fs/smb/client/inode.c
parentcifs: Do not add FILE_READ_ATTRIBUTES when using GENERIC_READ/EXECUTE/ALL (diff)
downloadkernel-f83e10a233059b74eaa2716e903b57464b3d3b0c.tar.gz
kernel-f83e10a233059b74eaa2716e903b57464b3d3b0c.zip
cifs: Remove cifs_truncate_page() as it should be superfluous
The calls to cifs_truncate_page() should be superfluous as the places that call it also call truncate_setsize() or cifs_setsize() and therefore truncate_pagecache() which should also clear the tail part of the folio containing the EOF marker. Further, smb3_simple_falloc() calls both cifs_setsize() and truncate_setsize() in addition to cifs_truncate_page(). Remove the superfluous calls. This gets rid of another function referring to struct page. [Should cifs_setsize() also set inode->i_blocks?] Signed-off-by: David Howells <[email protected]> cc: Steve French <[email protected]> Reviewed-by: Paulo Alcantara (Red Hat) <[email protected]> cc: Matthew Wilcox <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected] Signed-off-by: Steve French <[email protected]>
Diffstat (limited to 'fs/smb/client/inode.c')
-rw-r--r--fs/smb/client/inode.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/fs/smb/client/inode.c b/fs/smb/client/inode.c
index 3bb21aa58474..a00a9d91d0da 100644
--- a/fs/smb/client/inode.c
+++ b/fs/smb/client/inode.c
@@ -2901,23 +2901,6 @@ int cifs_fiemap(struct inode *inode, struct fiemap_extent_info *fei, u64 start,
return -EOPNOTSUPP;
}
-int cifs_truncate_page(struct address_space *mapping, loff_t from)
-{
- pgoff_t index = from >> PAGE_SHIFT;
- unsigned offset = from & (PAGE_SIZE - 1);
- struct page *page;
- int rc = 0;
-
- page = grab_cache_page(mapping, index);
- if (!page)
- return -ENOMEM;
-
- zero_user_segment(page, offset, PAGE_SIZE);
- unlock_page(page);
- put_page(page);
- return rc;
-}
-
void cifs_setsize(struct inode *inode, loff_t offset)
{
struct cifsInodeInfo *cifs_i = CIFS_I(inode);
@@ -3012,8 +2995,6 @@ set_size_out:
*/
attrs->ia_ctime = attrs->ia_mtime = current_time(inode);
attrs->ia_valid |= ATTR_CTIME | ATTR_MTIME;
-
- cifs_truncate_page(inode->i_mapping, inode->i_size);
}
return rc;