Whamcloud - gitweb
- 2.6 fixes landed
[fs/lustre-release.git] / lustre / kernel_patches / patches / invalidate_show-2.6.0.patch
1 Index: linux-2.6.0/fs/inode.c
2 ===================================================================
3 --- linux-2.6.0.orig/fs/inode.c 2004-01-04 15:21:49.000000000 +0300
4 +++ linux-2.6.0/fs/inode.c      2004-01-04 15:25:35.000000000 +0300
5 @@ -351,7 +351,36 @@
6  }
7  
8  EXPORT_SYMBOL(invalidate_inodes);
9
10 +
11 +void show_remaining_inodes(struct super_block *sb)
12 +{
13 +       struct list_head *head;
14 +       struct list_head *next;
15 +
16 +       down(&iprune_sem);
17 +       spin_lock(&inode_lock);
18 +       head = &sb->s_inodes;
19 +       next = head->next;
20 +       for (;;) {
21 +               struct list_head * tmp = next;
22 +               struct inode * inode;
23 +
24 +               next = next->next;
25 +               if (tmp == head)
26 +                       break;
27 +               inode = list_entry(tmp, struct inode, i_sb_list);
28 +               if (atomic_read(&inode->i_count) == 0)
29 +                       continue;
30 +               printk(KERN_ERR
31 +                               "%u:%u %lu (%p) mode %o count %u\n",
32 +                               MAJOR(sb->s_dev), MINOR(sb->s_dev),
33 +                               inode->i_ino, inode,
34 +                               inode->i_mode, atomic_read(&inode->i_count));
35 +       }
36 +       spin_unlock(&inode_lock);
37 +       up(&iprune_sem);
38 +}
39 +
40  int __invalidate_device(struct block_device *bdev, int do_sync)
41  {
42         struct super_block *sb;
43 Index: linux-2.6.0/fs/super.c
44 ===================================================================
45 --- linux-2.6.0.orig/fs/super.c 2004-01-04 15:26:13.000000000 +0300
46 +++ linux-2.6.0/fs/super.c      2004-01-04 15:26:36.000000000 +0300
47 @@ -206,6 +206,7 @@
48                 if (invalidate_inodes(sb)) {
49                         printk("VFS: Busy inodes after unmount. "
50                            "Self-destruct in 5 seconds.  Have a nice day...\n");
51 +                       show_remaining_inodes(sb);
52                 }
53  
54                 unlock_kernel();