summaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-10-24 19:40:24 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-25 21:26:15 -0400
commitd895a1c96af8c2a0f6a5e0119695a7c6b92df8db (patch)
tree6c6c72f5a071eb3c1c31b9188e8237d64001b2eb /fs/inode.c
parent7ccf19a8042e343f8159f8a5fdd6a9422aa90c78 (diff)
downloadop-kernel-dev-d895a1c96af8c2a0f6a5e0119695a7c6b92df8db.zip
op-kernel-dev-d895a1c96af8c2a0f6a5e0119695a7c6b92df8db.tar.gz
fs: do not drop inode_lock in dispose_list
Despite the comment above it we can not safely drop the lock here. invalidate_list is called from many other places that just umount. Also switch to proper list macros now that we never drop the lock. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 09e2d7a..1bf2be4 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -482,26 +482,10 @@ static void dispose_list(struct list_head *head)
*/
static int invalidate_list(struct list_head *head, struct list_head *dispose)
{
- struct list_head *next;
+ struct inode *inode, *next;
int busy = 0;
- next = head->next;
- for (;;) {
- struct list_head *tmp = next;
- struct inode *inode;
-
- /*
- * We can reschedule here without worrying about the list's
- * consistency because the per-sb list of inodes must not
- * change during umount anymore, and because iprune_sem keeps
- * shrink_icache_memory() away.
- */
- cond_resched_lock(&inode_lock);
-
- next = next->next;
- if (tmp == head)
- break;
- inode = list_entry(tmp, struct inode, i_sb_list);
+ list_for_each_entry_safe(inode, next, head, i_sb_list) {
if (inode->i_state & I_NEW)
continue;
if (atomic_read(&inode->i_count)) {
OpenPOWER on IntegriCloud