Skip to content

Commit 48b0e01

Browse files
edward6jankara
authored andcommitted
reiserfs: get rid of AOP_FLAG_CONT_EXPAND flag
Remove usage of AOP_FLAG_CONT_EXPAND flag. Reiserfs is the only user of it and it is easy to avoid. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Edward Shishkin <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent dfd42fa commit 48b0e01

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

fs/reiserfs/inode.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,13 +2763,6 @@ static int reiserfs_write_begin(struct file *file,
27632763
int old_ref = 0;
27642764

27652765
inode = mapping->host;
2766-
*fsdata = NULL;
2767-
if (flags & AOP_FLAG_CONT_EXPAND &&
2768-
(pos & (inode->i_sb->s_blocksize - 1)) == 0) {
2769-
pos ++;
2770-
*fsdata = (void *)(unsigned long)flags;
2771-
}
2772-
27732766
index = pos >> PAGE_SHIFT;
27742767
page = grab_cache_page_write_begin(mapping, index, flags);
27752768
if (!page)
@@ -2896,9 +2889,6 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
28962889
unsigned start;
28972890
bool locked = false;
28982891

2899-
if ((unsigned long)fsdata & AOP_FLAG_CONT_EXPAND)
2900-
pos ++;
2901-
29022892
reiserfs_wait_on_write_block(inode->i_sb);
29032893
if (reiserfs_transaction_running(inode->i_sb))
29042894
th = current->journal_info;
@@ -3316,7 +3306,11 @@ int reiserfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
33163306

33173307
/* fill in hole pointers in the expanding truncate case. */
33183308
if (attr->ia_size > inode->i_size) {
3319-
error = generic_cont_expand_simple(inode, attr->ia_size);
3309+
loff_t pos = attr->ia_size;
3310+
3311+
if ((pos & (inode->i_sb->s_blocksize - 1)) == 0)
3312+
pos++;
3313+
error = generic_cont_expand_simple(inode, pos);
33203314
if (REISERFS_I(inode)->i_prealloc_count > 0) {
33213315
int err;
33223316
struct reiserfs_transaction_handle th;

0 commit comments

Comments
 (0)