@@ -308,17 +308,14 @@ __ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh,
308
308
__ext4_xattr_check_block((inode), (bh), __func__, __LINE__)
309
309
310
310
311
- static inline int
311
+ int
312
312
__xattr_check_inode (struct inode * inode , struct ext4_xattr_ibody_header * header ,
313
313
void * end , const char * function , unsigned int line )
314
314
{
315
315
return check_xattrs (inode , NULL , IFIRST (header ), end , IFIRST (header ),
316
316
function , line );
317
317
}
318
318
319
- #define xattr_check_inode (inode , header , end ) \
320
- __xattr_check_inode((inode), (header), (end), __func__, __LINE__)
321
-
322
319
static int
323
320
xattr_find_entry (struct inode * inode , struct ext4_xattr_entry * * pentry ,
324
321
void * end , int name_index , const char * name , int sorted )
@@ -650,9 +647,6 @@ ext4_xattr_ibody_get(struct inode *inode, int name_index, const char *name,
650
647
raw_inode = ext4_raw_inode (& iloc );
651
648
header = IHDR (inode , raw_inode );
652
649
end = ITAIL (inode , raw_inode );
653
- error = xattr_check_inode (inode , header , end );
654
- if (error )
655
- goto cleanup ;
656
650
entry = IFIRST (header );
657
651
error = xattr_find_entry (inode , & entry , end , name_index , name , 0 );
658
652
if (error )
@@ -783,7 +777,6 @@ ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size)
783
777
struct ext4_xattr_ibody_header * header ;
784
778
struct ext4_inode * raw_inode ;
785
779
struct ext4_iloc iloc ;
786
- void * end ;
787
780
int error ;
788
781
789
782
if (!ext4_test_inode_state (inode , EXT4_STATE_XATTR ))
@@ -793,14 +786,9 @@ ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size)
793
786
return error ;
794
787
raw_inode = ext4_raw_inode (& iloc );
795
788
header = IHDR (inode , raw_inode );
796
- end = ITAIL (inode , raw_inode );
797
- error = xattr_check_inode (inode , header , end );
798
- if (error )
799
- goto cleanup ;
800
789
error = ext4_xattr_list_entries (dentry , IFIRST (header ),
801
790
buffer , buffer_size );
802
791
803
- cleanup :
804
792
brelse (iloc .bh );
805
793
return error ;
806
794
}
@@ -868,7 +856,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
868
856
struct ext4_xattr_ibody_header * header ;
869
857
struct ext4_xattr_entry * entry ;
870
858
qsize_t ea_inode_refs = 0 ;
871
- void * end ;
872
859
int ret ;
873
860
874
861
lockdep_assert_held_read (& EXT4_I (inode )-> xattr_sem );
@@ -879,10 +866,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
879
866
goto out ;
880
867
raw_inode = ext4_raw_inode (& iloc );
881
868
header = IHDR (inode , raw_inode );
882
- end = ITAIL (inode , raw_inode );
883
- ret = xattr_check_inode (inode , header , end );
884
- if (ret )
885
- goto out ;
886
869
887
870
for (entry = IFIRST (header ); !IS_LAST_ENTRY (entry );
888
871
entry = EXT4_XATTR_NEXT (entry ))
@@ -2246,9 +2229,6 @@ int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
2246
2229
is -> s .here = is -> s .first ;
2247
2230
is -> s .end = ITAIL (inode , raw_inode );
2248
2231
if (ext4_test_inode_state (inode , EXT4_STATE_XATTR )) {
2249
- error = xattr_check_inode (inode , header , is -> s .end );
2250
- if (error )
2251
- return error ;
2252
2232
/* Find the named attribute. */
2253
2233
error = xattr_find_entry (inode , & is -> s .here , is -> s .end ,
2254
2234
i -> name_index , i -> name , 0 );
@@ -2799,10 +2779,6 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
2799
2779
min_offs = end - base ;
2800
2780
total_ino = sizeof (struct ext4_xattr_ibody_header ) + sizeof (u32 );
2801
2781
2802
- error = xattr_check_inode (inode , header , end );
2803
- if (error )
2804
- goto cleanup ;
2805
-
2806
2782
ifree = ext4_xattr_free_space (base , & min_offs , base , & total_ino );
2807
2783
if (ifree >= isize_diff )
2808
2784
goto shift ;
0 commit comments