Skip to content

Commit ec1d398

Browse files
AstralBobAndreas Gruenbacher
authored andcommitted
gfs2: Eliminate GIF_INVALID flag
With the addition of the new GLF_INSTANTIATE_NEEDED flag, the GIF_INVALID flag is now redundant. This patch removes it. Since inode_instantiate is only called when instantiation is needed, the check in inode_instantiate is removed too. Signed-off-by: Bob Peterson <rpeterso@redhat.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent f2e70d8 commit ec1d398

4 files changed

Lines changed: 4 additions & 11 deletions

File tree

fs/gfs2/glops.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
356356
struct address_space *mapping = gfs2_glock2aspace(gl);
357357
truncate_inode_pages(mapping, 0);
358358
if (ip) {
359-
set_bit(GIF_INVALID, &ip->i_flags);
360359
set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags);
361360
forget_all_cached_acls(&ip->i_inode);
362361
security_inode_invalidate_secctx(&ip->i_inode);
@@ -477,8 +476,6 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
477476

478477
error = gfs2_dinode_in(ip, dibh->b_data);
479478
brelse(dibh);
480-
clear_bit(GIF_INVALID, &ip->i_flags);
481-
482479
return error;
483480
}
484481

@@ -499,11 +496,9 @@ static int inode_go_instantiate(struct gfs2_holder *gh)
499496
if (!ip) /* no inode to populate - read it in later */
500497
goto out;
501498

502-
if (test_bit(GIF_INVALID, &ip->i_flags)) {
503-
error = gfs2_inode_refresh(ip);
504-
if (error)
505-
goto out;
506-
}
499+
error = gfs2_inode_refresh(ip);
500+
if (error)
501+
goto out;
507502

508503
if (gh->gh_state != LM_ST_DEFERRED)
509504
inode_dio_wait(&ip->i_inode);

fs/gfs2/incore.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,6 @@ struct gfs2_glock {
373373
};
374374

375375
enum {
376-
GIF_INVALID = 0,
377376
GIF_QD_LOCKED = 1,
378377
GIF_ALLOC_FAILED = 2,
379378
GIF_SW_PAGED = 3,

fs/gfs2/inode.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
182182
}
183183

184184
glock_set_object(ip->i_gl, ip);
185-
set_bit(GIF_INVALID, &ip->i_flags);
186185
set_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags);
187186
error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
188187
if (unlikely(error))

fs/gfs2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ static enum dinode_demise evict_should_delete(struct inode *inode,
12441244
if (ret)
12451245
return SHOULD_NOT_DELETE_DINODE;
12461246

1247-
if (test_bit(GIF_INVALID, &ip->i_flags)) {
1247+
if (test_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags)) {
12481248
ret = gfs2_instantiate(gh);
12491249
if (ret)
12501250
return SHOULD_NOT_DELETE_DINODE;

0 commit comments

Comments
 (0)