@@ -302,17 +302,14 @@ __ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh,
302
302
__ext4_xattr_check_block((inode), (bh), __func__, __LINE__)
303
303
304
304
305
- static inline int
305
+ int
306
306
__xattr_check_inode (struct inode * inode , struct ext4_xattr_ibody_header * header ,
307
307
void * end , const char * function , unsigned int line )
308
308
{
309
309
return check_xattrs (inode , NULL , IFIRST (header ), end , IFIRST (header ),
310
310
function , line );
311
311
}
312
312
313
- #define xattr_check_inode (inode , header , end ) \
314
- __xattr_check_inode((inode), (header), (end), __func__, __LINE__)
315
-
316
313
static int
317
314
xattr_find_entry (struct inode * inode , struct ext4_xattr_entry * * pentry ,
318
315
void * end , int name_index , const char * name , int sorted )
@@ -639,9 +636,6 @@ ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name,
639
636
raw_inode = ext4_raw_inode (& iloc );
640
637
header = IHDR (inode , raw_inode );
641
638
end = ITAIL (inode , raw_inode );
642
- error = xattr_check_inode (inode , header , end );
643
- if (error )
644
- goto cleanup ;
645
639
entry = IFIRST (header );
646
640
error = xattr_find_entry (inode , & entry , end , name_index , name , 0 );
647
641
if (error )
@@ -773,7 +767,6 @@ ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size)
773
767
struct ext4_xattr_ibody_header * header ;
774
768
struct ext4_inode * raw_inode ;
775
769
struct ext4_iloc iloc ;
776
- void * end ;
777
770
int error ;
778
771
779
772
if (!ext4_test_inode_state (inode , EXT4_STATE_XATTR ))
@@ -783,14 +776,9 @@ ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size)
783
776
return error ;
784
777
raw_inode = ext4_raw_inode (& iloc );
785
778
header = IHDR (inode , raw_inode );
786
- end = ITAIL (inode , raw_inode );
787
- error = xattr_check_inode (inode , header , end );
788
- if (error )
789
- goto cleanup ;
790
779
error = ext4_xattr_list_entries (dentry , IFIRST (header ),
791
780
buffer , buffer_size );
792
781
793
- cleanup :
794
782
brelse (iloc .bh );
795
783
return error ;
796
784
}
@@ -858,7 +846,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
858
846
struct ext4_xattr_ibody_header * header ;
859
847
struct ext4_xattr_entry * entry ;
860
848
qsize_t ea_inode_refs = 0 ;
861
- void * end ;
862
849
int ret ;
863
850
864
851
lockdep_assert_held_read (& EXT4_I (inode )-> xattr_sem );
@@ -869,10 +856,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
869
856
goto out ;
870
857
raw_inode = ext4_raw_inode (& iloc );
871
858
header = IHDR (inode , raw_inode );
872
- end = ITAIL (inode , raw_inode );
873
- ret = xattr_check_inode (inode , header , end );
874
- if (ret )
875
- goto out ;
876
859
877
860
for (entry = IFIRST (header ); !IS_LAST_ENTRY (entry );
878
861
entry = EXT4_XATTR_NEXT (entry ))
@@ -2233,9 +2216,6 @@ int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
2233
2216
is -> s .here = is -> s .first ;
2234
2217
is -> s .end = ITAIL (inode , raw_inode );
2235
2218
if (ext4_test_inode_state (inode , EXT4_STATE_XATTR )) {
2236
- error = xattr_check_inode (inode , header , is -> s .end );
2237
- if (error )
2238
- return error ;
2239
2219
/* Find the named attribute. */
2240
2220
error = xattr_find_entry (inode , & is -> s .here , is -> s .end ,
2241
2221
i -> name_index , i -> name , 0 );
@@ -2752,10 +2732,6 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
2752
2732
min_offs = end - base ;
2753
2733
total_ino = sizeof (struct ext4_xattr_ibody_header ) + sizeof (u32 );
2754
2734
2755
- error = xattr_check_inode (inode , header , end );
2756
- if (error )
2757
- goto cleanup ;
2758
-
2759
2735
ifree = ext4_xattr_free_space (base , & min_offs , base , & total_ino );
2760
2736
if (ifree >= isize_diff )
2761
2737
goto shift ;
0 commit comments