Skip to content

Commit 7caef26

Browse files
kiryltorvalds
authored andcommitted
truncate: drop 'oldsize' truncate_pagecache() parameter
truncate_pagecache() doesn't care about old size since commit cedabed ("vfs: Fix vmtruncate() regression"). Let's drop it. Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5fbc461 commit 7caef26

28 files changed

Lines changed: 31 additions & 44 deletions

File tree

‎fs/adfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static void adfs_write_failed(struct address_space *mapping, loff_t to)
5050
struct inode *inode = mapping->host;
5151

5252
if (to > inode->i_size)
53-
truncate_pagecache(inode, to, inode->i_size);
53+
truncate_pagecache(inode, inode->i_size);
5454
}
5555

5656
static int adfs_write_begin(struct file *file, struct address_space *mapping,

‎fs/affs/file.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static void affs_write_failed(struct address_space *mapping, loff_t to)
406406
struct inode *inode = mapping->host;
407407

408408
if (to > inode->i_size) {
409-
truncate_pagecache(inode, to, inode->i_size);
409+
truncate_pagecache(inode, inode->i_size);
410410
affs_truncate(inode);
411411
}
412412
}

‎fs/bfs/file.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void bfs_write_failed(struct address_space *mapping, loff_t to)
166166
struct inode *inode = mapping->host;
167167

168168
if (to > inode->i_size)
169-
truncate_pagecache(inode, to, inode->i_size);
169+
truncate_pagecache(inode, inode->i_size);
170170
}
171171

172172
static int bfs_write_begin(struct file *file, struct address_space *mapping,

‎fs/btrfs/free-space-cache.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,12 +221,10 @@ int btrfs_truncate_free_space_cache(struct btrfs_root *root,
221221
struct btrfs_path *path,
222222
struct inode *inode)
223223
{
224-
loff_t oldsize;
225224
int ret = 0;
226225

227-
oldsize = i_size_read(inode);
228226
btrfs_i_size_write(inode, 0);
229-
truncate_pagecache(inode, oldsize, 0);
227+
truncate_pagecache(inode, 0);
230228

231229
/*
232230
* We don't need an orphan item because truncating the free space cache

‎fs/btrfs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4409,7 +4409,7 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
44094409
inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb);
44104410

44114411
if (newsize > oldsize) {
4412-
truncate_pagecache(inode, oldsize, newsize);
4412+
truncate_pagecache(inode, newsize);
44134413
ret = btrfs_cont_expand(inode, oldsize, newsize);
44144414
if (ret)
44154415
return ret;

‎fs/cifs/inode.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1852,14 +1852,11 @@ static int cifs_truncate_page(struct address_space *mapping, loff_t from)
18521852

18531853
static void cifs_setsize(struct inode *inode, loff_t offset)
18541854
{
1855-
loff_t oldsize;
1856-
18571855
spin_lock(&inode->i_lock);
1858-
oldsize = inode->i_size;
18591856
i_size_write(inode, offset);
18601857
spin_unlock(&inode->i_lock);
18611858

1862-
truncate_pagecache(inode, oldsize, offset);
1859+
truncate_pagecache(inode, offset);
18631860
}
18641861

18651862
static int

‎fs/exofs/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,7 @@ static int exofs_writepage(struct page *page, struct writeback_control *wbc)
861861
static void _write_failed(struct inode *inode, loff_t to)
862862
{
863863
if (to > inode->i_size)
864-
truncate_pagecache(inode, to, inode->i_size);
864+
truncate_pagecache(inode, inode->i_size);
865865
}
866866

867867
int exofs_write_begin(struct file *file, struct address_space *mapping,

‎fs/ext2/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ static void ext2_write_failed(struct address_space *mapping, loff_t to)
5858
struct inode *inode = mapping->host;
5959

6060
if (to > inode->i_size) {
61-
truncate_pagecache(inode, to, inode->i_size);
61+
truncate_pagecache(inode, inode->i_size);
6262
ext2_truncate_blocks(inode, inode->i_size);
6363
}
6464
}

‎fs/ext4/inode.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4587,7 +4587,6 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
45874587

45884588
if (attr->ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) {
45894589
handle_t *handle;
4590-
loff_t oldsize = inode->i_size;
45914590

45924591
if (!(ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS))) {
45934592
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
@@ -4650,7 +4649,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
46504649
* Truncate pagecache after we've waited for commit
46514650
* in data=journal mode to make pages freeable.
46524651
*/
4653-
truncate_pagecache(inode, oldsize, inode->i_size);
4652+
truncate_pagecache(inode, inode->i_size);
46544653
}
46554654
/*
46564655
* We want to call ext4_truncate() even if attr->ia_size ==

‎fs/fat/inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ static void fat_write_failed(struct address_space *mapping, loff_t to)
147147
struct inode *inode = mapping->host;
148148

149149
if (to > inode->i_size) {
150-
truncate_pagecache(inode, to, inode->i_size);
150+
truncate_pagecache(inode, inode->i_size);
151151
fat_truncate_blocks(inode, inode->i_size);
152152
}
153153
}

0 commit comments

Comments
 (0)