mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2024-12-28 16:53:49 +00:00
ubifs: Remove ineffective function ubifs_evict_xattr_inode()
Function ubifs_evict_xattr_inode() is imported by commit272eda8298
("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 commit7959cf3a75
("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>
This commit is contained in:
parent
957e1c4e17
commit
3c50701fd3
@ -2930,8 +2930,6 @@ int ubifs_tnc_remove_ino(struct ubifs_info *c, ino_t inum)
|
||||
dbg_tnc("xent '%s', ino %lu", xent->name,
|
||||
(unsigned long)xattr_inum);
|
||||
|
||||
ubifs_evict_xattr_inode(c, xattr_inum);
|
||||
|
||||
fname_name(&nm) = xent->name;
|
||||
fname_len(&nm) = le16_to_cpu(xent->nlen);
|
||||
err = ubifs_tnc_remove_nm(c, &key1, &nm);
|
||||
|
@ -2040,13 +2040,10 @@ ssize_t ubifs_xattr_get(struct inode *host, const char *name, void *buf,
|
||||
#ifdef CONFIG_UBIFS_FS_XATTR
|
||||
extern const struct xattr_handler * const ubifs_xattr_handlers[];
|
||||
ssize_t ubifs_listxattr(struct dentry *dentry, char *buffer, size_t size);
|
||||
void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum);
|
||||
int ubifs_purge_xattrs(struct inode *host);
|
||||
#else
|
||||
#define ubifs_listxattr NULL
|
||||
#define ubifs_xattr_handlers NULL
|
||||
static inline void ubifs_evict_xattr_inode(struct ubifs_info *c,
|
||||
ino_t xattr_inum) { }
|
||||
static inline int ubifs_purge_xattrs(struct inode *host)
|
||||
{
|
||||
return 0;
|
||||
|
@ -570,28 +570,6 @@ int ubifs_purge_xattrs(struct inode *host)
|
||||
return err;
|
||||
}
|
||||
|
||||
/**
|
||||
* ubifs_evict_xattr_inode - Evict an xattr inode.
|
||||
* @c: UBIFS file-system description object
|
||||
* @xattr_inum: xattr inode number
|
||||
*
|
||||
* When an inode that hosts xattrs is being removed we have to make sure
|
||||
* that cached inodes of the xattrs also get removed from the inode cache
|
||||
* otherwise we'd waste memory. This function looks up an inode from the
|
||||
* inode cache and clears the link counter such that iput() will evict
|
||||
* the inode.
|
||||
*/
|
||||
void ubifs_evict_xattr_inode(struct ubifs_info *c, ino_t xattr_inum)
|
||||
{
|
||||
struct inode *inode;
|
||||
|
||||
inode = ilookup(c->vfs_sb, xattr_inum);
|
||||
if (inode) {
|
||||
clear_nlink(inode);
|
||||
iput(inode);
|
||||
}
|
||||
}
|
||||
|
||||
static int ubifs_xattr_remove(struct inode *host, const char *name)
|
||||
{
|
||||
struct inode *inode;
|
||||
|
Loading…
Reference in New Issue
Block a user