Skip to content
Permalink
Browse files
mm/shmem.c: make shmem_mapping() inline
inline the shmem_mapping(), and use shmem_mapping()
instead of 'inode->i_mapping->a_ops == &shmem_aops'
in shmem_evict_inode().

Signed-off-by: Hui Su <sh_def@163.com>
  • Loading branch information
liulangrenaaa authored and intel-lab-lkp committed Nov 13, 2020
1 parent 89331b8 commit 0434762d5523a3d702cd589a7f8e3771fee7b3b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
@@ -63,7 +63,7 @@ extern unsigned long shmem_get_unmapped_area(struct file *, unsigned long addr,
unsigned long len, unsigned long pgoff, unsigned long flags);
extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
#ifdef CONFIG_SHMEM
extern bool shmem_mapping(struct address_space *mapping);
extern inline bool shmem_mapping(struct address_space *mapping);
#else
static inline bool shmem_mapping(struct address_space *mapping)
{
@@ -1084,7 +1084,7 @@ static void shmem_evict_inode(struct inode *inode)
struct shmem_inode_info *info = SHMEM_I(inode);
struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);

if (inode->i_mapping->a_ops == &shmem_aops) {
if (shmem_mapping(inode->i_mapping)) {
shmem_unacct_size(info->flags, inode->i_size);
inode->i_size = 0;
shmem_truncate_range(inode, 0, (loff_t)-1);
@@ -2290,7 +2290,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode
return inode;
}

bool shmem_mapping(struct address_space *mapping)
inline bool shmem_mapping(struct address_space *mapping)
{
return mapping->a_ops == &shmem_aops;
}

0 comments on commit 0434762

Please sign in to comment.