From 0421a189bc8cdefa18a34aee962ac0558679b944 Mon Sep 17 00:00:00 2001 From: Tahsin Erdogan Date: Thu, 22 Jun 2017 10:26:31 -0400 Subject: ext4: modify ext4_xattr_ino_array to hold struct inode * Tracking struct inode * rather than the inode number eliminates the repeated ext4_xattr_inode_iget() call later. The second call cannot fail in practice but still requires explanation when it wants to ignore the return value. Avoid the trouble and make things simple. Signed-off-by: Tahsin Erdogan Signed-off-by: Theodore Ts'o --- fs/ext4/inode.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'fs/ext4/inode.c') diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index fda70fedf56d..1b2a68c5ea42 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -188,7 +188,7 @@ void ext4_evict_inode(struct inode *inode) handle_t *handle; int err; int extra_credits = 3; - struct ext4_xattr_ino_array *lea_ino_array = NULL; + struct ext4_xattr_inode_array *ea_inode_array = NULL; trace_ext4_evict_inode(inode); @@ -257,7 +257,7 @@ void ext4_evict_inode(struct inode *inode) /* * Delete xattr inode before deleting the main inode. */ - err = ext4_xattr_delete_inode(handle, inode, &lea_ino_array); + err = ext4_xattr_delete_inode(handle, inode, &ea_inode_array); if (err) { ext4_warning(inode->i_sb, "couldn't delete inode's xattr (err %d)", err); @@ -345,9 +345,7 @@ void ext4_evict_inode(struct inode *inode) ext4_journal_stop(handle); sb_end_intwrite(inode->i_sb); - - if (lea_ino_array != NULL) - ext4_xattr_inode_array_free(inode, lea_ino_array); + ext4_xattr_inode_array_free(ea_inode_array); return; no_delete: ext4_clear_inode(inode); /* We must guarantee clearing of inode... */ -- cgit v1.2.3