Skip to content

Commit

Permalink
inode: remove iprune_sem
Browse files Browse the repository at this point in the history
Now that we have per-sb shrinkers with a lifecycle that is a subset
of the superblock lifecycle and can reliably detect a filesystem
being unmounted, there is not longer any race condition for the
iprune_sem to protect against. Hence we can remove it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Dave Chinner authored and Al Viro committed Jul 21, 2011
1 parent b0d40c9 commit 4f8c19f
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,6 @@ static __cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_hash_lock);
__cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_sb_list_lock);
__cacheline_aligned_in_smp DEFINE_SPINLOCK(inode_wb_list_lock);

/*
* iprune_sem provides exclusion between the icache shrinking and the
* umount path.
*
* We don't actually need it to protect anything in the umount path,
* but only need to cycle through it to make sure any inode that
* prune_icache_sb took off the LRU list has been fully torn down by the
* time we are past evict_inodes.
*/
static DECLARE_RWSEM(iprune_sem);

/*
* Empty aops. Can be used for the cases where the user does not
* define any of the address_space operations.
Expand Down Expand Up @@ -542,14 +531,6 @@ void evict_inodes(struct super_block *sb)
spin_unlock(&inode_sb_list_lock);

dispose_list(&dispose);

/*
* Cycle through iprune_sem to make sure any inode that prune_icache_sb
* moved off the list before we took the lock has been fully torn
* down.
*/
down_write(&iprune_sem);
up_write(&iprune_sem);
}

/**
Expand Down Expand Up @@ -635,7 +616,6 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
int nr_scanned;
unsigned long reap = 0;

down_read(&iprune_sem);
spin_lock(&sb->s_inode_lru_lock);
for (nr_scanned = nr_to_scan; nr_scanned >= 0; nr_scanned--) {
struct inode *inode;
Expand Down Expand Up @@ -711,7 +691,6 @@ void prune_icache_sb(struct super_block *sb, int nr_to_scan)
spin_unlock(&sb->s_inode_lru_lock);

dispose_list(&freeable);
up_read(&iprune_sem);
}

static void __wait_on_freeing_inode(struct inode *inode);
Expand Down

0 comments on commit 4f8c19f

Please sign in to comment.