From: Edward Shishkin <edward.shishkin@gmail.com>
To: willy@infradead.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, reiserfs-devel@vger.kernel.org,
jack@suse.cz
Cc: Edward Shishkin <edward.shishkin@gmail.com>
Subject: [PATCH] reiserfs: get rid of AOP_FLAG_CONT_EXPAND flag
Date: Mon, 21 Feb 2022 00:22:19 +0100 [thread overview]
Message-ID: <20220220232219.1235-1-edward.shishkin@gmail.com> (raw)
In-Reply-To: <fbc744c9-e22f-138c-2da3-f76c3edfcc3d@gmail.com>
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
---
fs/reiserfs/inode.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
index f49b72ccac4c..e943930939f5 100644
--- a/fs/reiserfs/inode.c
+++ b/fs/reiserfs/inode.c
@@ -2763,13 +2763,6 @@ static int reiserfs_write_begin(struct file *file,
int old_ref = 0;
inode = mapping->host;
- *fsdata = NULL;
- if (flags & AOP_FLAG_CONT_EXPAND &&
- (pos & (inode->i_sb->s_blocksize - 1)) == 0) {
- pos ++;
- *fsdata = (void *)(unsigned long)flags;
- }
-
index = pos >> PAGE_SHIFT;
page = grab_cache_page_write_begin(mapping, index, flags);
if (!page)
@@ -2896,9 +2889,6 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping,
unsigned start;
bool locked = false;
- if ((unsigned long)fsdata & AOP_FLAG_CONT_EXPAND)
- pos ++;
-
reiserfs_wait_on_write_block(inode->i_sb);
if (reiserfs_transaction_running(inode->i_sb))
th = current->journal_info;
@@ -3316,7 +3306,11 @@ int reiserfs_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
/* fill in hole pointers in the expanding truncate case. */
if (attr->ia_size > inode->i_size) {
- error = generic_cont_expand_simple(inode, attr->ia_size);
+ loff_t pos = attr->ia_size;
+
+ if ((pos & (inode->i_sb->s_blocksize - 1)) == 0)
+ pos++;
+ error = generic_cont_expand_simple(inode, pos);
if (REISERFS_I(inode)->i_prealloc_count > 0) {
int err;
struct reiserfs_transaction_handle th;
--
2.21.3
next prev parent reply other threads:[~2022-02-20 23:22 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-20 12:13 Is it time to remove reiserfs? Matthew Wilcox
2022-02-20 23:21 ` Edward Shishkin
2022-02-20 23:22 ` Edward Shishkin [this message]
2022-02-22 10:27 ` [PATCH] reiserfs: get rid of AOP_FLAG_CONT_EXPAND flag Jan Kara
2022-02-22 13:38 ` Matthew Wilcox
2022-02-23 12:17 ` Jan Kara
2022-02-22 10:04 ` Is it time to remove reiserfs? Jan Kara
2022-02-22 22:16 ` Dave Chinner
2022-02-23 14:48 ` Byron Stanoszek
2022-02-23 15:28 ` Byron Stanoszek
2022-03-17 8:53 ` Thomas Dreibholz
2022-03-17 9:43 ` Jan Kara
2022-02-24 8:46 ` Jan Kara
2022-02-24 14:24 ` Byron Stanoszek
2022-02-24 21:06 ` Matthew Wilcox
2022-02-25 13:10 ` Byron Stanoszek
2022-02-25 13:23 ` Willy Tarreau
2022-02-25 22:56 ` Dave Chinner
2022-02-26 0:00 ` Theodore Ts'o
2022-04-02 10:57 ` Pavel Machek
2022-04-05 23:04 ` Dave Chinner
2022-04-02 10:54 ` Pavel Machek
2022-04-04 8:55 ` Jan Kara
2022-04-04 10:07 ` Pavel Machek
2022-04-04 10:18 ` Willy Tarreau
2022-04-04 10:58 ` Pavel Machek
2022-04-04 13:05 ` Jan Kara
2022-04-04 12:55 ` Jan Kara
2022-04-04 13:16 ` Willy Tarreau
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220220232219.1235-1-edward.shishkin@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=reiserfs-devel@vger.kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).