Skip to content

Commit 5a1cd0e

Browse files
LiBaokun96tytso
authored andcommitted
ext4: remove unused member 'i_unwritten' from 'ext4_inode_info'
After commit 378f32b ("ext4: introduce direct I/O write using iomap infrastructure"), no one cares about the value of i_unwritten, so there is no need to maintain this variable, remove it, and clean up the associated logic. Suggested-by: Zhang Yi <[email protected]> Signed-off-by: Baokun Li <[email protected]> Reviewed-by: Jan Kara <[email protected]> Reviewed-by: Zhang Yi <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 62c3da1 commit 5a1cd0e

File tree

3 files changed

+5
-28
lines changed

3 files changed

+5
-28
lines changed

fs/ext4/ext4.h

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,6 @@ struct ext4_inode_info {
10631063

10641064
/* Number of ongoing updates on this inode */
10651065
atomic_t i_fc_updates;
1066-
atomic_t i_unwritten; /* Nr. of inflight conversions pending */
10671066

10681067
/* Fast commit wait queue for this inode */
10691068
wait_queue_head_t i_fc_wait;
@@ -3792,34 +3791,19 @@ static inline void set_bitmap_uptodate(struct buffer_head *bh)
37923791
set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
37933792
}
37943793

3795-
/* For ioend & aio unwritten conversion wait queues */
3796-
#define EXT4_WQ_HASH_SZ 37
3797-
#define ext4_ioend_wq(v) (&ext4__ioend_wq[((unsigned long)(v)) %\
3798-
EXT4_WQ_HASH_SZ])
3799-
extern wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ];
3800-
38013794
extern int ext4_resize_begin(struct super_block *sb);
38023795
extern int ext4_resize_end(struct super_block *sb, bool update_backups);
38033796

3804-
static inline void ext4_set_io_unwritten_flag(struct inode *inode,
3805-
struct ext4_io_end *io_end)
3797+
static inline void ext4_set_io_unwritten_flag(struct ext4_io_end *io_end)
38063798
{
3807-
if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) {
3799+
if (!(io_end->flag & EXT4_IO_END_UNWRITTEN))
38083800
io_end->flag |= EXT4_IO_END_UNWRITTEN;
3809-
atomic_inc(&EXT4_I(inode)->i_unwritten);
3810-
}
38113801
}
38123802

38133803
static inline void ext4_clear_io_unwritten_flag(ext4_io_end_t *io_end)
38143804
{
3815-
struct inode *inode = io_end->inode;
3816-
3817-
if (io_end->flag & EXT4_IO_END_UNWRITTEN) {
3805+
if (io_end->flag & EXT4_IO_END_UNWRITTEN)
38183806
io_end->flag &= ~EXT4_IO_END_UNWRITTEN;
3819-
/* Wake up anyone waiting on unwritten extent conversion */
3820-
if (atomic_dec_and_test(&EXT4_I(inode)->i_unwritten))
3821-
wake_up_all(ext4_ioend_wq(inode));
3822-
}
38233807
}
38243808

38253809
extern const struct iomap_ops ext4_iomap_ops;

fs/ext4/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2226,7 +2226,7 @@ static int mpage_map_one_extent(handle_t *handle, struct mpage_da_data *mpd)
22262226
mpd->io_submit.io_end->handle = handle->h_rsv_handle;
22272227
handle->h_rsv_handle = NULL;
22282228
}
2229-
ext4_set_io_unwritten_flag(inode, mpd->io_submit.io_end);
2229+
ext4_set_io_unwritten_flag(mpd->io_submit.io_end);
22302230
}
22312231

22322232
BUG_ON(map->m_len == 0);

fs/ext4/super.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,6 @@ static struct inode *ext4_alloc_inode(struct super_block *sb)
14111411
spin_lock_init(&ei->i_completed_io_lock);
14121412
ei->i_sync_tid = 0;
14131413
ei->i_datasync_tid = 0;
1414-
atomic_set(&ei->i_unwritten, 0);
14151414
INIT_WORK(&ei->i_rsv_conversion_work, ext4_end_io_rsv_work);
14161415
ext4_fc_init_inode(&ei->vfs_inode);
14171416
mutex_init(&ei->i_fc_lock);
@@ -7391,22 +7390,16 @@ static struct file_system_type ext4_fs_type = {
73917390
};
73927391
MODULE_ALIAS_FS("ext4");
73937392

7394-
/* Shared across all ext4 file systems */
7395-
wait_queue_head_t ext4__ioend_wq[EXT4_WQ_HASH_SZ];
7396-
73977393
static int __init ext4_init_fs(void)
73987394
{
7399-
int i, err;
7395+
int err;
74007396

74017397
ratelimit_state_init(&ext4_mount_msg_ratelimit, 30 * HZ, 64);
74027398
ext4_li_info = NULL;
74037399

74047400
/* Build-time check for flags consistency */
74057401
ext4_check_flag_values();
74067402

7407-
for (i = 0; i < EXT4_WQ_HASH_SZ; i++)
7408-
init_waitqueue_head(&ext4__ioend_wq[i]);
7409-
74107403
err = ext4_init_es();
74117404
if (err)
74127405
return err;

0 commit comments

Comments
 (0)