]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gfs2: use the new ->i_state accessors
authorMateusz Guzik <mjguzik@gmail.com>
Thu, 9 Oct 2025 07:59:24 +0000 (09:59 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 20 Oct 2025 18:22:27 +0000 (20:22 +0200)
Change generated with coccinelle and fixed up by hand as appropriate.

Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/gfs2/file.c
fs/gfs2/glops.c
fs/gfs2/inode.c
fs/gfs2/ops_fstype.c

index bc67fa058c845997588c3db660e9bcd4be3561bf..ee92f5910ae190715e6383fe8eb1e3851ff64990 100644 (file)
@@ -744,7 +744,7 @@ static int gfs2_fsync(struct file *file, loff_t start, loff_t end,
 {
        struct address_space *mapping = file->f_mapping;
        struct inode *inode = mapping->host;
-       int sync_state = inode->i_state & I_DIRTY;
+       int sync_state = inode_state_read_once(inode) & I_DIRTY;
        struct gfs2_inode *ip = GFS2_I(inode);
        int ret = 0, ret1 = 0;
 
index 0c0a80b3bacab29c0eff2f4f5b749245ca57c615..c94e42b0c94dcf78575af81d35bd8c3354130f86 100644 (file)
@@ -394,7 +394,7 @@ static int gfs2_dinode_in(struct gfs2_inode *ip, const void *buf)
        u16 height, depth;
        umode_t mode = be32_to_cpu(str->di_mode);
        struct inode *inode = &ip->i_inode;
-       bool is_new = inode->i_state & I_NEW;
+       bool is_new = inode_state_read_once(inode) & I_NEW;
 
        if (unlikely(ip->i_no_addr != be64_to_cpu(str->di_num.no_addr))) {
                gfs2_consist_inode(ip);
index 8a7ed80d9f2d6e829b240629bdd18b5e0d30b5fc..890c87e3e3658be95f8eb5ac169b1a6e96c5abc1 100644 (file)
@@ -127,7 +127,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb, unsigned int type,
 
        ip = GFS2_I(inode);
 
-       if (inode->i_state & I_NEW) {
+       if (inode_state_read_once(inode) & I_NEW) {
                struct gfs2_sbd *sdp = GFS2_SB(inode);
                struct gfs2_glock *io_gl;
                int extra_flags = 0;
@@ -924,7 +924,7 @@ fail_gunlock:
        gfs2_dir_no_add(&da);
        gfs2_glock_dq_uninit(&d_gh);
        if (!IS_ERR_OR_NULL(inode)) {
-               if (inode->i_state & I_NEW)
+               if (inode_state_read_once(inode) & I_NEW)
                        iget_failed(inode);
                else
                        iput(inode);
index aa15183f9a168e7c4404d8ae41fad3910dc02be9..889682f051ea0ff74d136b7226c953b5d3f1abf1 100644 (file)
@@ -1751,7 +1751,7 @@ static void gfs2_evict_inodes(struct super_block *sb)
        spin_lock(&sb->s_inode_list_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
                spin_lock(&inode->i_lock);
-               if ((inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) &&
+               if ((inode_state_read(inode) & (I_FREEING | I_WILL_FREE | I_NEW)) &&
                    !need_resched()) {
                        spin_unlock(&inode->i_lock);
                        continue;