]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
gfs2: Eliminate GIF_INVALID flag
authorBob Peterson <rpeterso@redhat.com>
Tue, 5 Oct 2021 14:10:51 +0000 (09:10 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Oct 2021 06:42:19 +0000 (08:42 +0200)
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>
fs/gfs2/glops.c
fs/gfs2/incore.h
fs/gfs2/inode.c
fs/gfs2/super.c

index e2656baf38a38a38b4a892ca50275b39c52c937a..0b6a59f71eeff0ac5243e12f19f6c7ceb3ee8e36 100644 (file)
@@ -356,7 +356,6 @@ static void inode_go_inval(struct gfs2_glock *gl, int flags)
                struct address_space *mapping = gfs2_glock2aspace(gl);
                truncate_inode_pages(mapping, 0);
                if (ip) {
-                       set_bit(GIF_INVALID, &ip->i_flags);
                        set_bit(GLF_INSTANTIATE_NEEDED, &gl->gl_flags);
                        forget_all_cached_acls(&ip->i_inode);
                        security_inode_invalidate_secctx(&ip->i_inode);
@@ -477,8 +476,6 @@ int gfs2_inode_refresh(struct gfs2_inode *ip)
 
        error = gfs2_dinode_in(ip, dibh->b_data);
        brelse(dibh);
-       clear_bit(GIF_INVALID, &ip->i_flags);
-
        return error;
 }
 
@@ -499,11 +496,9 @@ static int inode_go_instantiate(struct gfs2_holder *gh)
        if (!ip) /* no inode to populate - read it in later */
                goto out;
 
-       if (test_bit(GIF_INVALID, &ip->i_flags)) {
-               error = gfs2_inode_refresh(ip);
-               if (error)
-                       goto out;
-       }
+       error = gfs2_inode_refresh(ip);
+       if (error)
+               goto out;
 
        if (gh->gh_state != LM_ST_DEFERRED)
                inode_dio_wait(&ip->i_inode);
index 19a4c6132c679e15a79e6e7533a500a3de99be89..d5edc27d88b21dec3f14650d89f83cf24a07d252 100644 (file)
@@ -373,7 +373,6 @@ struct gfs2_glock {
 };
 
 enum {
-       GIF_INVALID             = 0,
        GIF_QD_LOCKED           = 1,
        GIF_ALLOC_FAILED        = 2,
        GIF_SW_PAGED            = 3,
index 940d3e37250dfc33816df5230a97ebaad53c6333..9c28b7090895f5d4106b707df8f5a42de59500dd 100644 (file)
@@ -182,7 +182,6 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
                }
 
                glock_set_object(ip->i_gl, ip);
-               set_bit(GIF_INVALID, &ip->i_flags);
                set_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags);
                error = gfs2_glock_nq_init(io_gl, LM_ST_SHARED, GL_EXACT, &ip->i_iopen_gh);
                if (unlikely(error))
index 26c72658004184df4ff3f323b8ce534d3d7c5251..5b121371508a539da16a9fc89389a5019893f2e0 100644 (file)
@@ -1244,7 +1244,7 @@ static enum dinode_demise evict_should_delete(struct inode *inode,
        if (ret)
                return SHOULD_NOT_DELETE_DINODE;
 
-       if (test_bit(GIF_INVALID, &ip->i_flags)) {
+       if (test_bit(GLF_INSTANTIATE_NEEDED, &ip->i_gl->gl_flags)) {
                ret = gfs2_instantiate(gh);
                if (ret)
                        return SHOULD_NOT_DELETE_DINODE;