Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ubifs: Remove ineffective function ubifs_evict_xattr_inode()

Function ubifs_evict_xattr_inode() is imported by commit 272eda8298dc
("ubifs: Correctly evict xattr inodes") to reclaim xattr inode when
the host inode is deleted.
The xattr inode is evicted in the host inode deleting process since
commit 7959cf3a7506 ("ubifs: journal: Handle xattrs like files").
So the ineffective function ubifs_evict_xattr_inode() can be deleted
safely.

Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Zhihao Cheng and committed by
Richard Weinberger
3c50701f 957e1c4e

-27
-2
fs/ubifs/tnc.c
··· 2930 2930 dbg_tnc("xent '%s', ino %lu", xent->name, 2931 2931 (unsigned long)xattr_inum); 2932 2932 2933 - ubifs_evict_xattr_inode(c, xattr_inum); 2934 - 2935 2933 fname_name(&nm) = xent->name; 2936 2934 fname_len(&nm) = le16_to_cpu(xent->nlen); 2937 2935 err = ubifs_tnc_remove_nm(c, &key1, &nm);
-3
fs/ubifs/ubifs.h
··· 2040 2040 #ifdef CONFIG_UBIFS_FS_XATTR 2041 2041 extern const struct xattr_handler * const ubifs_xattr_handlers[]; 2042 2042 ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size); 2043 - void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum); 2044 2043 int ubifs_purge_xattrs(struct inode *host); 2045 2044 #else 2046 2045 #define ubifs_listxattr NULL 2047 2046 #define ubifs_xattr_handlers NULL 2048 - static inline void ubifs_evict_xattr_inode(struct ubifs_info *c, 2049 - ino_t xattr_inum) { } 2050 2047 static inline int ubifs_purge_xattrs(struct inode *host) 2051 2048 { 2052 2049 return 0;
-22
fs/ubifs/xattr.c
··· 570 570 return err; 571 571 } 572 572 573 - /** 574 - * ubifs_evict_xattr_inode - Evict an xattr inode. 575 - * @c: UBIFS file-system description object 576 - * @xattr_inum: xattr inode number 577 - * 578 - * When an inode that hosts xattrs is being removed we have to make sure 579 - * that cached inodes of the xattrs also get removed from the inode cache 580 - * otherwise we'd waste memory. This function looks up an inode from the 581 - * inode cache and clears the link counter such that iput() will evict 582 - * the inode. 583 - */ 584 - void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum) 585 - { 586 - struct inode *inode; 587 - 588 - inode = ilookup(c->vfs_sb, xattr_inum); 589 - if (inode) { 590 - clear_nlink(inode); 591 - iput(inode); 592 - } 593 - } 594 - 595 573 static int ubifs_xattr_remove(struct inode *host, const char *name) 596 574 { 597 575 struct inode *inode;