Commit b224b184 authored by Zhang Yi's avatar Zhang Yi Committed by Theodore Ts'o

ext4: drop ext4_es_is_delonly()

Since we don't add delayed flag in unwritten extents, so there is no
difference between ext4_es_is_delayed() and ext4_es_is_delonly(),
just drop ext4_es_is_delonly().
Signed-off-by: default avatarZhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20240813123452.2824659-12-yi.zhang@huaweicloud.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent ce09036e
...@@ -558,8 +558,8 @@ static int ext4_es_can_be_merged(struct extent_status *es1, ...@@ -558,8 +558,8 @@ static int ext4_es_can_be_merged(struct extent_status *es1,
if (ext4_es_is_hole(es1)) if (ext4_es_is_hole(es1))
return 1; return 1;
/* we need to check delayed extent is without unwritten status */ /* we need to check delayed extent */
if (ext4_es_is_delayed(es1) && !ext4_es_is_unwritten(es1)) if (ext4_es_is_delayed(es1))
return 1; return 1;
return 0; return 0;
...@@ -1135,7 +1135,7 @@ static void count_rsvd(struct inode *inode, ext4_lblk_t lblk, long len, ...@@ -1135,7 +1135,7 @@ static void count_rsvd(struct inode *inode, ext4_lblk_t lblk, long len,
struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb);
ext4_lblk_t i, end, nclu; ext4_lblk_t i, end, nclu;
if (!ext4_es_is_delonly(es)) if (!ext4_es_is_delayed(es))
return; return;
WARN_ON(len <= 0); WARN_ON(len <= 0);
...@@ -1285,7 +1285,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end, ...@@ -1285,7 +1285,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end,
es = rc->left_es; es = rc->left_es;
while (es && ext4_es_end(es) >= while (es && ext4_es_end(es) >=
EXT4_LBLK_CMASK(sbi, rc->first_do_lblk)) { EXT4_LBLK_CMASK(sbi, rc->first_do_lblk)) {
if (ext4_es_is_delonly(es)) { if (ext4_es_is_delayed(es)) {
rc->ndelonly--; rc->ndelonly--;
left_delonly = true; left_delonly = true;
break; break;
...@@ -1305,7 +1305,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end, ...@@ -1305,7 +1305,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end,
} }
while (es && es->es_lblk <= while (es && es->es_lblk <=
EXT4_LBLK_CFILL(sbi, rc->last_do_lblk)) { EXT4_LBLK_CFILL(sbi, rc->last_do_lblk)) {
if (ext4_es_is_delonly(es)) { if (ext4_es_is_delayed(es)) {
rc->ndelonly--; rc->ndelonly--;
right_delonly = true; right_delonly = true;
break; break;
...@@ -2226,7 +2226,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, ...@@ -2226,7 +2226,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk,
if (EXT4_B2C(sbi, lblk) == EXT4_B2C(sbi, end)) { if (EXT4_B2C(sbi, lblk) == EXT4_B2C(sbi, end)) {
first = EXT4_LBLK_CMASK(sbi, lblk); first = EXT4_LBLK_CMASK(sbi, lblk);
if (first != lblk) if (first != lblk)
f_del = __es_scan_range(inode, &ext4_es_is_delonly, f_del = __es_scan_range(inode, &ext4_es_is_delayed,
first, lblk - 1); first, lblk - 1);
if (f_del) { if (f_del) {
ret = __insert_pending(inode, first, prealloc); ret = __insert_pending(inode, first, prealloc);
...@@ -2238,7 +2238,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, ...@@ -2238,7 +2238,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk,
sbi->s_cluster_ratio - 1; sbi->s_cluster_ratio - 1;
if (last != end) if (last != end)
l_del = __es_scan_range(inode, l_del = __es_scan_range(inode,
&ext4_es_is_delonly, &ext4_es_is_delayed,
end + 1, last); end + 1, last);
if (l_del) { if (l_del) {
ret = __insert_pending(inode, last, prealloc); ret = __insert_pending(inode, last, prealloc);
...@@ -2251,7 +2251,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, ...@@ -2251,7 +2251,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk,
} else { } else {
first = EXT4_LBLK_CMASK(sbi, lblk); first = EXT4_LBLK_CMASK(sbi, lblk);
if (first != lblk) if (first != lblk)
f_del = __es_scan_range(inode, &ext4_es_is_delonly, f_del = __es_scan_range(inode, &ext4_es_is_delayed,
first, lblk - 1); first, lblk - 1);
if (f_del) { if (f_del) {
ret = __insert_pending(inode, first, prealloc); ret = __insert_pending(inode, first, prealloc);
...@@ -2263,7 +2263,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk, ...@@ -2263,7 +2263,7 @@ static int __revise_pending(struct inode *inode, ext4_lblk_t lblk,
last = EXT4_LBLK_CMASK(sbi, end) + sbi->s_cluster_ratio - 1; last = EXT4_LBLK_CMASK(sbi, end) + sbi->s_cluster_ratio - 1;
if (last != end) if (last != end)
l_del = __es_scan_range(inode, &ext4_es_is_delonly, l_del = __es_scan_range(inode, &ext4_es_is_delayed,
end + 1, last); end + 1, last);
if (l_del) { if (l_del) {
ret = __insert_pending(inode, last, prealloc); ret = __insert_pending(inode, last, prealloc);
......
...@@ -190,11 +190,6 @@ static inline int ext4_es_is_mapped(struct extent_status *es) ...@@ -190,11 +190,6 @@ static inline int ext4_es_is_mapped(struct extent_status *es)
return (ext4_es_is_written(es) || ext4_es_is_unwritten(es)); return (ext4_es_is_written(es) || ext4_es_is_unwritten(es));
} }
static inline int ext4_es_is_delonly(struct extent_status *es)
{
return (ext4_es_is_delayed(es) && !ext4_es_is_unwritten(es));
}
static inline void ext4_es_set_referenced(struct extent_status *es) static inline void ext4_es_set_referenced(struct extent_status *es)
{ {
es->es_pblk |= ((ext4_fsblk_t)EXTENT_STATUS_REFERENCED) << ES_SHIFT; es->es_pblk |= ((ext4_fsblk_t)EXTENT_STATUS_REFERENCED) << ES_SHIFT;
......
...@@ -1645,7 +1645,7 @@ static int ext4_clu_alloc_state(struct inode *inode, ext4_lblk_t lblk) ...@@ -1645,7 +1645,7 @@ static int ext4_clu_alloc_state(struct inode *inode, ext4_lblk_t lblk)
int ret; int ret;
/* Has delalloc reservation? */ /* Has delalloc reservation? */
if (ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) if (ext4_es_scan_clu(inode, &ext4_es_is_delayed, lblk))
return 1; return 1;
/* Already been allocated? */ /* Already been allocated? */
...@@ -1766,7 +1766,7 @@ static int ext4_da_map_blocks(struct inode *inode, struct ext4_map_blocks *map) ...@@ -1766,7 +1766,7 @@ static int ext4_da_map_blocks(struct inode *inode, struct ext4_map_blocks *map)
* Delayed extent could be allocated by fallocate. * Delayed extent could be allocated by fallocate.
* So we need to check it. * So we need to check it.
*/ */
if (ext4_es_is_delonly(&es)) { if (ext4_es_is_delayed(&es)) {
map->m_flags |= EXT4_MAP_DELAYED; map->m_flags |= EXT4_MAP_DELAYED;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment