diff options
| author | Mateusz Guzik <mjguzik@gmail.com> | 2025-10-09 09:59:18 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-10-20 20:22:26 +0200 |
| commit | b4dbfd8653b34b0ab6c024ceda32af488c9b5602 (patch) | |
| tree | 85c4f3c85a868f8735525457a43d94447f13f8bd /fs/hpfs | |
| parent | d8753f788ab4916341d9fab81795be9f2f49c264 (diff) | |
| download | linux-b4dbfd8653b34b0ab6c024ceda32af488c9b5602.tar.gz | |
Coccinelle-based conversion to use ->i_state accessors
All places were patched by coccinelle with the default expecting that
->i_lock is held, afterwards entries got fixed up by hand to use
unlocked variants as needed.
The script:
@@
expression inode, flags;
@@
- inode->i_state & flags
+ inode_state_read(inode) & flags
@@
expression inode, flags;
@@
- inode->i_state &= ~flags
+ inode_state_clear(inode, flags)
@@
expression inode, flag1, flag2;
@@
- inode->i_state &= ~flag1 & ~flag2
+ inode_state_clear(inode, flag1 | flag2)
@@
expression inode, flags;
@@
- inode->i_state |= flags
+ inode_state_set(inode, flags)
@@
expression inode, flags;
@@
- inode->i_state = flags
+ inode_state_assign(inode, flags)
@@
expression inode, flags;
@@
- flags = inode->i_state
+ flags = inode_state_read(inode)
@@
expression inode, flags;
@@
- READ_ONCE(inode->i_state) & flags
+ inode_state_read(inode) & flags
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/hpfs')
| -rw-r--r-- | fs/hpfs/dir.c | 2 | ||||
| -rw-r--r-- | fs/hpfs/inode.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c index 49dd585c2b176d..ceb50b2dc91a9d 100644 --- a/fs/hpfs/dir.c +++ b/fs/hpfs/dir.c @@ -247,7 +247,7 @@ struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry, unsigned in result = ERR_PTR(-ENOMEM); goto bail1; } - if (result->i_state & I_NEW) { + if (inode_state_read_once(result) & I_NEW) { hpfs_init_inode(result); if (de->directory) hpfs_read_inode(result); diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c index 34008442ee265f..93d528f4f4f28d 100644 --- a/fs/hpfs/inode.c +++ b/fs/hpfs/inode.c @@ -196,7 +196,7 @@ void hpfs_write_inode(struct inode *i) parent = iget_locked(i->i_sb, hpfs_inode->i_parent_dir); if (parent) { hpfs_inode->i_dirty = 0; - if (parent->i_state & I_NEW) { + if (inode_state_read_once(parent) & I_NEW) { hpfs_init_inode(parent); hpfs_read_inode(parent); unlock_new_inode(parent); |
