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