1 fs/inode.c | 23 +++++++++++++++--------
2 fs/smbfs/inode.c | 2 +-
4 include/linux/fs.h | 2 +-
5 4 files changed, 19 insertions(+), 12 deletions(-)
7 --- kernel-2.4.20/fs/inode.c~invalidate_show-2.4.20-rh 2003-05-24 01:56:40.000000000 -0400
8 +++ kernel-2.4.20-root/fs/inode.c 2003-06-02 00:35:37.000000000 -0400
9 @@ -628,7 +628,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 @@ -653,6 +654,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 @@ -671,23 +677,24 @@ 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(&inode_unused_pagecache, sb, &throw_away);
52 - busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
53 - busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
54 + busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
55 + busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
56 + busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away, show);
57 + busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
58 + busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
59 spin_unlock(&inode_lock);
61 dispose_list(&throw_away);
62 @@ -713,7 +720,7 @@ int invalidate_device(kdev_t dev, int do
66 - res = invalidate_inodes(sb);
67 + res = invalidate_inodes(sb, 0);
70 invalidate_buffers(dev);
71 --- kernel-2.4.20/fs/super.c~invalidate_show-2.4.20-rh 2003-05-24 01:56:24.000000000 -0400
72 +++ kernel-2.4.20-root/fs/super.c 2003-06-02 00:35:00.000000000 -0400
73 @@ -943,7 +943,7 @@ void kill_super(struct super_block *sb)
76 sb->s_flags &= ~MS_ACTIVE;
77 - invalidate_inodes(sb); /* bad name - it should be evict_inodes() */
78 + invalidate_inodes(sb, 0); /* bad name - it should be evict_inodes() */
80 if (sop->write_super && sb->s_dirt)
82 @@ -952,7 +952,7 @@ void kill_super(struct super_block *sb)
85 /* Forget any remaining inodes */
86 - if (invalidate_inodes(sb)) {
87 + if (invalidate_inodes(sb, 1)) {
88 printk(KERN_ERR "VFS: Busy inodes after unmount. "
89 "Self-destruct in 5 seconds. Have a nice day...\n");
91 --- kernel-2.4.20/include/linux/fs.h~invalidate_show-2.4.20-rh 2003-06-02 00:31:47.000000000 -0400
92 +++ kernel-2.4.20-root/include/linux/fs.h 2003-06-02 00:35:00.000000000 -0400
93 @@ -1284,7 +1284,7 @@ static inline void mark_buffer_dirty_ino
94 extern void set_buffer_flushtime(struct buffer_head *);
95 extern void balance_dirty(void);
96 extern int check_disk_change(kdev_t);
97 -extern int invalidate_inodes(struct super_block *);
98 +extern int invalidate_inodes(struct super_block *, int);
99 extern int invalidate_device(kdev_t, int);
100 extern void invalidate_inode_pages(struct inode *);
101 extern void invalidate_inode_pages2(struct address_space *);
102 --- kernel-2.4.20/fs/smbfs/inode.c~invalidate_show-2.4.20-rh 2002-11-28 18:53:15.000000000 -0500
103 +++ kernel-2.4.20-root/fs/smbfs/inode.c 2003-06-02 00:35:00.000000000 -0400
104 @@ -167,7 +167,7 @@ smb_invalidate_inodes(struct smb_sb_info
107 shrink_dcache_sb(SB_of(server));
108 - invalidate_inodes(SB_of(server));
109 + invalidate_inodes(SB_of(server), 0);