From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Subject: [PATCH v2 03/22] ext4: drop redundant calls ext4_fc_track_range
Date: Thu, 5 Nov 2020 19:58:52 -0800 [thread overview]
Message-ID: <20201106035911.1942128-4-harshadshirwadkar@gmail.com> (raw)
In-Reply-To: <20201106035911.1942128-1-harshadshirwadkar@gmail.com>
ext4_fc_track_range() should only be called when blocks are added or
removed from an inode. So, the only places from where we need to call
this function are ext4_map_blocks(), punch hole, collapse / zero
range, truncate. Remove all the other redundant calls to ths function.
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
---
fs/ext4/extents.c | 5 -----
fs/ext4/super.c | 4 ----
2 files changed, 9 deletions(-)
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 559100f3e23c..1db762c770ca 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3723,7 +3723,6 @@ static int ext4_convert_unwritten_extents_endio(handle_t *handle,
err = ext4_ext_dirty(handle, inode, path + path->p_depth);
out:
ext4_ext_show_leaf(inode, path);
- ext4_fc_track_range(inode, ee_block, ee_block + ee_len - 1);
return err;
}
@@ -3795,7 +3794,6 @@ convert_initialized_extent(handle_t *handle, struct inode *inode,
if (*allocated > map->m_len)
*allocated = map->m_len;
map->m_len = *allocated;
- ext4_fc_track_range(inode, ee_block, ee_block + ee_len - 1);
return 0;
}
@@ -4329,7 +4327,6 @@ int ext4_ext_map_blocks(handle_t *handle, struct inode *inode,
map->m_len = ar.len;
allocated = map->m_len;
ext4_ext_show_leaf(inode, path);
- ext4_fc_track_range(inode, map->m_lblk, map->m_lblk + map->m_len - 1);
out:
ext4_ext_drop_refs(path);
kfree(path);
@@ -4651,8 +4648,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_ZERO_RANGE |
FALLOC_FL_INSERT_RANGE))
return -EOPNOTSUPP;
- ext4_fc_track_range(inode, offset >> blkbits,
- (offset + len - 1) >> blkbits);
ext4_fc_start_update(inode);
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index d92de21212e9..804f9fc5bdbd 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6561,10 +6561,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
brelse(bh);
out:
if (inode->i_size < off + len) {
- ext4_fc_track_range(inode,
- (inode->i_size > 0 ? inode->i_size - 1 : 0)
- >> inode->i_sb->s_blocksize_bits,
- (off + len) >> inode->i_sb->s_blocksize_bits);
i_size_write(inode, off + len);
EXT4_I(inode)->i_disksize = inode->i_size;
err2 = ext4_mark_inode_dirty(handle, inode);
--
2.29.1.341.ge80a0c044ae-goog
next prev parent reply other threads:[~2020-11-06 3:59 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-06 3:58 [PATCH v2 00/22] ext4 fast commit fixes Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 01/22] ext4: describe fast_commit feature flags Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 02/22] ext4: mark fc ineligible if inode gets evictied due to mem pressure Harshad Shirwadkar
2020-11-06 3:58 ` Harshad Shirwadkar [this message]
2020-11-06 3:58 ` [PATCH v2 04/22] ext4: fixup ext4_fc_track_* functions' signature Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 05/22] jbd2: rename j_maxlen to j_total_len and add jbd2_journal_max_txn_bufs Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 06/22] ext4: clean up the JBD2 API that initializes fast commits Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 07/22] jbd2: drop jbd2_fc_init documentation Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 08/22] jbd2: don't use state lock during commit path Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 09/22] jbd2: don't pass tid to jbd2_fc_end_commit_fallback() Harshad Shirwadkar
2020-11-06 3:58 ` [PATCH v2 10/22] jbd2: add todo for a fast commit performance optimization Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 11/22] jbd2: don't touch buffer state until it is filled Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 12/22] jbd2: don't read journal->j_commit_sequence without taking a lock Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 13/22] ext4: dedpulicate the code to wait on inode that's being committed Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 14/22] ext4: fix code documentatioon Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 15/22] ext4: mark buf dirty before submitting fast commit buffer Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 16/22] ext4: remove unnecessary fast commit calls from ext4_file_mmap Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 17/22] ext4: fix inode dirty check in case of fast commits Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 18/22] ext4: disable fast commit with data journalling Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 19/22] ext4: issue fsdev cache flush before starting fast commit Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 20/22] ext4: make s_mount_flags modifications atomic Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 21/22] jbd2: don't start fast commit on aborted journal Harshad Shirwadkar
2020-11-06 3:59 ` [PATCH v2 22/22] ext4: cleanup fast commit mount options Harshad Shirwadkar
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=20201106035911.1942128-4-harshadshirwadkar@gmail.com \
--to=harshadshirwadkar@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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).