4 fs/inode.c | 21 ++++++++++++++-------
5 fs/smbfs/inode.c | 2 +-
7 include/linux/fs.h | 2 +-
8 4 files changed, 18 insertions(+), 11 deletions(-)
10 --- linux-rh-2.4.20-8/fs/inode.c~invalidate_show 2003-04-11 14:04:56.000000000 +0800
11 +++ linux-rh-2.4.20-8-root/fs/inode.c 2003-04-16 20:59:35.000000000 +0800
12 @@ -604,7 +604,8 @@ static void dispose_list(struct list_hea
14 * Invalidate all inodes for a device.
16 -static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
17 +static int invalidate_list(struct list_head *head, struct super_block * sb,
18 + struct list_head * dispose, int show)
20 struct list_head *next;
21 int busy = 0, count = 0;
22 @@ -629,6 +630,11 @@ static int invalidate_list(struct list_h
28 + "inode busy: dev %s:%lu (%p) mode %o count %u\n",
29 + kdevname(sb->s_dev), inode->i_ino, inode,
30 + inode->i_mode, atomic_read(&inode->i_count));
33 /* only unused inodes may be cached with i_count zero */
34 @@ -647,22 +653,23 @@ static int invalidate_list(struct list_h
36 * invalidate_inodes - discard the inodes on a device
38 + * @show: whether we should display any busy inodes found
40 * Discard all of the inodes for a given superblock. If the discard
41 * fails because there are busy inodes then a non zero value is returned.
42 * If the discard is successful all the inodes have been discarded.
45 -int invalidate_inodes(struct super_block * sb)
46 +int invalidate_inodes(struct super_block * sb, int show)
49 LIST_HEAD(throw_away);
51 spin_lock(&inode_lock);
52 - busy = invalidate_list(&inode_in_use, sb, &throw_away);
53 - busy |= invalidate_list(&inode_unused, sb, &throw_away);
54 - busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
55 - busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
56 + busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
57 + busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
58 + busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
59 + busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
60 spin_unlock(&inode_lock);
62 dispose_list(&throw_away);
63 @@ -688,7 +695,7 @@ int invalidate_device(kdev_t dev, int do
67 - res = invalidate_inodes(sb);
68 + res = invalidate_inodes(sb, 0);
71 invalidate_buffers(dev);
72 --- linux-rh-2.4.20-8/fs/super.c~invalidate_show 2003-04-11 14:04:57.000000000 +0800
73 +++ linux-rh-2.4.20-8-root/fs/super.c 2003-04-16 20:59:35.000000000 +0800
74 @@ -943,7 +943,7 @@ void kill_super(struct super_block *sb)
77 sb->s_flags &= ~MS_ACTIVE;
78 - invalidate_inodes(sb); /* bad name - it should be evict_inodes() */
79 + invalidate_inodes(sb, 0); /* bad name - it should be evict_inodes() */
81 if (sop->write_super && sb->s_dirt)
83 @@ -952,7 +952,7 @@ void kill_super(struct super_block *sb)
86 /* Forget any remaining inodes */
87 - if (invalidate_inodes(sb)) {
88 + if (invalidate_inodes(sb, 1)) {
89 printk(KERN_ERR "VFS: Busy inodes after unmount. "
90 "Self-destruct in 5 seconds. Have a nice day...\n");
92 --- linux-rh-2.4.20-8/include/linux/fs.h~invalidate_show 2003-04-16 20:55:35.000000000 +0800
93 +++ linux-rh-2.4.20-8-root/include/linux/fs.h 2003-04-16 20:59:35.000000000 +0800
94 @@ -1283,7 +1283,7 @@ static inline void mark_buffer_dirty_ino
95 extern void set_buffer_flushtime(struct buffer_head *);
96 extern void balance_dirty(void);
97 extern int check_disk_change(kdev_t);
98 -extern int invalidate_inodes(struct super_block *);
99 +extern int invalidate_inodes(struct super_block *, int);
100 extern int invalidate_device(kdev_t, int);
101 extern void invalidate_inode_pages(struct inode *);
102 extern void invalidate_inode_pages2(struct address_space *);
103 --- linux-rh-2.4.20-8/fs/smbfs/inode.c~invalidate_show 2003-04-16 20:59:48.000000000 +0800
104 +++ linux-rh-2.4.20-8-root/fs/smbfs/inode.c 2003-04-16 21:00:43.000000000 +0800
105 @@ -167,7 +167,7 @@ smb_invalidate_inodes(struct smb_sb_info
108 shrink_dcache_sb(SB_of(server));
109 - invalidate_inodes(SB_of(server));
110 + invalidate_inodes(SB_of(server), 0);