Skip to content

Commit 3c50701

Browse files
Zhihao Chengrichardweinberger
authored andcommitted
ubifs: Remove ineffective function ubifs_evict_xattr_inode()
Function ubifs_evict_xattr_inode() is imported by commit 272eda8 ("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 7959cf3 ("ubifs: journal: Handle xattrs like files"). So the ineffective function ubifs_evict_xattr_inode() can be deleted safely. Signed-off-by: Zhihao Cheng <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 957e1c4 commit 3c50701

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

fs/ubifs/tnc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2930,8 +2930,6 @@ int ubifs_tnc_remove_ino(struct ubifs_info *c, ino_t inum)
29302930
dbg_tnc("xent '%s', ino %lu", xent->name,
29312931
(unsigned long)xattr_inum);
29322932

2933-
ubifs_evict_xattr_inode(c, xattr_inum);
2934-
29352933
fname_name(&nm) = xent->name;
29362934
fname_len(&nm) = le16_to_cpu(xent->nlen);
29372935
err = ubifs_tnc_remove_nm(c, &key1, &nm);

fs/ubifs/ubifs.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2040,13 +2040,10 @@ ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf,
20402040
#ifdef CONFIG_UBIFS_FS_XATTR
20412041
extern const struct xattr_handler * const ubifs_xattr_handlers[];
20422042
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);
20442043
int ubifs_purge_xattrs(struct inode *host);
20452044
#else
20462045
#define ubifs_listxattr NULL
20472046
#define ubifs_xattr_handlers NULL
2048-
static inline void ubifs_evict_xattr_inode(struct ubifs_info *c,
2049-
ino_t xattr_inum) { }
20502047
static inline int ubifs_purge_xattrs(struct inode *host)
20512048
{
20522049
return 0;

fs/ubifs/xattr.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -570,28 +570,6 @@ int ubifs_purge_xattrs(struct inode *host)
570570
return err;
571571
}
572572

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-
595573
static int ubifs_xattr_remove(struct inode *host, const char *name)
596574
{
597575
struct inode *inode;

0 commit comments

Comments
 (0)