From c12df45ee690112782049b8e85dff2e6cb1b3853 Mon Sep 17 00:00:00 2001 From: Konstantin Komarov Date: Wed, 13 Jul 2022 17:55:27 +0300 Subject: fs/ntfs3: New function ntfs_bad_inode There are repetitive steps in case of bad inode This commit wraps them in function Signed-off-by: Konstantin Komarov --- fs/ntfs3/attrib.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'fs/ntfs3/attrib.c') diff --git a/fs/ntfs3/attrib.c b/fs/ntfs3/attrib.c index 7454bd3ea02d..5ba83eb0fc07 100644 --- a/fs/ntfs3/attrib.c +++ b/fs/ntfs3/attrib.c @@ -1912,7 +1912,7 @@ next_attr: out: up_write(&ni->file.run_lock); if (err) - make_bad_inode(&ni->vfs_inode); + _ntfs_bad_inode(&ni->vfs_inode); return err; } @@ -2092,10 +2092,8 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size) out: up_write(&ni->file.run_lock); - if (err) { - ntfs_set_state(sbi, NTFS_DIRTY_ERROR); - make_bad_inode(&ni->vfs_inode); - } + if (err) + _ntfs_bad_inode(&ni->vfs_inode); return err; } @@ -2282,7 +2280,7 @@ out: up_write(&ni->file.run_lock); if (err) - make_bad_inode(&ni->vfs_inode); + _ntfs_bad_inode(&ni->vfs_inode); return err; } -- cgit v1.2.3