@@ -179,7 +179,7 @@ static int ocfs2_sync_file(struct file *file, loff_t start, loff_t end,
179179 file -> f_path .dentry -> d_name .name ,
180180 (unsigned long long )datasync );
181181
182- if (ocfs2_is_hard_readonly ( osb ) || ocfs2_is_soft_readonly (osb ))
182+ if (unlikely ( ocfs2_emergency_state (osb ) ))
183183 return - EROFS ;
184184
185185 err = file_write_and_wait_range (file , start , end );
@@ -209,7 +209,7 @@ int ocfs2_should_update_atime(struct inode *inode,
209209 struct timespec64 now ;
210210 struct ocfs2_super * osb = OCFS2_SB (inode -> i_sb );
211211
212- if (ocfs2_is_hard_readonly ( osb ) || ocfs2_is_soft_readonly (osb ))
212+ if (unlikely ( ocfs2_emergency_state (osb ) ))
213213 return 0 ;
214214
215215 if ((inode -> i_flags & S_NOATIME ) ||
@@ -1949,7 +1949,7 @@ static int __ocfs2_change_file_space(struct file *file, struct inode *inode,
19491949 handle_t * handle ;
19501950 unsigned long long max_off = inode -> i_sb -> s_maxbytes ;
19511951
1952- if (ocfs2_is_hard_readonly ( osb ) || ocfs2_is_soft_readonly (osb ))
1952+ if (unlikely ( ocfs2_emergency_state (osb ) ))
19531953 return - EROFS ;
19541954
19551955 inode_lock (inode );
@@ -2713,7 +2713,7 @@ static loff_t ocfs2_remap_file_range(struct file *file_in, loff_t pos_in,
27132713 return - EINVAL ;
27142714 if (!ocfs2_refcount_tree (osb ))
27152715 return - EOPNOTSUPP ;
2716- if (ocfs2_is_hard_readonly ( osb ) || ocfs2_is_soft_readonly (osb ))
2716+ if (unlikely ( ocfs2_emergency_state (osb ) ))
27172717 return - EROFS ;
27182718
27192719 /* Lock both files against IO */
0 commit comments