summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2011-03-22 22:23:38 +1100
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-24 21:16:31 -0400
commit02afc410f363f98ac4f186341e38dcec13fc0e60 (patch)
tree2c5d5b2f1556806da135f2323b4df4d7d72d3734 /security
parentb2b2af8e614b4dcd8aca1369d82ce5ad0461a7b1 (diff)
fs: Lock the inode LRU list separately
Introduce the inode_lru_lock to protect the inode_lru list. This lock is nested inside the inode->i_lock to allow the inode to be added to the LRU list in iput_final without needing to deal with lock inversions. This keeps iput_final() clean and neat. Further, where marking the inode I_FREEING and removing it from the LRU, move the LRU list manipulation within the inode->i_lock to keep the list manipulation consistent with iput_final. This also means that most of the open coded LRU list removal + unused inode accounting can now use the inode_lru_list_del() wrappers which cleans the code up further. However, this locking change means what the LRU traversal in prune_icache() inverts this lock ordering and needs to use trylock semantics on the inode->i_lock to avoid deadlocking. In these cases, if we fail to lock the inode we move it to the back of the LRU to prevent spinning on it. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions