@@ -302,17 +302,14 @@ __ext4_xattr_check_block(struct inode *inode, struct buffer_head *bh,
302302 __ext4_xattr_check_block((inode), (bh), __func__, __LINE__)
303303
304304
305- static inline int
305+ int
306306__xattr_check_inode (struct inode * inode , struct ext4_xattr_ibody_header * header ,
307307 void * end , const char * function , unsigned int line )
308308{
309309 return check_xattrs (inode , NULL , IFIRST (header ), end , IFIRST (header ),
310310 function , line );
311311}
312312
313- #define xattr_check_inode (inode , header , end ) \
314- __xattr_check_inode((inode), (header), (end), __func__, __LINE__)
315-
316313static int
317314xattr_find_entry (struct inode * inode , struct ext4_xattr_entry * * pentry ,
318315 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,
639636 raw_inode = ext4_raw_inode (& iloc );
640637 header = IHDR (inode , raw_inode );
641638 end = ITAIL (inode , raw_inode );
642- error = xattr_check_inode (inode , header , end );
643- if (error )
644- goto cleanup ;
645639 entry = IFIRST (header );
646640 error = xattr_find_entry (inode , & entry , end , name_index , name , 0 );
647641 if (error )
@@ -773,7 +767,6 @@ ext4_xattr_ibody_list(struct dentry *dentry, char *buffer, size_t buffer_size)
773767 struct ext4_xattr_ibody_header * header ;
774768 struct ext4_inode * raw_inode ;
775769 struct ext4_iloc iloc ;
776- void * end ;
777770 int error ;
778771
779772 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)
783776 return error ;
784777 raw_inode = ext4_raw_inode (& iloc );
785778 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 ;
790779 error = ext4_xattr_list_entries (dentry , IFIRST (header ),
791780 buffer , buffer_size );
792781
793- cleanup :
794782 brelse (iloc .bh );
795783 return error ;
796784}
@@ -858,7 +846,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
858846 struct ext4_xattr_ibody_header * header ;
859847 struct ext4_xattr_entry * entry ;
860848 qsize_t ea_inode_refs = 0 ;
861- void * end ;
862849 int ret ;
863850
864851 lockdep_assert_held_read (& EXT4_I (inode )-> xattr_sem );
@@ -869,10 +856,6 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
869856 goto out ;
870857 raw_inode = ext4_raw_inode (& iloc );
871858 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 ;
876859
877860 for (entry = IFIRST (header ); !IS_LAST_ENTRY (entry );
878861 entry = EXT4_XATTR_NEXT (entry ))
@@ -2233,9 +2216,6 @@ int ext4_xattr_ibody_find(struct inode *inode, struct ext4_xattr_info *i,
22332216 is -> s .here = is -> s .first ;
22342217 is -> s .end = ITAIL (inode , raw_inode );
22352218 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 ;
22392219 /* Find the named attribute. */
22402220 error = xattr_find_entry (inode , & is -> s .here , is -> s .end ,
22412221 i -> name_index , i -> name , 0 );
@@ -2752,10 +2732,6 @@ int ext4_expand_extra_isize_ea(struct inode *inode, int new_extra_isize,
27522732 min_offs = end - base ;
27532733 total_ino = sizeof (struct ext4_xattr_ibody_header ) + sizeof (u32 );
27542734
2755- error = xattr_check_inode (inode , header , end );
2756- if (error )
2757- goto cleanup ;
2758-
27592735 ifree = ext4_xattr_free_space (base , & min_offs , base , & total_ino );
27602736 if (ifree >= isize_diff )
27612737 goto shift ;
0 commit comments